Skip to content
Browse files

Merge branch 'MDL-26704_user_outline_report_19' of git://github.com/a…

…ndyjdavis/moodle into MOODLE_19_STABLE
  • Loading branch information...
2 parents 4f336e2 + b66705e commit 8347921cfa199454813fa0a88b4a247d419b80a7 @stronk7 stronk7 committed May 17, 2011
Showing with 54 additions and 7 deletions.
  1. +9 −1 mod/data/lib.php
  2. +9 −1 mod/forum/lib.php
  3. +9 −1 mod/glossary/lib.php
  4. +8 −1 mod/lesson/lib.php
  5. +9 −1 mod/quiz/lib.php
  6. +10 −2 mod/scorm/lib.php
View
10 mod/data/lib.php
@@ -729,7 +729,15 @@ function data_user_outline($course, $user, $mod, $data) {
} else if ($grade) {
$result = new object();
$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
+ if ($grade->usermodified == $user->id || empty($grade->datesubmitted)) {
+ $result->time = $grade->dategraded;
+ } else {
+ $result->time = $grade->datesubmitted;
+ }
+
return $result;
}
return NULL;
View
10 mod/forum/lib.php
@@ -976,7 +976,15 @@ function forum_user_outline($course, $user, $mod, $forum) {
} else if ($grade) {
$result = new object();
$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
+ if ($grade->usermodified == $user->id || empty($grade->datesubmitted)) {
+ $result->time = $grade->dategraded;
+ } else {
+ $result->time = $grade->datesubmitted;
+ }
+
return $result;
}
return NULL;
View
10 mod/glossary/lib.php
@@ -189,7 +189,15 @@ function glossary_user_outline($course, $user, $mod, $glossary) {
} else if ($grade) {
$result = new object();
$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
+ if ($grade->usermodified == $user->id || empty($grade->datesubmitted)) {
+ $result->time = $grade->dategraded;
+ } else {
+ $result->time = $grade->datesubmitted;
+ }
+
return $result;
}
View
9 mod/lesson/lib.php
@@ -155,7 +155,14 @@ function lesson_user_outline($course, $user, $mod, $lesson) {
} else {
$grade = reset($grades->items[0]->grades);
$return->info = get_string("grade") . ': ' . $grade->str_long_grade;
- $return->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
+ if ($grade->usermodified == $user->id || empty($grade->datesubmitted)) {
+ $result->time = $grade->dategraded;
+ } else {
+ $result->time = $grade->datesubmitted;
+ }
}
return $return;
}
View
10 mod/quiz/lib.php
@@ -209,7 +209,15 @@ function quiz_user_outline($course, $user, $mod, $quiz) {
$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
+ if ($grade->usermodified == $user->id || empty($grade->datesubmitted)) {
+ $result->time = $grade->dategraded;
+ } else {
+ $result->time = $grade->datesubmitted;
+ }
+
return $result;
}
View
12 mod/scorm/lib.php
@@ -225,7 +225,15 @@ function scorm_user_outline($course, $user, $mod, $scorm) {
$grade = reset($grades->items[0]->grades);
$result = new object();
$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
+ if ($grade->usermodified == $user->id || empty($grade->datesubmitted)) {
+ $result->time = $grade->dategraded;
+ } else {
+ $result->time = $grade->datesubmitted;
+ }
+
return $result;
}
return null;
@@ -664,4 +672,4 @@ function scorm_is_moddata_trusted() {
return true;
}
-?>
+?>

0 comments on commit 8347921

Please sign in to comment.
Something went wrong with that request. Please try again.