There was an error in this gadget

Saturday, January 31, 2009

The Drupal Quiz module

One of my key interests in Drupal these days is the Quiz module. As often as I can find time, I've been working on improving the module. So far, since I have inherited code maintainership, I have upgraded it to Drupal 6, released the 2.x branch, begun development on the 3.x branch, and added support for a new question type (long answer).

Right now I'm working on this crazy (in the Drupal world) idea: I'm architecting a generic object-oriented framework that should make it easy to add question types. Historically, the quiz module has only supported one type -- the so-called "multichoice" type. This one type is supposed to function as:
  • Multiple choice, single answer
  • Multiple choice, multi-answer
  • True/false
  • Personality-style multiple choice (no right/wrong answer)
The concept is interesting. Much of the logic between these four is shared. And the theory behind initial development was, apparently, that if they were so similar, they could simply all be covered by one set of functions.

This idea seemed to hold true... to a point. But as more and more feature requests come in (many of them not only reasonible requests, but features that really ought to have been in there for a long time -- like being able to skip a question), a choice has to be made:

Create a UI that is so complex that it will require training to use, or break out question types again.

I'm obviously not a fan of the first. I think the current (2.x) branch has a horribly complex process for creating tests, and the issue queue is too full of questions that shouldn't have to be asked.

I started down the second path by first implementing a new question type (rather than beginning by breaking down the multichoice module into several smaller pieces). I started by creating a long-answer question type.

What I discovered was this: Huge portions of the code were just copy-n-paste jobs from the multichoice module. (Actually, they were copy, paste, delete lots of conditionals jobs.) This got me thinking. The obvious solution for a situation like this (when you are working in an OO language) is to abstract and extend. That has long been looked at as un-drupalish, so I initially put the idea out of my mind.

But when I started attempting to add some other new features (in the afformentioned class of things that really ought to be there), I discovered that I was constantly running into roadblocks imposed by the lumping together of multiple choice types that should really be separate. And, really, the only way to separate them without cloning hundreds and hundreds of lines of code is to employ a decent OO architecture.

I've got the class model just about done. When I finish implementing it, I am estimating that it will take about two hours to create a True/False question type -- the simplest type. Other types will not take much longer. Reporting should be much easier, too. And perhaps even Views integration will take less time. That would be nice.

48 comments:

M Butcher said...

Incidentally, I am planning a QueryPath-based XML importer for the module.

Turadg said...

These are great developments for the Quiz module. In particular I'm excited about M Butcher's XML importer.

2009 oss sınav sonucları ogren said...

Incidentally, these Formula 21 are great for my

steve said...

Above information is excellent and i learned few new points through this blog.Register a Domain

Domain Registration said...

We provide services of Domain Booking Through Debit Card and Domain Registartion With Debit Card In Chennai. Domain Registration | Web Hosting Chennai | Domain Registration Debit Card | Domain Registartion Credit Card | Domain Booking Through Debit Card | Domain Registartion With Debit Card | Website Registration | Domain Hosting In Chennai

gohost said...

I truly recognize that which you web site in right here, really insightful and smart.hosting server

Domain services said...

Very important topicThis is obviously one great post I keep on reading articles from here.keep up it
Register domain name

AyuNk Syah said...

Saat ini Lingkar Merah Terbaik Indonesia juga mengikuti kontes PGM-FI Sepeda Motor Injeksi Irit Harga Terbaik Cuma Honda Acer Aspire S3 Ultrabook Notebook Tipis Harga Murah Terbaik dan keuntungan memiliki kartu aku dalam Promo Member Alfamart Minimarket Lokal Terbaik Indonesia. Mohon Dukungan ya...!!!

info sejati said...

thanks for share information

kata kata mutiara | kata kata cinta | sms lucu

Zaenal Abidin said...

I will bookmark this page. Thanks for sharing this important information.

I was searching the internet for this for very very long time. So, I should say thaks you very much for the post, great info.

