MDL-20636 Prepare stuff for cleaner merging

This commit is contained in:
Eloy Lafuente (stronk7)
2011-06-06 16:38:23 +01:00
committed by Tim Hunt
parent b360806d5c
commit 4561302dec
3 changed files with 56 additions and 2 deletions
+52
View File
@@ -6062,6 +6062,57 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
upgrade_main_savepoint(true, 2011022100.01);
}
if ($oldversion < 2011052300.00) {
$table = new xmldb_table('rating');
// Add the component field to the ratings table
upgrade_set_timeout(60 * 20);
$field = new xmldb_field('component', XMLDB_TYPE_CHAR, '100', null, XMLDB_NOTNULL, null, 'unknown', 'contextid');
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
// Add the ratingarea field to the ratings table
upgrade_set_timeout(60 * 20);
$field = new xmldb_field('ratingarea', XMLDB_TYPE_CHAR, '50', null, XMLDB_NOTNULL, null, 'unknown', 'component');
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
upgrade_main_savepoint(true, 2011052300.00);
}
if ($oldversion < 2011052300.01) {
// Define index uniqueuserrating (unique) to be added to rating
$table = new xmldb_table('rating');
$index = new xmldb_index('uniqueuserrating', XMLDB_INDEX_NOTUNIQUE, array('component', 'ratingarea', 'contextid', 'itemid'));
// Conditionally launch add index uniqueuserrating
if (!$dbman->index_exists($table, $index)) {
$dbman->add_index($table, $index);
}
// Main savepoint reached
upgrade_main_savepoint(true, 2011052300.01);
}
if ($oldversion < 2011052300.02) {
// Define index itemid (not unique) to be dropped form rating
$table = new xmldb_table('rating');
$index = new xmldb_index('itemid', XMLDB_INDEX_NOTUNIQUE, array('itemid'));
// Conditionally launch drop index itemid
if ($dbman->index_exists($table, $index)) {
$dbman->drop_index($table, $index);
}
// Main savepoint reached
upgrade_main_savepoint(true, 2011052300.02);
}
// Question engine 2 changes (14) start here
if ($oldversion < 2011051200) {
// Changing the default of field penalty on table question to 0.3333333
$table = new xmldb_table('question');
@@ -6428,6 +6479,7 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
// Main savepoint reached
upgrade_main_savepoint(true, 2011051213);
}
// Question engine 2 changes (14) end here
return true;
}
+2
View File
@@ -673,6 +673,8 @@ function quiz_grade_item_delete($quiz) {
/**
* Returns an array of users who have data in a given quiz
*
* @todo: deprecated - to be deleted in 2.2
*
* @param int $quizid the quiz id.
* @return array of userids.
*/
+2 -2
View File
@@ -30,10 +30,10 @@
defined('MOODLE_INTERNAL') || die();
$version = 2011051213.00; // YYYYMMDD = weekly release date of this DEV branch
$version = 2011060200.00; // YYYYMMDD = weekly release date of this DEV branch
// RR = release increments - 00 in DEV branches
// .XX = incremental changes
$release = '2.1dev (Build: 20110511)'; // Human-friendly version name
$release = '2.1dev (Build: 20110602)'; // Human-friendly version name
$maturity = MATURITY_ALPHA; // this version's maturity level