My first experience with the Quiz module was amusing, to say the least. A project, which I had just finished, required registered users to be able to take different quizzes and successfully complete them in order to receive a certificate. I turned to the quiz module to avoid any custom coding. Overall, I was able to do what I needed. However, below I have listed three issues I had ran into:

1. No import/export of quizzes. The quiz module uses nodes to represent each quiz and then associates that quiz to other nodes that are of type “question”. This method works flawlessly through the user interface because the actual quiz node has a page (manage questions) that allows you to filter/search for a question to add to the quiz. This way, a question can appear in multiple quizzes. The problem arose when I had to deploy the project to different locations (server). There was no way to export/import the quizzes that I had already built, short of copying the entire database. To work around this, I wrote updated scripts to do a node_save() of the quiz to create the quiz and then an import function, which would create question nodes from a csv file that contained the question details.

2. Questions all have their own page The current build (3) of the quiz module does not allow the quiz to have all the questions displayed on the same page. This results in the user needing to answer one question at a time and then clicking a “next” button to proceed with the next question. I was lucky enough to have clients who agreed to this type of functionality. I did not need to do any custom coding, but I think this feature might be a nice addition for future builds.

3. Scoring of multiple choice questions with no correct answer The module allows you to specify the correct answer for each multiple choice question but there are times when questions/quizzes do not have correct answers (scale of 1 to 5). This proved to be problematic because one of the project requirements was to compare user scores on a scale and since the module only tracked right or wrong answers, the module could not accommodate this requirement out of the box. To get around this, I had to retrieve the multiple choice questions from the database, assign a value to each option via its delta, and then compare each user result answer to get the score for that question for that user. It was not a very complex query, but custom nonetheless. Obviously before using the module I read up on its current capabilities and I was happy to see that most, if not all, of these features were being included in the next version of the module. Unfortunately, I’m disappointed at the same time because was hoping to use them for this project. I do not know the specific date set for Quiz 4 completion, and as I write this I believe it is currently in its Alpha build state.

Read Next
Appnovation Blog Default Header

Scraping a website into Drupal using Perl

04 December, 2009|4 min