Pages

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: http://upload.wikimedia.org/wikipedia/commons/a/a6/2013_school_wikipedia_quiz.JPG

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)) {
      continue;
   }

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.

regards
Frankie Kam

Font Awesome icons as PNG and JPG image files


Font Awesome is simply awesome! Many thanks to Favid Gandy for this font.

Font Awesome gives you scalable vector icons that can instantly be customized — size, color, drop shadow, and anything that can be done with the power of CSS.


Recently I managed to enable Font Awesome on my Moodle production site. The result is that I am now able to display Font Awesome CSS fonts on any Moodle resource or Moodle activity just by installing Julian Ridden's Font Awesome filter and by following his instructions here and here.



I've created two photomosaics of your images using the Font Awesome icons. This took me almost 30% of a whole day's work. I had to figure out how to automatically convert the Font Awesome icons into PNG files using Python (the toughest part!). Then I had to batch convert 378 PNG files into JPG format (only after a tough web search). Finally, I used AndreaMosaic to create the final mosaics using a combination of 2,000 repeating JPG images of the icons (the easiest part!).

Enjoy.


A photomosaic of the original image found here.

Here's a self-potrait done for fun!



Best viewed from a distance of 3 feet away from the monitor.

If it helps anyone, I've also created a zip file that has the PNG and JPG images of all 378 Font Awesome icons. I doubt if you can find the icons in image format anywhere on the Internet. Of course, Font Awesome, as a graphical font by itself has an advantage over the image format. Anyway for what it's worth, here's the link:
https://dl.dropboxusercontent.com/u/17797520/moodle/Font_Awesome_In_JPG_and_PNG_formats.zip

Regards
Frankie Kam

Ratings and Recommendations by outbrain