From af847821a24db83ade011a0ab739840f80df8556 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Mon, 18 Aug 2003 00:02:12 +0000 Subject: [PATCH] Scales are now supported in assignments restore (when grade <0, I suppose). --- mod/assignment/restorelib.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mod/assignment/restorelib.php b/mod/assignment/restorelib.php index 55ce60e65b..922bb60392 100644 --- a/mod/assignment/restorelib.php +++ b/mod/assignment/restorelib.php @@ -50,6 +50,14 @@ $assignment->grade = backup_todb($info['MOD']['#']['GRADE']['0']['#']); $assignment->timemodified = backup_todb($info['MOD']['#']['TIMEMODIFIED']['0']['#']); + //We have to recode the grade field if it is <0 (scale) + if ($assignment->grade < 0) { + $scale = backup_getid($restore->backup_unique_code,"scale",abs($assignment->grade)); + if ($scale) { + $assignment->grade = -($scale->new_id); + } + } + //The structure is equal to the db, so insert the assignment $newid = insert_record ("assignment",$assignment); -- 2.39.5