Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Dataset dependent: Difference between revisions

From MoodleDocs
m (Dataset dependent moved to Development:Dataset dependent)
Line 5: Line 5:
===quiz_dataset_definitions===  
===quiz_dataset_definitions===  
This table is an indirect extension to the quiz_questions table, because the quiz_question_datasets table can link a question to one or more datasets. Each dataset represents a variable, that is used either in the questiontext or in the answer to a dataset dependent question.
This table is an indirect extension to the quiz_questions table, because the quiz_question_datasets table can link a question to one or more datasets. Each dataset represents a variable, that is used either in the questiontext or in the answer to a dataset dependent question.


;id :int(10) unsigned NOT NULL auto_increment,
;id :int(10) unsigned NOT NULL auto_increment,
;category :int(10) unsigned NOT NULL default '0',
;category :int(10) unsigned NOT NULL default '0',  
when this is a shared dataset the value is the category id
when this is a private dataset the value is 0
;name :varchar(255) NOT NULL default '',
;name :varchar(255) NOT NULL default '',
;type :int(10) NOT NULL default '0',
;type :int(10) NOT NULL default '0',
;options :varchar(255) NOT NULL default '',
;options :varchar(255) NOT NULL default '',  
the options for this dataset separated by ':'(distribution:min:max:decimals)
;itemcount :int(10) unsigned NOT NULL default '0',
;itemcount :int(10) unsigned NOT NULL default '0',
the number of dataset items


===quiz_dataset_items===
===quiz_dataset_items===

Revision as of 01:04, 13 June 2007

Database tables

quiz_dataset_definitions

This table is an indirect extension to the quiz_questions table, because the quiz_question_datasets table can link a question to one or more datasets. Each dataset represents a variable, that is used either in the questiontext or in the answer to a dataset dependent question.


id
int(10) unsigned NOT NULL auto_increment,
category
int(10) unsigned NOT NULL default '0',
when this is a shared dataset the value is the category id 
when this is a private dataset the value is 0
name
varchar(255) NOT NULL default ,
type
int(10) NOT NULL default '0',
options
varchar(255) NOT NULL default ,
the options for this dataset separated by ':'(distribution:min:max:decimals)
itemcount
int(10) unsigned NOT NULL default '0',
the number of dataset items

quiz_dataset_items

Dataset items can be created for each dataset. The quiz_dataset_items table stores these possible values for the variables defined in the quiz_dataset_definitions table.

id
int(10) unsigned NOT NULL auto_increment,
definition
int(10) unsigned NOT NULL default '0',
number
int(10) unsigned NOT NULL default '0',
value
varchar(255) NOT NULL default ,

quiz_question_datasets

The quiz_question_datasets table is used by dataset dependent questionypes (i.e. calculated) to link datasets to questions.

id
int(10) unsigned NOT NULL auto_increment,
question
int(10) unsigned NOT NULL default '0',
datasetdefinition
int(10) unsigned NOT NULL default '0',

Response storage

Question->options

State->options