Saturday, April 30, 2016

Yii MCQ Questions with Answer for IDB it Scholarship Exam

Posted by Tech Talim


1.  A controller don’t have any default action
a)       True
b)      False   ***
2. The prefix of any method name of a controller is
a)       function
b)      method
c)       action     ***
d)      index
3. A filter can also be an instance of
A. CFilter     ***
B. CController
C. CDatabase
D. CModel
4. Which models are used to store data collected from user input?
A. Active Record Model
B. Form Model      ***
C. Widget
D. CModel
5. To create a text input field, we can call
A. CHtml::textField();
B. CForm::textField()
C. CModel::textField()
D. $form->textField    ***
6. ______________generates a label associated with the specified model attribute.
A. $form->labelEx    ***
B. CHtml::Label
C. CHtml::activeLabel()
D. activeLabel
7. Which is/are ways that not allow you to work with databases?
A. Active Record
B. ADO      ***
C. Query Builder
D. SQL via DAO
8. Which class represents for search from database?
A. CDbConnection  
B. SQLConnection
C. DBConnection
D. CDbCriteria   ***
9. To finish the update data which method need to call?
A. Add()               B. Save()    ***
C. Insert()            D. Insertion()
10. To read data in a database table, which methods we need to call?
A. find()   ***      B. findAll()           ***
C. read()              D. readByPk()
E. findByAttributes()   ***

11. Which is correct ?
A. Chtml::Error()
B. CHtml::error()
C. form->error()     ***
12. Which is correct ?
A. $form->hiddenField()    ***
B. CHtml ->hiddenField()
C. CHtml:: hiddenField()
D. none of the above
13. Which is correct ?
A. $form-> submitButton ()    
B. CHtml -> submitButton ()
C. CHtml::submitButton()      *** 
D. none of the above
14. Which represents a query criteria, such as conditions, ordering by, limit/offset?
A. Query
B. CDbCriteria    ***
C. CQuery
15. AR Meaning
A. Auto Read                      B. Active Rules
C. All Records                     D. Active Records   ***
16. ____method use to delete a row of data ?
A. delete()     ***
B. remove()
C. truncate()
D. All of them
17. The validation is based on the rules specified in the ______method of the AR class?
A. rules()    ***
B. Validation()
C. Check()
18. when you create  a new object of widget class, what is you have to write?
A. Widget
B. CWidget
C. $this->beginWidget()    ***
D. $this->Widget()
19.What is the first parameter of widget object
A. CActiveForm       ***
B. id
C. htmlOptions
D. enableAjaxValidation
20.By default Ajax Validation is false
A. Right    ***
B. Wrong
21. Yii is equipped with a Web-based code generation tool called
A. Yii
B. Gii     ***
C. Zii
D. CI
22. Which base class use to manage authorization?
A. CUserIdentity     ***
B. CUserAuthentication
C. UserIdentity
23. UserIdentity class is located at
A. protected\extention
B. protected\controller
C. protected\components    ***
24.Which is correct
A. this->Error_Username_Invalid
B. this->ERROR_USERNAME_INVALID
C. self:: error_username_invalid
D. self::ERROR_USERNAME_INVALID   ***
25.By default Yii has only one demo user
A. true     
B. false   ***
26.Only digit are support in text field for this which validation rules have to apply
A. alphanumeric
B. integer
C. numeric
D. numerical    ***
27.Where you have to define the relations method
A. controller
B. view
C. module
D. components
E. None of the above   ***
28.What is correct
A.   public $layout='/layouts/aaa;
B.   public $layout='//layouts/aaa/;
C.   public $layout='/layouts/aaa/;
D.   public $layout='//layouts/aaa;    ***
29. By which symbol in access rule define “only login user can access an action “
A.   *
B.   @    ***
C.   #
D. none of the above
30.Which method is incorrect
A.   $this->render
B.   $this->renderPartial
C.   $this-> loadModel
D.   $this-> performAjaxValidation

E.   $this->Validation    ***

0 comments:

Post a Comment