Monday, October 21, 2013

How to hide the Description Question Type boxes in the Quiz Navigation 'block'/section of Moodle 2.x.

School quiz. Source:

The Description Question Type is useful when you want to include text or graphics before a quiz section. The one problem I find is that the Quiz Navigation block will show up a  [i] box for every Description question type. Not very user-friendly for the student who is taking the quiz.

For three days I searched for a solution to the problem. Talk about tough!

After many hits and misses, I finally got it! I just had to add the following code

   if (!$this->attemptobj->is_real_question($slot)) {

to the file named attemptlib.php. The magic code goes immediately inside the foreach loop of the public function get_question_buttons() function, like so:

The effect of this code hack is immediately apparent. Here's what the Quiz Navigation block looks like now.

I find this a very elegant solution to a real design and usability problem. Do you agree? I hope this will be useful for your quizzes.

Frankie Kam

If you like this post or site
a small donation would be nice but would last only a day,
otherwise leaving a comment (or a compliment) below will last me a month!

No comments:

Post a Comment

Ratings and Recommendations by outbrain