Merge branch 'MDL-32113-master' of https://github.com/lucaboesch/moodle

This commit is contained in:
Damyon Wiese
2017-12-19 15:12:11 +08:00
3 changed files with 18 additions and 4 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="question/type/numerical/db" VERSION="20120122" COMMENT="XMLDB file for Moodle question/type/numerical"
<XMLDB PATH="question/type/numerical/db" VERSION="20171210" COMMENT="XMLDB file for Moodle question/type/numerical"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd"
>
@@ -37,7 +37,7 @@
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="question" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Foreign key references question.id"/>
<FIELD NAME="multiplier" TYPE="number" LENGTH="40" NOTNULL="true" DEFAULT="1.00000000000000000000" SEQUENCE="false" DECIMALS="20" COMMENT="The multiplier for this unit. For example, if the first unit is (1.0, 'cm'), another unit might be (0.1, 'mm') or (100.0, 'm')."/>
<FIELD NAME="multiplier" TYPE="number" LENGTH="38" NOTNULL="true" DEFAULT="1.00000000000000000000" SEQUENCE="false" DECIMALS="19" COMMENT="The multiplier for this unit. For example, if the first unit is (1.0, 'cm'), another unit might be (0.1, 'mm') or (100.0, 'm')."/>
<FIELD NAME="unit" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" COMMENT="The unit. For example 'm' or 'kg'."/>
</FIELDS>
<KEYS>
+15 -1
View File
@@ -30,7 +30,21 @@ defined('MOODLE_INTERNAL') || die();
* @param int $oldversion the version we are upgrading from.
*/
function xmldb_qtype_numerical_upgrade($oldversion) {
global $CFG;
global $CFG, $DB;
$dbman = $DB->get_manager();
if ($oldversion < 2017121000) {
// Changing length of field multiplier on table question_numerical_units to 38.
$table = new xmldb_table('question_numerical_units');
$field = new xmldb_field('multiplier', XMLDB_TYPE_NUMBER, '38, 19', null, XMLDB_NOTNULL, null, null, 'question');
// Launch change of length for field multiplier.
$dbman->change_field_type($table, $field);
// Data savepoint reached.
upgrade_plugin_savepoint(true, 2017121000, 'qtype', 'numerical');
}
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
+1 -1
View File
@@ -26,7 +26,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'qtype_numerical';
$plugin->version = 2017111300;
$plugin->version = 2017121000;
$plugin->requires = 2017110800;