Some needed scales recoding previous to ratings... :-)
authorstronk7 <stronk7>
Fri, 21 Nov 2003 22:51:56 +0000 (22:51 +0000)
committerstronk7 <stronk7>
Fri, 21 Nov 2003 22:51:56 +0000 (22:51 +0000)
mod/glossary/restorelib.php

index c30005cca8a8b0df113e846816de380607e6fdb8..09260270bb4c1c7cf926cdf4aab126e700ac1a5d 100644 (file)
             $glossary->assesstimefinish = backup_todb($info['MOD']['#']['ASSESSTIMEFINISH']['0']['#']);
             $glossary->scale = backup_todb($info['MOD']['#']['SCALE']['0']['#']);
 
+            //We have to recode the scale field if it's <0 (positive is a grade, not a scale)
+            if ($glossary->scale < 0) {
+                $scale = backup_getid($restore->backup_unique_code,"scale",abs($glossary->scale));
+                if ($scale) {
+                    $glossary->scale = -($scale->new_id);
+                }
+            }
+
             //The structure is equal to the db, so insert the glossary
             $newid = insert_record ("glossary",$glossary);