]> git.mjollnir.org Git - moodle.git/commitdiff
quiz-report-overview MDL-20260 Fixed misnamed upgrade function and bumped version...
authorsamhemelryk <samhemelryk>
Mon, 14 Sep 2009 04:19:28 +0000 (04:19 +0000)
committersamhemelryk <samhemelryk>
Mon, 14 Sep 2009 04:19:28 +0000 (04:19 +0000)
mod/quiz/report/overview/db/upgrade.php
mod/quiz/report/overview/version.php

index d7d793cecd42c7b68d65655e85e6a5b75f945d6a..6c6ccaf4c3dcd999899b63d3f145c599d6e72115 100644 (file)
@@ -1,6 +1,6 @@
 <?php  // $Id$
 
-function xmldb_quizreport_overview_upgrade($oldversion) {
+function xmldb_quiz_overview_upgrade($oldversion) {
     global $CFG, $DB;
 
     $dbman = $DB->get_manager();
@@ -8,7 +8,7 @@ function xmldb_quizreport_overview_upgrade($oldversion) {
 
 //===== 1.9.0 upgrade line ======//
 
-    if ($result && $oldversion < 2008062700) {
+    if ($result && $oldversion < 2009091400) {
 
     /// Define table quiz_question_regrade to be created
         $table = new xmldb_table('quiz_question_regrade');
@@ -17,8 +17,8 @@ function xmldb_quizreport_overview_upgrade($oldversion) {
         $table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
         $table->add_field('questionid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null);
         $table->add_field('attemptid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null);
-        $table->add_field('newgrade', XMLDB_TYPE_NUMBER, '10, 5', null, XMLDB_NOTNULL, null, null);
-        $table->add_field('oldgrade', XMLDB_TYPE_NUMBER, '10, 5', null, XMLDB_NOTNULL, null, null);
+        $table->add_field('newgrade', XMLDB_TYPE_NUMBER, '12, 7', null, XMLDB_NOTNULL, null, null);
+        $table->add_field('oldgrade', XMLDB_TYPE_NUMBER, '12, 7', null, XMLDB_NOTNULL, null, null);
         $table->add_field('regraded', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null);
         $table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null);
 
@@ -31,26 +31,7 @@ function xmldb_quizreport_overview_upgrade($oldversion) {
         }
 
     /// overview savepoint reached
-        upgrade_plugin_savepoint($result, 2008062700, 'quizreport', 'overview');
-    }
-
-    if ($result && $oldversion < 2009030500) {
-    /// Changing precision of field newgrade on table quiz_question_regrade to (12, 7).
-        $table = new xmldb_table('quiz_question_regrade');
-        $field = new xmldb_field('newgrade', XMLDB_TYPE_NUMBER, '12, 7', null, XMLDB_NOTNULL, null, null, 'attemptid');
-
-    /// Launch change of precision for field newgrade
-        $dbman->change_field_precision($table, $field);
-
-    /// Changing precision of field oldgrade on table quiz_question_regrade to (12, 7).
-        $table = new xmldb_table('quiz_question_regrade');
-        $field = new xmldb_field('oldgrade', XMLDB_TYPE_NUMBER, '12, 7', null, XMLDB_NOTNULL, null, null, 'newgrade');
-
-    /// Launch change of precision for field newgrade
-        $dbman->change_field_precision($table, $field);
-
-    /// overview savepoint reached
-        upgrade_plugin_savepoint($result, 2009030500, 'quizreport', 'overview');
+        upgrade_plugin_savepoint($result, 2009091400, 'quizreport', 'overview');
     }
 
     return $result;
index e17349bd3a4b0c029689e40f6926cd16b4e2d690..837fbf593ab9e7493d25cc966719e70c1c0a9883 100644 (file)
@@ -5,6 +5,6 @@
 //  This fragment is called by moodle_needs_upgrading() and /admin/index.php
 ////////////////////////////////////////////////////////////////////////////////
 
-$plugin->version  = 2009030500;   // The (date) version of this module
+$plugin->version  = 2009091400;   // The (date) version of this module
 
 ?>