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 (fix headlines)
 
(3 intermediate revisions by one other user not shown)
Line 3: Line 3:
==Database tables==
==Database tables==


===question_dataset_definitions=== Organises and stores properties for dataset items
===question_dataset_definitions===  
 
Organises and stores properties for dataset items


This table is an indirect extension to the question table, because the 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 question table, because the 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.
Line 15: Line 17:
;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',
this can be 1=LITERAL 2=FILE 3=LINK
;options :varchar(255) NOT NULL default '',  
;options :varchar(255) NOT NULL default '',  
  the options for this dataset separated by ':'(distribution:min:max:decimals)
  the options for this dataset separated by ':'(distribution:min:max:decimals)
Line 20: Line 23:
  the number of dataset items
  the number of dataset items


===question_dataset_items=== Individual dataset items
===question_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 dataset_definitions table.
Individual dataset items
 
Dataset items can be created for each dataset. The dataset_items table stores these possible values for the variables defined in the dataset_definitions table.


;id :int(10) unsigned NOT NULL auto_increment,
;id :int(10) unsigned NOT NULL auto_increment,
Line 30: Line 35:
;value :varchar(255) NOT NULL default '',
;value :varchar(255) NOT NULL default '',


===question_datasets=== Many-many relation between questions and dataset definitions
===question_datasets===  
 
Many-many relation between questions and dataset definitions


The question_datasets table is used by dataset dependent question types (i.e. calculated) to link datasets to questions.
The question_datasets table is used by dataset dependent question types (i.e. calculated) to link datasets to questions.
Line 38: Line 45:
  id from the question table
  id from the question table
;datasetdefinition :int(10) unsigned NOT NULL default '0',
;datasetdefinition :int(10) unsigned NOT NULL default '0',
  id form the question_dataset_definitions
  id from the question_dataset_definitions table


==Response storage==
==Response storage==

Latest revision as of 14:20, 27 December 2009

Database tables

question_dataset_definitions

Organises and stores properties for dataset items

This table is an indirect extension to the question table, because the 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',
this can be 1=LITERAL 2=FILE 3=LINK
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

question_dataset_items

Individual dataset items

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

id
int(10) unsigned NOT NULL auto_increment,
definition
int(10) unsigned NOT NULL default '0',
id corresponding to the question_dataset_definitions table
number
int(10) unsigned NOT NULL default '0',
value
varchar(255) NOT NULL default ,

question_datasets

Many-many relation between questions and dataset definitions

The question_datasets table is used by dataset dependent question types (i.e. calculated) to link datasets to questions.

id
int(10) unsigned NOT NULL auto_increment,
question
int(10) unsigned NOT NULL default '0',
id from the question table
datasetdefinition
int(10) unsigned NOT NULL default '0',
id from the question_dataset_definitions table

Response storage

Question->options

State->options