Skip to content

Commit

Permalink
MDL-20636 Prepare stuff for cleaner merging
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 authored and timhunt committed Jun 6, 2011
1 parent b360806 commit 4561302
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 2 deletions.
52 changes: 52 additions & 0 deletions lib/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6062,6 +6062,57 @@ function xmldb_main_upgrade($oldversion) {
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');
Expand Down Expand Up @@ -6428,6 +6479,7 @@ function xmldb_main_upgrade($oldversion) {
// Main savepoint reached
upgrade_main_savepoint(true, 2011051213);
}
// Question engine 2 changes (14) end here

return true;
}
Expand Down
2 changes: 2 additions & 0 deletions mod/quiz/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4561302

Please sign in to comment.