Browse files

Scales are now supported in assignments restore

(when grade <0, I suppose).
  • Loading branch information...
1 parent 42f1ff4 commit af847821a24db83ade011a0ab739840f80df8556 stronk7 committed Aug 18, 2003
Showing with 8 additions and 0 deletions.
  1. +8 −0 mod/assignment/restorelib.php
View
8 mod/assignment/restorelib.php
@@ -50,6 +50,14 @@ function assignment_restore_mods($mod,$restore) {
$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);

0 comments on commit af84782

Please sign in to comment.