please visit me on Blogger SEO Blogspot (simple blog). I made a couple of articles about Promo Member Alfamart Minimarket Lokal Terbaik Indonesia, Sepeda Motor Injeksi Irit Harga Terbaik Cuma Honda, and Kucoba.Com Tempat Add Bookmark Gratis of the various companies. I hope you would want to visit and support me.

allshare zone said...

this article is very userful...
i like this.. and would to bookmart your site

Kata Kata Mutiara

Djack Ria said...

thank's for article Kucoba.com Tempat Add Bookmark

Cokie said...

Sepeda Motor Injeksi Irit Harga Terbaik Cuma Honda dengan teknologi Fuel Injection (PGM-Fi) dari produsen sepeda motor Honda terbaik yang telah memproduksi sepeda motor dengan teknologi terbaru yang irit bahan bakar. Alfamart minimarket terbaik dan sebagai Minimarket Pertama yang memiliki member terbanyak di Indonesia Alfamart memberikan Promo Member Alfamart Minimarket Lokal Terbaik Indonesia.

Ryo Jeo said...

Promo Member Alfamart Minimarket Lokal Terbaik Indonesia
Hematku dan Kalender Belanja
Program ini adalah program khusus Member Alfamart, dimana member akan mendapatkan potongan harga khusus member untuk produk-produk tertentu sesuai dengan periode promosi. Dengan menunjukkan Kartu Member di kasir saat melakukan pembayaran, maka otomatis Member akan mendapatkan potongan harga untuk produk-produk tersebut. Untuk info produk HematKu dan Kalender Belanja terdapat di leaflet Alfamart yang terbit setiap dua minggu sekali atau poster yang ada di Alfamart terdekat.

Unknown said...

In Drupal 6 you could enable WYSWYG functionality by installing external modules, but they never seemed to work quite right. Drupal 7 makes the integration of WYSWYG editors more seamless. The end result is that they work better.hosting

uzma khan said...

Excellent post.


"Great effort.Keep up it..
A night out Online Slots"

A night out Online Slots

Nabilah Azalia said...

thanks for the information.
Disukai.Com | Gokilsite | Harga Emas Hari Ini | Paket Internet Smartfren | Desain Dapur Minimalis

uzma khan said...

An interesting page you have in here. Thanks for sharing. Definitely awesome. Impressive indeed.
Slot machines Night out.

makna kehidupan said...

sangat bagus
Sepeda Motor Bebek Injeksi Kencang dan Irit Jupiter Z1 dan juga informasi berita bola

terima kasih,

masaiya iyasih said...

very nice and so brilliantly, especially because you can share it with all bloggers
Sepeda Motor Bebek Injeksi Kencang dan Irit Jupiter Z1

www.doceknove.org said...

I will bookmark this page. Thanks for sharing!!!
I like this..
http://www.doceknove.org/
docek nove godine,nova godina, novogodisnje zurke,docek nove godine splavovi,nova godina klubovi, docek nove godine Beograd..
Thanks for share.

Unknown said...

The open source software, used world-wide, is one of the most popular CMSs used for building and supporting websites. The popularity of Drupal is based primarily on its many features, its flexibility, and its ease of use. WHOIS Lookup

jimmi dexter said...

I genuinely loved this brilliant article.Please continue this awesome work.Thumbs up, and keep it going!Regards:remedies for diarrhea

admin said...

Happy Life Foot Patch


Cara Memutihkan Kulit

Ryo Jeo said...

Kontes SEO Terbaru Bank Mandiri Bank Terbaik di Indonesia Periode 24 Desember 2012 – 25 Februari 2013 – ada juga kontes seo yang sedang berlangsung seperti Commonwealth Life Perusahaan Asuransi Jiwa Terbaik Indonesia dan Juga Ekiosku.com Jual Beli Online Aman Menyenangkan

Pengelola website said...

thanks for your informations!!
obat jantung koroner ace maxs obat tradisional diabetes melitus

