Class: TestRadioQuestion

mathex. TestRadioQuestion

new TestRadioQuestion(options) → {Object}

Test - Test radio question, answer with one multiple radio choice

Parameters:
Name Type Description
options Object Options
Properties
Name Type Description
question String The question and answer template to be parsed

The math to be parsed by mathjax (latex syntax) must be placed inside the tag {%%}, i.e. {% 2^4=16 %}

The radio choices must be written this way: [[1]] choice, where 1 is the index of the choice.

result Number The index of the correct answer
Source:
Returns:
mathex.TestRadioQuestion instance
Type
Object
Example
 var question3 = new mathex.TestQuestion('radio', {
   question: 'Which equation is wrong?' + 
     '<ul>' +
     '<li>[[0]] {% 5^3 * 5^4 = 5^7 %}</li>' +
     '<li>[[1]] {% 2^5 * 3^5 = 6^5 %}</li>' +
     '<li>[[2]] {% 9^6 + 9^2 = 9^8 %}</li>' +
     '<li>[[3]] {% 7^8 : 7 = 7^7 %}</li>' +
     '</ul>',
   result: 2,
 });

Methods

checkAnswer()

Cheks the user answer, saves the result and proceeds with the next question

Source:
Returns:
void

run(test)

Executes the test question

Parameters:
Name Type Description
test Object The mathex.Test instance
Source:
Returns:
void