Nice new possibility for styling quizzes / questions

Nice new possibility for styling quizzes / questions

by Tim Hunt -
Number of replies: 1
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I just made a nice little change to how questions are output, which will be pointless unless people know about it, so I thought I would make a quick post here.

When a question is output, it is wrapped in an outer div. For along time (up to an including Moodle 2.0) the div was

<div class="que multichoice" ...>

That is, que to identify this as a question, and then the quetstion type.

In Moodle 2.1 we have a new concept 'question behaviour', so the div is currently something like

<div class="que multichoice deferredfeedback" ...>

and, assuming the integrators don't reject my changes, from next week it will be something like

<div class="que multichoice deferredfeedback incorrect" ...>

That is, the current state of the question will be there. That gives you the option of styling any part of the question according to the current state.

Note that this respects the quiz settings, so if the teacher has turned off Review options -> Whether correct, then the class name will just be complete rather than correct / partiallycorrect / incorrect.

I am not proposing to change any of the standard themes to take advantage of this, but I thought you might like to be aware of it.

The issue number is MDL-28653

Average of ratings: -