Forums / Developer / Multiple Choice Questions: Class or Datatype?

Multiple Choice Questions: Class or Datatype?

Author Message

Eric Weik

Wednesday 31 March 2004 9:53:17 am

We are currently exploring the possibility of using eZpublish for a simple Learning Management System. The system would revolve around the concept of "assessments", where an assessment is a multi-page activity consisting of:
- meta data (keywords, etc.)
- formatted text (i.e. XMLText)
- an arbitrary number of images
- an arbitrary number of multiple-choice and true/false questions. Each question needs to also have an arbitrary number of answers. And each answer should have a discussion of why it was the correct (or incorrect) answer.

Example:

-----

[Meta category: movie]
[Meta subcategory: Monty Python]

[Image: photo from The Holy Grail]

This test will see how well you would have faired against The Old Man from Scene 24.

Question 1. What is your favorite color?
A. Blue
B. No, Yellow.
C. Aeeiiii!

-----

The correct answer is "A". If they select "A" they'll get the discussion: "(Correct) Oh, ok, off you go.". If they select "B", they'll get the discussion: "(Incorrect) You changed your mind! Have a nice flight...". Etc.

I've already created a working prototype in plain-jane PHP. But I've been trying to decide if/how to implement a complete solution in eZpublish (so content can be easily created/maintained by subject-matter experts).

So, my question is this: does anyone have an opinion on the best method to implement the multiple choice questions, pure classes or a mix of new datatypes and classes:

Pure Class Method:
Assessment - Class with property: activity_text (XMLText), and acts like a folder, holding Images and AssessmentQuestion.

AssessmentQuestion - Class with the property: question_text, and acts like a folder, holding AssessmentAnswer objects.

AssessmentAnswers - Class with properties: is_correct (True/False), id (i.e. "A", "B", "C", etc.), text (Text field -- "No, yellow"), discussion (Text field -- " You changed your mind! Have a nice flight...").

This method works, but it isn't terribly user friendly to create and maintain the questions and answers (selecting an AssessmentQuestion and having to select "AssessmentAnswer" click "Create Here" 5 times is sort of awkward for a non-technical user.

Mixed Method:

Create a new question datatype that looks similar to the "enum" type (i.e. when you add a question, it has a button to define multiple answers like the "New Enum Element" button).

This seems like the more friendly and flexible way to go, but I'm still learning my way around eZp, so I'm not sure its possible or optimal.

Any eZp gurus have an opinion on these (or better ways) to do this functionality?

Thank you,
Eric

Eirik Alfstad Johansen

Thursday 01 April 2004 5:38:21 am

Hi Eric,

<i>This method works, but it isn't terribly user friendly to create and
maintain the questions and answers (selecting an AssessmentQuestion and
having to select "AssessmentAnswer" click "Create Here" 5 times is sort of
awkward for a non-technical user.</i>

Have you thought about creating an override of the object/edit template in the admin interface to make it easier to add new alternatives when creating/editing a question? Also, you might be able to use the matrix datatype for this purpose.

Sincerely,

Eirik Johansen

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/