Merge remote-tracking branch 'moodle/master' into MDL-20636_master_new_question_engine
authorTim Hunt <T.J.Hunt@open.ac.uk>
Mon, 6 Jun 2011 16:14:59 +0000 (17:14 +0100)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Mon, 6 Jun 2011 16:14:59 +0000 (17:14 +0100)
Conflicts:
lib/db/upgrade.php
mod/quiz/lib.php

1  2 
backup/moodle2/backup_stepslib.php
backup/moodle2/restore_stepslib.php
lib/db/install.xml
mod/quiz/lib.php

Simple merge
Simple merge
Simple merge
@@@ -364,9 -379,18 +364,18 @@@ function quiz_user_outline($course, $us
          $grade = reset($grades->items[0]->grades);
      }
  
 -    $result = new stdClass;
 +    $result = new stdClass();
      $result->info = get_string('grade') . ': ' . $grade->str_long_grade;
-     $result->time = $grade->dategraded;
+     //datesubmitted == time created. dategraded == time modified or time overridden
+     //if grade was last modified by the user themselves use date graded. Otherwise use date submitted
+     //TODO: move this copied & pasted code somewhere in the grades API. See MDL-26704
+     if ($grade->usermodified == $user->id || empty($grade->datesubmitted)) {
+         $result->time = $grade->dategraded;
+     } else {
+         $result->time = $grade->datesubmitted;
+     }
      return $result;
  }