new Test() → {Object}
Test - Test class
- Source:
- mathex/res-otto/js/mathex.js, line 1955
Returns:
mathex.Test instance
- Type
- Object
Methods
-
init(questions, options)
Initializes the Test instance
-
Parameters:
Name Type Description questions
Array Array of test question objects options
Object Options Properties
Name Type Argument Default Description steps
Array The steps used for the rating, in asc order, check is made this way: if result <= step sup limit rating
Array Array of objects describing the rating of the steps previously defined. Each object has a message property (text to be shown) and a color property (text color) widgets
Boolean <optional>
false Whether or not to create the widgets @see mathex.Shared - Source:
- mathex/res-otto/js/mathex.js, line 1960
Returns:
voidExample
test.init([question1, question2, question3], { steps: [2, 7, 10], rating: [ {message: 'very bad', color: 'red'}, {message: 'quite good', color: 'yellow'}, {message: 'meow', color: 'green'}, ] });
-
nextQuestion()
Goes to the next questions or the end of the test
-
- Source:
- mathex/res-otto/js/mathex.js, line 2022
Returns:
void -
renderResults()
Renders the test final rating
-
- Source:
- mathex/res-otto/js/mathex.js, line 2036
Returns:
void -
saveResult()
Stores the given result
-
- Source:
- mathex/res-otto/js/mathex.js, line 2012
Returns:
void -
start()
Executes the given index question
-
- Source:
- mathex/res-otto/js/mathex.js, line 1992
Returns:
void