]> git.mjollnir.org Git - moodle.git/commitdiff
hmm wierd bug on production server but not testing ... this is to test that
authormartin <martin>
Mon, 29 Jul 2002 10:12:20 +0000 (10:12 +0000)
committermartin <martin>
Mon, 29 Jul 2002 10:12:20 +0000 (10:12 +0000)
mod/journal/report.php

index 9ff7db66d21593da3b7f6a2eae431ec2884b9cbc..17fe1cfc61058d8db4ae40737d7e23aec8929492 100644 (file)
             $entry = $entrybyentry[$num];
             // Only update entries where feedback has actually changed.
             if (($vals[r] <> $entry->rating) || ($vals[c] <> addslashes($entry->comment))) {
+                $newentry->rating = $vals[r];
+                $newentry->comment = $vals[c];
+                $newentry->teacher = $USER->id;
+                $newentry->timemarked = $timenow;
+                $newentry->id = $num;
+                if (! update_record("journal_entries", $newentry)) {
+                    notify("Failed to update the journal feedback for user $entry->user");
+                    print_object($newentry);
+                } else {
+                    $count++;
+                }
                 $entrybyuser[$entry->user]->rating = $vals[r];
                 $entrybyuser[$entry->user]->comment = $vals[c];
                 $entrybyuser[$entry->user]->teacher = $USER->id;
                 $entrybyuser[$entry->user]->timemarked = $timenow;
-                $entrybyuser[$entry->user]->id = $num;
-                if (! update_record("journal_entries", $entrybyuser[$entry->user])) {
-                    error("Failed to update the journal feedback!");
-                } else {
-                    $count++;
-                }
             }
         }
         add_to_log($course->id, "journal", "update feedback", "report.php?id=$cm->id", "$count users");