16 Jun 2009

Quiz

butcher's picture
Senior Engineer and Team Lead
2

The Quiz module has a venerable heritage. One glance at the list of previous committers indicates this. Many of the previous maintainers of the module now work on Drupal core. When I began maintaining it late last year, I found that list of names daunting. But there was work to do. While Quiz has been around since the Drupal 4.6 days, when I was granted access in September of last year, it needed a little attention.

I wanted to share how we've been working to improve it. In my time at Palantir.net, we've made two major releases of Quiz and added many new features.

Quiz 2: I picked up the project late in the development cycle for Quiz 2. Westwesterson had already done substantial work. The release cycle for me primarily involved porting to Drupal 6 and managing the bug fixing cycle.

Soon after Quiz 2 was released, we began working on new features. This was the beginning of the Quiz 3 development cycle that culminated early this month with the final release of Quiz 3.0.

The Social Aspects: Before diving into the technical details surrounding Quiz 3, there are some social aspects of the project that deserve mention. Since the release of Quiz 2, the project gained momentum. Downloads went up 500%. The Quiz group on Drupal Groups became more active, and - for better or worse - the Quiz issue queue has also experienced growth. People from all over the world began weighing in, telling us how they used Quiz, how they wanted to use Quiz, and, indeed, what was wrong with Quiz. Some of the more technically savvy users began contributing patches. Bugs were fixed, progress was made, and the community as a whole was strengthened.

When Google announced the opening of the Summer of Code 2009 project, I was thrilled to see a student interested in spending his summer improving Quiz. Sivaji submitted an excellent proposal for improving Quiz. His focus on academic applications for Quiz mirrored my own interests. His acceptance into the GSOC program was exciting, but unsurprising (given the high quality of his proposal). Sivaji quickly dove into development, and has been instrumental in the maturation and release of Quiz 3.

More Question Types: From its inception to version 2, the Quiz module had only one available question type. The multichoice sub-module provided multiple choice question types for quizzes. The module system upon which Quiz was built made it possible to write additional question types, but each question type required vast amounts of code, most of which was merely duplicated from type to type.

The pattern of code re-use was easy to identify and abstract, so we built an object oriented framework that made it possible to define new question types in a few hundred lines of code instead of a few thousand. This became the Quiz Questions module, which in turn served as the basis for several new question types:

  • True/False: True and false questions could be emulated with the multichoice module, but a real True/False question type afforded some advantages. First, it was easier to manage in several ways. Second, due to its simplicity, it provides a great example for other developers wishing to create custom question types.
  • Long Answer: Essay questions were another frequently requested question type. The Long Answer module allows quiz creators with a type that solicits longer text-based answers, and also allows for a human scorer and a variable scoring scale (that is, a long answer question needn't be worth only one point).
  • Matching: A matching module was begun long ago, but never took flight. Sivaji took the empty shell of a module and, in about 24 hours, built a fully functional Matching module.
  • Short Answer: Essays aren't the only text-based question type that Quiz users have been clamoring for. Questions soliciting short text answers are also desirable. The new Short Answer module provides support for such questions, along with four scoring options: automatic case-sensitive matching, automatic case-insensitive matching, automatic regular expression matching, and manual scoring by an administrator.
  • Quiz Directions: Users have also long asked for the ability to insert directions into the quiz at arbitrary intervals. Such a capability allows quiz authors to break quizzes into sections or make specific grading policies explicit during the quiz. Even though this is an un-scored item, the general question framework developed for defining new types could be leveraged to create this kind of content.

General Improvements: Having more question types has certainly made Quiz a more appealing project for those evaluating Drupal as a course management tool. But we have made many other improvements that should increase the attractiveness and usability of the Quiz module.

The administration interface has been re-written using the latest Drupal 6 JavaScript technologies. Drag-and-drop reordering, autocompletion-based question lookups, and an improved layout have made quizzes easier to manage. With full Views 2 support (added by Sam "sdboyer" Boyer), administrators can generate reports, custom views of available quizzes, and customized scoring interfaces.

Support for timed quizzes has always been difficult, as it is hard to keep the user notified about how much time is left for the completion of a quiz. Sivaji added sophisticated timing code to keep a JavaScript timer synchronized with the server. Timed quizzes are now easy to create and take.

Quiz Question Import: The last major feature added to Quiz 3 is a question importer. Sivaji began this module as part of his GSOC project. I, too, needed support for this feature. Together, we created an importer capable of reading multiple standard input formats and extracting quiz questions. This feature was among the last to make it into Quiz 3 before we froze the code. And one of the first features added to Quiz 4 (thanks to Turadg, a new Quiz contributor) is a question export tool.

Many other bugs have been fixed. Minor features have been added. Quiz question types, for example, can now have CCK fields attached to them. But a thorough description of all of these would bore even the most patient of readers. Suffice it to say, the last six months have been very exciting in the Quiz world. It has been a privilege and an honor to shepherd two versions of this venerable module.

Quiz 4 is shaping up to be another exciting release full of improvements and features. Sivaji is hard at work implementing some of the sophisticated features from his GSOC proposal, and new patches have been rolling in steadily from several new contributors. (Many of these patches will be added to Quiz 3.1.)

For me, Quiz is an example of the success of Open Source. It is a module that has had its fits and starts. It has transitioned through several maintainers, each of whom has left a positive mark on the code-base. It's boundaries have been stretched and redefined - and sometimes contracted again, lest its focus be lost. Like any Open Source project, Quiz will always be a work in progress. It will be adapted to meet the needs of the community. But at each stage along the way, we hope we have built a reliable tool that will benefit the community.

Comments

Great history, great module

Great work everybody! One bit of trivia concerning the quiz module; the original idea was financed with a reverse bounty (Boris Mann was promoting this form of fund raising at the time), and Chx wrote the very first implementation.

So, is there a "Drupal Quizzes" site? Who's going to build it? We could probably crowd source the best open source training site ever made with this tool.

Drupal Quizzes site

Robert, I'm glad you asked! :)

I've been working extensively on the Quiz module this summer to make a platform for open educational resources for assessment and practice. The platform, QCommons, will handle any topic area. I'm starting out focused on one topic to get that design ironed out and the first topic is chemistry. Please take a look at my blog post introducing Chemistry.QCommons.org and let me know what you think.

http://openeducationresearch.org/2009/09/qcommons-chemistry-bank/