From 6298e8d646df53c2fe2db9ab28dbc55fecb71e30 Mon Sep 17 00:00:00 2001 From: Andrew Robert Nicols Date: Fri, 18 Nov 2011 14:06:29 +0000 Subject: [PATCH] MDL-30350 Highlight late submissions in the submission overview page --- mod/assignment/lib.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index 52ba380eea8..c41dd4f5fe9 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -1349,6 +1349,7 @@ class assignment_base { $currentposition = 0; foreach ($ausers as $auser) { if ($currentposition == $offset && $offset < $endposition) { + $rowclass = null; $final_grade = $grading_info->items[0]->grades[$auser->id]; $grademax = $grading_info->items[0]->grademax; $final_grade->formatted_grade = round($final_grade->grade,2) .' / ' . round($grademax,2); @@ -1369,11 +1370,16 @@ class assignment_base { ///attach file or print link to student answer, depending on the type of the assignment. ///Refer to print_student_answer in inherited classes. if ($auser->timemodified > 0) { - $studentmodified = '
'.$this->print_student_answer($auser->id) - . userdate($auser->timemodified).'
'; + $studentmodifiedcontent = $this->print_student_answer($auser->id) + . userdate($auser->timemodified); + if ($assignment->timedue && $auser->timemodified > $assignment->timedue) { + $studentmodifiedcontent .= assignment_display_lateness($auser->timemodified, $assignment->timedue); + $rowclass = 'late'; + } } else { - $studentmodified = '
 
'; + $studentmodifiedcontent = ' '; } + $studentmodified = html_writer::tag('div', $studentmodifiedcontent, array('id' => 'ts' . $auser->id)); ///Print grade, dropdown or text if ($auser->timemarked > 0) { $teachermodified = '
'.userdate($auser->timemarked).'
'; @@ -1486,7 +1492,7 @@ class assignment_base { if ($uses_outcomes) { $row[] = $outcomes; } - $table->add_data($row); + $table->add_data($row, $rowclass); } $currentposition++; }