get_manager(); /// And upgrade begins here. For each one, you'll need one /// block of code similar to the next one. Please, delete /// this comment lines once this file start handling proper /// upgrade code. // Add the field to store the string which is placed in front of the answer // box when the question is displayed if ($oldversion < 2008061500) { $table = new xmldb_table('question_algebra'); $field = new xmldb_field('answerprefix', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, '', 'allowedfuncs'); if (!$dbman->field_exists($table, $field)) { $dbman->add_field($table, $field); } upgrade_plugin_savepoint(true, 2008061500, 'qtype', 'algebra'); } // Drop the answers and variables fields wich are totaly redundants if ($oldversion < 2011072800) { $table = new xmldb_table('question_algebra'); $field = new xmldb_field('answers'); if ($dbman->field_exists($table, $field)) { $dbman->drop_field($table, $field); } $field = new xmldb_field('variables'); if ($dbman->field_exists($table, $field)) { $dbman->drop_field($table, $field); } upgrade_plugin_savepoint(true, 2011072800, 'qtype', 'algebra'); } return true; }