function matching_schema in Quiz 8.4
Same name and namespace in other branches
- 6.6 question_types/matching/matching.install \matching_schema()
- 6.3 question_types/matching/matching.install \matching_schema()
- 6.4 question_types/matching/matching.install \matching_schema()
- 6.5 question_types/matching/matching.install \matching_schema()
- 7.6 question_types/matching/matching.install \matching_schema()
- 7 question_types/matching/matching.install \matching_schema()
- 7.4 question_types/matching/matching.install \matching_schema()
- 7.5 question_types/matching/matching.install \matching_schema()
Implements hook_schema().
File
- question_types/
matching/ matching.install, line 37 - matching install file.
Code
function matching_schema() {
// Properties for a question nodes go in here:
$schema['quiz_matching_node'] = array(
'fields' => array(
'match_id' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'nid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'vid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'question' => array(
'type' => 'text',
'not null' => TRUE,
),
'answer' => array(
'type' => 'text',
'not null' => TRUE,
),
'feedback' => array(
'type' => 'text',
'not null' => TRUE,
),
),
'primary key' => array(
'match_id',
),
'indexes' => array(
'question_id' => array(
'nid',
'vid',
),
),
);
// User answers go in here.
$schema['quiz_matching_user_answers'] = array(
'fields' => array(
'answer_id' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'match_id' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'result_id' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'score' => array(
'type' => 'int',
'size' => 'tiny',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'answer' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
),
'primary key' => array(
'answer_id',
),
);
return $schema;
}