Note: You are currently viewing documentation for Moodle 2.0. Up-to-date documentation for the latest stable version is available here: Short Answer question type.

Development:Short Answer question type: Difference between revisions

From MoodleDocs
No edit summary
 
m (cat edit)
 
(3 intermediate revisions by 2 users not shown)
Line 2: Line 2:


==Database tables==
==Database tables==
The quiz_shortanswer table is an extension of the quiz_questions table.
;id
:int(10) unsigned NOT NULL auto_increment,
:Primary key
;question
:int(10) unsigned NOT NULL default '0',
:Foreign key to the id field of the quiz_questions table
;answers
:varchar(255) NOT NULL default '',
:A comma separated list of answer ids. This is redundant
;usecase
:tinyint(2) NOT NULL default '0',
:used to decide whether to do a case sensitive or case insensitive comparison for grading.


==Response storage==
==Response storage==
The shortanswer questiontype is the ideal example of the default case. It does not overwrite any of the default implementations of the three methods mentioned above, because it uses the default $state->responses array indexed with the empty string. The value entered into the shortanswer input field is entered directly into the answer field.


==Question->options==
==Question->options==
Line 9: Line 24:
==State->options==
==State->options==


[[Category:Developer]]
[[Category:Developer|Short Answer question type]]
[[Category:Quiz]]
[[Category:Quiz]]

Latest revision as of 10:02, 18 June 2007

Template:Questiontype developer docs

Database tables

The quiz_shortanswer table is an extension of the quiz_questions table.

id
int(10) unsigned NOT NULL auto_increment,
Primary key
question
int(10) unsigned NOT NULL default '0',
Foreign key to the id field of the quiz_questions table
answers
varchar(255) NOT NULL default ,
A comma separated list of answer ids. This is redundant
usecase
tinyint(2) NOT NULL default '0',
used to decide whether to do a case sensitive or case insensitive comparison for grading.

Response storage

The shortanswer questiontype is the ideal example of the default case. It does not overwrite any of the default implementations of the three methods mentioned above, because it uses the default $state->responses array indexed with the empty string. The value entered into the shortanswer input field is entered directly into the answer field.

Question->options

State->options