mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-26704 gradebook: added some intelligence to the dates displayed on the user outline activity report
This commit is contained in:
parent
439ae873af
commit
4433f871f2
@ -962,7 +962,15 @@ function data_user_outline($course, $user, $mod, $data) {
|
||||
} else if ($grade) {
|
||||
$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;
|
||||
}
|
||||
return NULL;
|
||||
|
@ -1131,7 +1131,15 @@ function forum_user_outline($course, $user, $mod, $forum) {
|
||||
} else if ($grade) {
|
||||
$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;
|
||||
}
|
||||
return NULL;
|
||||
|
@ -243,7 +243,15 @@ function glossary_user_outline($course, $user, $mod, $glossary) {
|
||||
} else if ($grade) {
|
||||
$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;
|
||||
}
|
||||
return NULL;
|
||||
|
@ -166,8 +166,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;
|
||||
$return->info = get_string("no")." ".get_string("attempts", "lesson");
|
||||
|
||||
//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;
|
||||
}
|
||||
|
@ -381,7 +381,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;
|
||||
}
|
||||
|
||||
|
@ -294,7 +294,15 @@ function scorm_user_outline($course, $user, $mod, $scorm) {
|
||||
$grade = reset($grades->items[0]->grades);
|
||||
$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;
|
||||
}
|
||||
return null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user