This sample demonstrates how QuML is used to model a simple multiple choice question (with multiple answers), configure the interactions & process the responses to produce results.
This question is a multiple choice question where the correct answer has two values - “Hydrogen” and “Oxygen”. Below is the logic for evaluating and processing the question:
If student selects both the correct answers, the score should be 1.0
If student selects only one of the correct answers, the score should be 0.5
If student selects any of the wrong answers, a value of 0.5 should be removed from the total score
If total score if 1.0, show the message “Well done!!!”
If total score is between 0 and 1.0 (not including 0 and 1.0, i.e. 0 < score < 1.0), show the message “Better luck next time!!!”
If total score is less than or equal to 0, show the message “You need to work harder!!!”
Body
<!-- Question Title -->
<div class=”title”>Composition of water</div>
<!-- Question Text -->
<div class=”sub-title”>Which of the following elements are used to form water?</div>
<!-- Answer options defined using html checkbox elements -->
<div class=”vertical-options”>
<input type="checkbox" name="element" data-multi-choice-interaction data-response-variable="RESPONSE" value="Carbon"/>
<span class=”paragraph”>Carbon</span><br>
<input type="checkbox" name="element" data-multi-choice-interaction data-response-variable="RESPONSE" value="Oxygen">
<span class=”paragraph”>Oxygen</span><br>
<input type="checkbox" name="element" data-multi-choice-interaction data-response-variable="RESPONSE" value="Hydrogen">
<span class=”paragraph”>Hydrogen</span><br>
<input type="checkbox" name="element" data-multi-choice-interaction data-response-variable="RESPONSE" value="Nitrogen">
<span class=”paragraph”>Nitrogen</span><br>
</div>
{
“feedback”: {
“feedback_01”: “<h1>Well done!!!</h1>”,
“feedback_02”: “<h1>Better luck next time!!!</h1>”
“feedback_03”: “<h1>You need to work harder!!!</h1>”
}
}