new Question(prop) → {Object}
Questions - Question class
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
prop |
Object | Properties object
Properties
|
- Source:
- mathex/res-otto/js/mathex.js, line 1227
Returns:
mathex.Question instance
- Type
- Object
Example
var question = new mathex.Question({
text: '2. Which of the following is an identity?',
answers: [
'{% 3x = 9 %}',
'{% 2a = 5 %}',
'{% 7 + 8 = 16 %}',
'{% 15 - 9 = 6 %}'
],
correct_answer: 3
})
Methods
-
checkAnswer(index, correct)
Checks the user answer
-
Checks the answer, updates the gui, saves the rating and shows a response message to the user
Parameters:
Name Type Description index
Number Index of the choosen answer correct
Number Index of the correct answer - Source:
- mathex/res-otto/js/mathex.js, line 1270
Returns:
void -
removeEvents()
Removes events from inputs
-
- Source:
- mathex/res-otto/js/mathex.js, line 1316
Returns:
void -
run(router)
Executes the question
-
Renders the question activating the answers
Parameters:
Name Type Description router
Object The mathex.QuestionRouter instance - Source:
- mathex/res-otto/js/mathex.js, line 1243
Returns:
void -
setLast()
Sets the last property to true
-
- Source:
- mathex/res-otto/js/mathex.js, line 1234
Returns:
void