Development:Numerical question type: Difference between revisions
From MoodleDocs
Line 2: | Line 2: | ||
==Database tables== | ==Database tables== | ||
===quiz_numerical=== | |||
The quiz_numerical table is an extension of the quiz_answers table, defining a tolerance value for each answer. | |||
;id :int(10) unsigned NOT NULL auto_increment, | |||
;question :int(10) unsigned NOT NULL default '0', | |||
;answer :int(10) unsigned NOT NULL default '0', | |||
;tolerance :varchar(255) NOT NULL default '0.0', | |||
===quiz_numerical_units=== | |||
The quiz_numerical_units table is used by the numerical questiontype and the calculated questionype. It extends the quiz_questions table, defining an arbitrary number of units that can be used in the responses. | |||
;id :int(10) unsigned NOT NULL auto_increment, | |||
;question :int(10) unsigned NOT NULL default '0', | |||
;multiplier :decimal(40,20) NOT NULL default '1.00000000000000000000', | |||
;unit :varchar(50) NOT NULL default '', | |||
==Response storage== | ==Response storage== |
Revision as of 23:59, 6 February 2006
Template:Questiontype developer docs
Database tables
quiz_numerical
The quiz_numerical table is an extension of the quiz_answers table, defining a tolerance value for each answer.
- id
- int(10) unsigned NOT NULL auto_increment,
- question
- int(10) unsigned NOT NULL default '0',
- answer
- int(10) unsigned NOT NULL default '0',
- tolerance
- varchar(255) NOT NULL default '0.0',
quiz_numerical_units
The quiz_numerical_units table is used by the numerical questiontype and the calculated questionype. It extends the quiz_questions table, defining an arbitrary number of units that can be used in the responses.
- id
- int(10) unsigned NOT NULL auto_increment,
- question
- int(10) unsigned NOT NULL default '0',
- multiplier
- decimal(40,20) NOT NULL default '1.00000000000000000000',
- unit
- varchar(50) NOT NULL default ,
Response storage
The numerical questiontype, which inherits the function print_question_formulation_and_controls() from the shortanswer questiontype, has only one response field, so its responses are handled by the default questiontype. The response is stored without any modifications in the answer field of the table quiz_states.