Doubts on how to write module for online exam

Topics: Writing modules
May 10, 2011 at 11:44 AM

Hi All,

I'm trying to write an online examination module which is capable to show exams by category and when user clicks on a specific exam they are redirected to the exam where questions are displayed one by one.

I'm confused what would be the contentParts (may be category, questions etc ) and what would be contentIetm and how I'm going to deal with these things, can anybody give details regarding the same?

I'm assuming following right now:

  • I need to create a contentItem called Exam
  • I have to add parts like Questions, Category to it

Also I want to show navigation by category and show title, meta description and keywords for the currently selected category.

Really appreciate any guidance regarding this


May 10, 2011 at 5:24 PM

For the categories, I would just use the Taxonomies module. Exams and questions should probably be content items. The list of questions can be a part that is essentially a list of question content items. You can find some guidance on how to implement that sort of 1-n relations here:

Or, if your exams are nothing but collections of questions you could just make exams Lists that are restricted to the Question content type and just create the questions in the exam lists. Keep in mind that in that case a question belongs to only one exam. If the built-in list feature seems too restricted for your scenario, you might want to still implement on the idea of container but develop your own List-like type.

Does this help?

May 11, 2011 at 4:57 PM

Hi prashant,

I've just released a many-to-many relationships system on the Gallery ( ) - this allows scenarios that go beyond the built-in lists feature.

It requires creating additional content types to represent the connectors between items. So as well as "Category", "Exam", "Question" content types, you also need "ExamInCategory" and "QuestionInExam". You can use the supplied SequencePart to specify the ordering of items.