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/

eZ debug

Timing: Jan 18 2025 18:14:54
Script start
Timing: Jan 18 2025 18:14:54
Module start 'content'
Timing: Jan 18 2025 18:14:54
Module end 'content'
Timing: Jan 18 2025 18:14:54
Script end

Main resources:

Total runtime0.1625 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 587.8438180.8125
Module start 'content' 0.00500.0054 768.656397.9297
Module end 'content' 0.01030.1520 866.5859533.3750
Script end 0.1624  1,399.9609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00321.9751200.0002
Check MTime0.00140.8425200.0001
Mysql Total
Database connection0.00070.420410.0007
Mysqli_queries0.116871.87161410.0008
Looping result0.00130.78441390.0000
Template Total0.151793.410.1517
Template load0.00070.417210.0007
Template processing0.151092.933310.1510
Override
Cache load0.00050.287910.0005
Sytem overhead
Fetch class attribute can translate value0.00070.455510.0007
XML
Image XML parsing0.00030.180410.0003
General
dbfile0.00553.3874200.0003
String conversion0.00000.003230.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs