mirror of
https://github.com/moodle/moodle.git
synced 2025-01-22 08:11:26 +01:00
efabdeddef
well as numerical grades
31 lines
1018 B
PHP
31 lines
1018 B
PHP
<?PHP // $Id$
|
|
|
|
function journal_upgrade($oldversion) {
|
|
// This function does anything necessary to upgrade
|
|
// older versions to match current functionality
|
|
|
|
global $CFG;
|
|
|
|
$result = true;
|
|
|
|
if ($oldversion < 2003081705) {
|
|
$defaultscale = NULL;
|
|
$defaultscale->courseid = 0;
|
|
$defaultscale->userid = 0;
|
|
$defaultscale->timemodified = time();
|
|
$defaultscale->name = get_string("journalrating2", "journal");
|
|
$defaultscale->scale = get_string("journalrating1", "journal").",".
|
|
get_string("journalrating2", "journal").",".
|
|
get_string("journalrating3", "journal");
|
|
|
|
if ($defaultscale->id = insert_record("scale", $defaultscale)) {
|
|
execute_sql("UPDATE {$CFG->prefix}journal SET assessed = '-$defaultscale->id'", false);
|
|
} else {
|
|
notify("An error occurred while inserting the default journal scale");
|
|
$result = false;
|
|
}
|
|
}
|
|
|
|
return $result;
|
|
}
|