]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19937 workshop: fixed function names in form/accumulative migration code
authorDavid Mudrak <david.mudrak@gmail.com>
Thu, 7 Jan 2010 20:57:30 +0000 (20:57 +0000)
committerDavid Mudrak <david.mudrak@gmail.com>
Thu, 7 Jan 2010 20:57:30 +0000 (20:57 +0000)
mod/workshop/form/accumulative/db/install.php
mod/workshop/form/accumulative/db/upgradelib.php

index 259c3997058aceab268606f6c4efd4b74fe0c592..78ae8df63f7f502a1a52c80818f5c31f018b4bba 100644 (file)
@@ -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();
 }
index ce9d34847c50db1b3c868fe0ac89bc064d81b55c..ed5f7ff36dd1d99557dd64853686a89bc1cce2a2 100644 (file)
  * 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');