From a741f7eea821cb530b45e79558f6cc787de29064 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Fri, 21 Nov 2003 22:51:56 +0000 Subject: [PATCH] Some needed scales recoding previous to ratings... :-) --- mod/glossary/restorelib.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mod/glossary/restorelib.php b/mod/glossary/restorelib.php index c30005cca8..09260270bb 100644 --- a/mod/glossary/restorelib.php +++ b/mod/glossary/restorelib.php @@ -68,6 +68,14 @@ $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); -- 2.39.5