NOBUG: Fixed file access permissions
[moodle.git] / question / type / ddmarker / db / upgrade.php
CommitLineData
e1f5f601
JP
1<?php
2// This file is part of Moodle - http://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16
17/**
f8bb5fdc 18 * Ddmarker question type upgrade code.
e1f5f601
JP
19 *
20 * @package qtype_ddmarker
21 * @copyright 2013 The Open University
e1f5f601
JP
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 */
24
e1f5f601
JP
25defined('MOODLE_INTERNAL') || die();
26
27
28/**
29 * Upgrade code for the ddmarker question type.
30 * @param int $oldversion the version we are upgrading from.
31 * @return bool
32 */
33function xmldb_qtype_ddmarker_upgrade($oldversion) {
34 global $CFG, $DB;
35
36 $dbman = $DB->get_manager();
37
38 // Moodle v2.3.0 release upgrade line
39 // Put any upgrade step following this.
40
41 // Moodle v2.4.0 release upgrade line
42 // Put any upgrade step following this.
43
44 // Moodle v2.5.0 release upgrade line
45 // Put any upgrade step following this.
46
47 if ($oldversion < 2013053000) {
48
49 // Define field noofdrags to be added to qtype_ddmarker_drags.
50 $table = new xmldb_table('qtype_ddmarker_drags');
51 $field = new xmldb_field('noofdrags', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '1', 'infinite');
52
53 // Conditionally launch add field noofdrags.
54 if (!$dbman->field_exists($table, $field)) {
55 $dbman->add_field($table, $field);
56 }
57
58 // Savepoint reached.
59 upgrade_plugin_savepoint(true, 2013053000, 'qtype', 'ddmarker');
60 }
61 return true;
62}