3 // This file keeps track of upgrades to
4 // the numerical qtype plugin
6 // Sometimes, changes between versions involve
7 // alterations to database structures and other
8 // major things that may break installations.
10 // The upgrade function in this file will attempt
11 // to perform all the necessary actions to upgrade
12 // your older installtion to the current version.
14 // If there's something it cannot do itself, it
15 // will tell you what you need to do.
17 // The commands in here will all be database-neutral,
18 // using the functions defined in lib/ddllib.php
20 function xmldb_qtype_numerical_upgrade($oldversion=0) {
22 global $CFG, $THEME, $db;
26 // In numerical questions, we are changing the 'match anything' answer
27 // from the empty string to *, to be like short answer questions.
28 if ($result && $oldversion < 2006121500) {
29 $result = set_field_select('question_answers', 'answer', '*',
30 sql_compare_text('answer') . " = '" . sql_empty() . "' AND question IN (SELECT id FROM {$CFG->prefix}question WHERE qtype = '" . NUMERICAL
. "')");