Skip to content
Snippets Groups Projects
Commit e8cacc56 authored by Sivaji Ganesh Jojodae's avatar Sivaji Ganesh Jojodae
Browse files

Fix #485454 New column time_left not added to the schema definition in...

Fix #485454 New column time_left not added to the schema definition in quiz_schema. Adding a new hook_update_N() and $schema[] corresponding to db field.
parent 29745f3b
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,21 @@
*
*/
/**
* Implementation of hook_update_N().
* Adding a new field to save timer status for a timed quiz.
*/
function quiz_update_6307() {
$result = array();
if (!db_column_exists('quiz_node_results', 'time_left')) {
db_add_field($result, 'quiz_node_results', 'time_left', array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0));
}
if (!db_column_exists('quiz_node_properties', 'time_left')) {
db_add_field($result, 'quiz_node_properties', 'time_left', array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0));
}
return $result;
}
/**
* Implementation of hook_update_N().
* Adding a new field to save timer status for a timed quiz.
......@@ -355,6 +370,12 @@ function quiz_schema() {
'not null' => TRUE,
'default' => 0
),
'time_left' => array(
'type' => 'int',
'size' => 'small',
'not null' => TRUE,
'default' => 0
),
),
'primary key' => array('result_id'),
'indexes' => array(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment