From: David Mudrak Date: Thu, 7 Jan 2010 20:57:30 +0000 (+0000) Subject: MDL-19937 workshop: fixed function names in form/accumulative migration code X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b3700278324e66b0fc0e00b447a012ad129e1a04;p=moodle.git MDL-19937 workshop: fixed function names in form/accumulative migration code --- diff --git a/mod/workshop/form/accumulative/db/install.php b/mod/workshop/form/accumulative/db/install.php index 259c399705..78ae8df63f 100644 --- a/mod/workshop/form/accumulative/db/install.php +++ b/mod/workshop/form/accumulative/db/install.php @@ -32,7 +32,7 @@ function xmldb_workshopform_accumulative_install() { require_once(dirname(__FILE__) . '/upgradelib.php'); // upgrade from old workshop 1.x if needed - workshopform_allocation_upgrade_legacy(); + workshopform_accumulative_upgrade_legacy(); } /** @@ -43,5 +43,5 @@ function xmldb_workshopform_accumulative_install_recovery() { require_once(dirname(__FILE__) . '/upgradelib.php'); // continue upgrading from old workshop 1.x if needed - workshopform_allocation_upgrade_legacy(); + workshopform_accumulative_upgrade_legacy(); } diff --git a/mod/workshop/form/accumulative/db/upgradelib.php b/mod/workshop/form/accumulative/db/upgradelib.php index ce9d34847c..ed5f7ff36d 100644 --- a/mod/workshop/form/accumulative/db/upgradelib.php +++ b/mod/workshop/form/accumulative/db/upgradelib.php @@ -29,11 +29,11 @@ * This must be called after workshop core migration has finished so that * all assessments are already upgraded and tables are correctly renamed. */ -function workshopform_allocation_upgrade_legacy() { +function workshopform_accumulative_upgrade_legacy() { global $CFG, $DB, $OUTPUT; require_once($CFG->dirroot . '/mod/workshop/db/upgradelib.php'); - if (!workshopform_allocation_upgrade_legacy_needed()) { + if (!workshopform_accumulative_upgrade_legacy_needed()) { return; } @@ -51,9 +51,9 @@ function workshopform_allocation_upgrade_legacy() { $newworkshopids = workshop_upgrade_workshop_id_mappings(); $newelementids = array(); // (int)workshopid => array of (int)elementno => (int)newelementid // prepare system (global) scales to replace the legacy in-built ones - $newscaleids = workshopform_allocation_upgrade_scales(); + $newscaleids = workshopform_accumulative_upgrade_scales(); foreach ($rs as $old) { - $new = workshopform_allocation_upgrade_element($old, $newscaleids, $newworkshopids[$old->workshopid]); + $new = workshopform_accumulative_upgrade_element($old, $newscaleids, $newworkshopids[$old->workshopid]); $newid = $DB->insert_record('workshopform_accumulative', $new); if (!isset($newelementids[$old->workshopid])) { $newelementids[$old->workshopid] = array(); @@ -80,7 +80,7 @@ function workshopform_allocation_upgrade_legacy() { // orphaned grade - the assessment form element has been removed after the grade was recorded continue; } - $new = workshopform_allocation_upgrade_grade($old, $newassessmentids[$old->assessmentid], + $new = workshopform_accumulative_upgrade_grade($old, $newassessmentids[$old->assessmentid], $newelementids[$old->workshopid][$old->elementno]); $newid = $DB->insert_record('workshop_grades', $new); $DB->set_field('workshop_grades_old', 'newplugin', 'accumulative', array('id' => $old->id)); @@ -98,7 +98,7 @@ function workshopform_allocation_upgrade_legacy() { * @param int $newworkshopid id of the new workshop instance that replaced the previous one * @return stdclass to be saved in workshopform_accumulative */ -function workshopform_allocation_upgrade_element(stdclass $old, array $newscaleids, $newworkshopid) { +function workshopform_accumulative_upgrade_element(stdclass $old, array $newscaleids, $newworkshopid) { $new = new stdclass(); $new->workshopid = $newworkshopid; $new->sort = $old->elementno; @@ -141,7 +141,7 @@ function workshopform_allocation_upgrade_element(stdclass $old, array $newscalei * @param stdclass $newdimensioninfo * @return stdclass */ -function workshopform_allocation_upgrade_grade(stdclass $old, $newassessmentid, stdclass $newdimensioninfo) { +function workshopform_accumulative_upgrade_grade(stdclass $old, $newassessmentid, stdclass $newdimensioninfo) { $new = new stdclass(); $new->assessmentid = $newassessmentid; $new->strategy = 'accumulative'; @@ -163,7 +163,7 @@ function workshopform_allocation_upgrade_grade(stdclass $old, $newassessmentid, * * @return bool */ -function workshopform_allocation_upgrade_legacy_needed() { +function workshopform_accumulative_upgrade_legacy_needed() { global $CFG, $DB; $dbman = $DB->get_manager(); @@ -190,7 +190,7 @@ function workshopform_allocation_upgrade_legacy_needed() { * * @return array (int)oldscale => (int)newscaleid */ -function workshopform_allocation_upgrade_scales() { +function workshopform_accumulative_upgrade_scales() { global $DB, $CFG, $USER; require_once($CFG->libdir . '/gradelib.php');