MDL-27408 fix question engine upgrade issues on MySQL.

This commit is contained in:
Tim Hunt 2011-05-12 23:17:58 +01:00
parent 39759ac468
commit ab6cb45b7b
2 changed files with 3 additions and 21 deletions

View File

@ -6063,12 +6063,11 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
}
if ($oldversion < 2011051200) {
// Changing the default of field penalty on table question to 0.3333333
$table = new xmldb_table('question');
$field = new xmldb_field('penalty');
$field->set_attributes(XMLDB_TYPE_FLOAT, null, null,
XMLDB_NOTNULL, null, '0.3333333', 'defaultgrade');
XMLDB_NOTNULL, null, '0.3333333');
// Launch change of default for field penalty
$dbman->change_field_default($table, $field);
@ -6083,7 +6082,7 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
$table = new xmldb_table('question');
$field = new xmldb_field('defaultgrade');
$field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED,
XMLDB_NOTNULL, null, '1', 'generalfeedback');
XMLDB_NOTNULL, null, '1');
// Launch rename field defaultmark
if ($dbman->field_exists($table, $field)) {

View File

@ -548,7 +548,7 @@ function xmldb_quiz_upgrade($oldversion) {
$transaction = $DB->start_delegated_transaction();
$oldattempts = $DB->get_records_sql('
SELECT quiza
SELECT *
FROM {quiz_attempts} quiza
WHERE uniqueid IN (
SELECT DISTINCT qst.attempt
@ -678,23 +678,6 @@ function xmldb_quiz_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2011051205, 'quiz');
}
if ($oldversion < 2011051206) {
// Changing the default of field penalty on table question to 0.3333333
$table = new xmldb_table('question');
$field = new xmldb_field('penalty');
$field->set_attributes(XMLDB_TYPE_FLOAT, null, null,
XMLDB_NOTNULL, null, '0.3333333', 'defaultgrade');
// Launch change of default for field penalty
$dbman->change_field_default($table, $field);
// quiz savepoint reached
upgrade_mod_savepoint(true, 2011051206, 'quiz');
}
// Update the quiz from the old single review column to seven new columns.
if ($oldversion < 2011051207) {
// Define field reviewattempt to be added to quiz