Asha Dalvi said...

This is wonderful Quiz module, could you please provide some more modules that will be great help from your side. personal injury attorney reno nv

Asha Dalvi said...
This comment has been removed by the author.
pratishtha said...

that is so complex that it will require training to use, or break out question types again.Parallelism, sentence variety, and sentence clarity are necessary to effectively complete your body paragraphs

wasim said...

Thanks to our friends at MadMedia Productions, who have deep experience in the desert racing world, we were able to get Chad Ragland for our driving duties. Cheap Website Design

wasim said...

I should say thaks you very much for the post, great info. Virtual Office London

M.SAJJAS said...

ini adalah program khusus Member Alfamart, dimana member akan mendapatkan potongan harga khusus member untuk produk-produk tertentu sesuai dengan periode promosi. Dengan menunjukkan Kartu Member di kasir saat melakukan pembayaran, maka otomatis Member akan mendapatkan potongan harga untuk produk-produk tersebut. Untuk info produk HematKu danText Compare

John Smith said...
This comment has been removed by the author.
sse said...

They say they’ve been taxed and regulated to death for decades, and they have no choice but to do what they can to claw their way back into profitability. solution erp

sse said...
This comment has been removed by the author.
sse said...

Enormous information in one blog post, I just love it. I must appreciate and mention that you completely know how to keep connected reader to blog post even if it is little long. Very good job. Keep it up.. solution erp

Anif Wahyudiyanto said...

Essential blog post! I truly enjoyed reading it, as well as most of the posts on here. That is a truly good blog, thanks for taking the time to put it together. Thank you! industri dan gudang, News - Portal Update Released, Cipto Junaedy

Marsya Della said...

You got a really useful blog I have been here reading for about an hour. I am a newbie and your success is very much an inspiration for me. Obat Diabetes | Obat Asam Urat | Jelly Gamat Gold-G | Obat Maag Kronis | Obat Sinusitis | Obat Batu Ginjal

Dexter Owen said...

Great post! and incredible blog ! Very helpful post! I must say. Simple & interesting. Wonderful work!

Branded Logo Designs

Ali Munandar said...

Have you ever considered about adding a little bit more than just your articles?
kata kata motivasi - lagu terbaru - Harga HP Smartfren - gemscool - puisi cinta - lagu barat terbaru - kata kata mutiara

Fikar Chan said...

Hai I AM Just Blogwalking...
visit my blog to Brother Network Marketing dan Talk Fusion

Siddu Hosageri said...

This is a informative blog. Really liked it.


Hotel Equipments Bakery Oven

Siddu Hosageri said...

This is a informative blog. Really liked it.


Hotel Equipments Bakery Oven

Hostingnox soppnox said...

This is very useful blog.It helps a lot

ryditya putra said...

good article in this blog
visit
mercubuana
thank you before for sharing article in here;)

Wiwid Praye said...

This is very nice article and I love it if you don't mind visit my blog to at Berisikan Informasi tentang Tips Trik, kontes seo, info kontes seo, blog review, dan informasi online lainnya yang paling penting, panas, perlu dan seruu tentang cara cerdas bikin website dengan jasa hosting anekahosting.com web hosting murah terbaik di Indonesia untuk optimasi search engine google untuk artikel review iconia pc tablet dengan windows 8 dan Ultrabook Terbaru Samsung Series 7 Ultra serta beberapa agen bola dan casino online seperti Agen bola ligabet88 promo bonus 100% ibcbet sbobet 368bet dan situs casino online Fbi-bet.com taruhan bola casino sbobet online bonus 100% all produk serta BOLA368.com Agen Judi Bola Terpercaya Promo 10% all Games Sportbook

yogesh kumawat said...

The concept is interesting. Much of the logic between these four is shared. And the theory behind initial development was, apparently, that if they were so similar, they could simply all be covered by one set of functions. essays

Nick said...

Thanks i like your blog very much , i come back most days to find new posts like this. paid essay service