All or Nothing MC: Incorrect selections are not marked as wrong (no "X")

All or Nothing MC: Incorrect selections are not marked as wrong (no "X")

by Scott Andre -
Number of replies: 2

We are using version 2.6 currently.

Our desire is to provide the learner feedback for incorrect selections - specifically items that were correct but the user did NOT mark as correct. In the example below, all items should have been selected. I expected the non-checked items would have had a red X and/or be highlighted in red. The lack of feedback makes the learner think they were correct. On the right is what I would consider our desired state. Am I doing something wrong in the setup?

Incorrect not marked     Desired State

Average of ratings: -
In reply to Scott Andre

Re: All or Nothing MC: Incorrect selections are not marked as wrong (no "X")

by Jean-Michel Védrine -

Hello Scott,

I understand what you consider the good display of multichoice questions but this is not how it currently work. A choice is marked as right or wrong (green or red) only if it was chosen by the student.

The fact that the choice  was a right or wrong answer is not indicated in this way (but you can choose to display "the correct answer is ... to display the correct answers to students).

The all or nothing question type contains absolutely not code for question display, because it just use the code from the core multichoice question.

You can try this yourself: create an ordinary multichoice (not an all or nothing question) question choosing the "Multiple answers allowed" option and you will see that the behaviour is exactly the same.

If you want to change that, and if you have some php knowledge, you would have to create a new file question/type/multichoiceset/renderer.php and put some code in it to extend the multichoice_multi_renderer class (don't forget to put require_once($CFG->dirroot . '/question/type/multichoice/renderer.php'); at the beginning). The function you must change is formulation_and_controls and specifically the lines

if ($options->correctness && $isselected) {
                $feedbackimg[] = $this->feedback_image($this->is_right($ans));
                $class .= ' ' . $this->feedback_class($this->is_right($ans));
            } else {
                $feedbackimg[] = '';
            }

to remove the $isselected

In reply to Jean-Michel Védrine

Re: All or Nothing MC: Incorrect selections are not marked as wrong (no "X")

by Jean-Michel Védrine -

I forgot to say that you will also have to add a function in question/type/multichoiceset/question.php to the qtype_multichoiceset_question class so that you renderer is used

    public function get_renderer(moodle_page $page) {
        return $page->get_renderer($this->qtype->plugin_name());
    }

Because the parent qtype_multichoice_multi_question  has a similar function to set the renderer to it's own one