Development:Random Short-Answer Matching question type: Difference between revisions
From MoodleDocs
No edit summary |
Helen Foster (talk | contribs) m (cat edit) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
==Database tables== | ==Database tables== | ||
The '''quiz_randomsamatch''' 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 | |||
;choose | |||
:int(10) unsigned NOT NULL default '4', | |||
:The number of shortanswer questions should be randomly chosen to build this randomsamatch question. | |||
;shuffleanswers :tinyint(4) NOT NULL default '1', | |||
:a flag that determines whether the answers should be shuffled, provided the quiz settings allows this. | |||
==Response storage== | ==Response storage== | ||
The random shortanswer matching questiontype reuses the save_session_and_responses method of the matching questiontype and therefore stores its responses in the same format. The difference is that the first id in the pair is the question id (quiz_questions) of the selected shortanswer and the second id is the id of the first correct answer that is found ofr that shortanswer question in the quiz_answers table. | |||
==Question->options== | ==Question->options== | ||
Line 9: | Line 24: | ||
==State->options== | ==State->options== | ||
[[Category:Developer]] | [[Category:Developer|Random Short-Answer Matching question type]] | ||
[[Category:Quiz]] | [[Category:Quiz]] |
Latest revision as of 09:25, 18 June 2007
Template:Questiontype developer docs
Database tables
The quiz_randomsamatch 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
- choose
- int(10) unsigned NOT NULL default '4',
- The number of shortanswer questions should be randomly chosen to build this randomsamatch question.
- shuffleanswers
- tinyint(4) NOT NULL default '1',
- a flag that determines whether the answers should be shuffled, provided the quiz settings allows this.
Response storage
The random shortanswer matching questiontype reuses the save_session_and_responses method of the matching questiontype and therefore stores its responses in the same format. The difference is that the first id in the pair is the question id (quiz_questions) of the selected shortanswer and the second id is the id of the first correct answer that is found ofr that shortanswer question in the quiz_answers table.