Quiz Scenario
Type of question: Multichoice (only one answer, with the options provided as radio buttons).
The question has negative marking for wrong answers
A student selects an option. But later change their mind and decide to leave the question unanswered.
Issue
Currently, the student is not able to clear their answer, and hence is forced to select at least one option.
Related forum discussions / tracker issues
Following are the few discussions on forums and tracker based on deselecting the selected answer in quiz.
Previously proposed ideas / solutions
Some of the ideas proposed in above forum discussions are :
Adding an extra choice to the given question as "No answer", worth zero points.
Using the multiple answer version as that allows students to check and uncheck the answers.
(With the 2nd solution discussed, unless we specify that there is only one correct answer, it gives a wrong idea to the students that there could be multiple correct answers when the quiz can have requirements of only one correct answer per question. )
The above given solutions are just tweaks to deal with the current scenario, where there is no feature of clearing the selected option.
Proposed solution
The user journey will be as follows :
When setting a multiple choice question, the teacher will have a choice whether or not to include a clear button in the quiz (in a case the teacher chooses to have negative marking), which can be done by checking/unchecking a checkbox provided for the same while setting up the quiz.
A Clear button appears in all the multichoice questions.
When the student answers a multichoice question, and later decides not to answer it, they will now have an option to clear it. This is recorded in the audit trail.
From the evaluator’s perspective, the last state of the answer will be used, irrespective of whether the last attempt was correct or wrong, or unanswered.
Development done till date
Currently, we have developed one outline logic (key steps) to implement only points 2 to 4 above.
We are using javascript to clear the selected radio button.
The clear button is implemented in an ad-hoc manner (through ‘Additional HTML’, the process is shown below), just to show a proof of the concept. Later it will be added by the plugin to the page renderer.
The attempt history is also being updated at every step of question attempt.
To enable the ‘clear’ functionality work on your moodle, do the following :
Write the HTML Part to add the ‘Clear’ button (see below)
Apply the patch (given in the attachment).
To add the HTML Part i.e., ‘Clear Button’, we are currently using the ‘Additional HTML’ feature available to the site administrators.
The path for the same is :
Site Administration -> Appearance -> Additional HTML
Within Head, add the following link to JQuery :
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js" type="text/javascript"></script>
Before body is closed, add following script to add clear button after options of every question of type ‘Multichoice’ :
<script>
if ($("input[type]").is(":radio")) {
$(".answer").append("<button type='button' name='clear' >Clear</button>");
}
$('button[name=clear]').on('click', function() {
$(this).closest('.answer').find(':radio').prop('checked', false)
});
if ($('.content').parent().hasClass("deferredfeedback")) {
if ($(' .answer .r0 input').prop('disabled')) {
$("button[name=clear]").remove();
}
} else {
if (!($('div.im-controls').length)) {
$("button[name=clear]").remove();
}
}
</script>
The patch to be applied is provided as an attachment.
Work to be done
- This feature works, as of now, only for the following question behaviours
- Deferred Feedback
- Immediate Feedback
- Interactive with multiple tries
It will be implemented for other question behaviours later.
Adding the ‘clear’ button HTML code in core moodle code.
Clear Button is still visible after the attempt is over in Immediate Feedback and Interactive with multiple tries that too in some Layouts(e.g Multiple Questions on single page) otherwise it is working fine.We are working on this part and will be implemented soon.
‘Clear Button’ feature will be made optional, i.e., a checkbox will be provided in Quiz Settings and hence, the teacher will have a choice whether or not to have ‘Clear Button’ in MCQs.
Please give us your valuable feedback!