Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-30350 Highlight late submissions in the submission overview page

  • Loading branch information...
commit 6298e8d646df53c2fe2db9ab28dbc55fecb71e30 1 parent 47ec4ba
@andrewnicols andrewnicols authored nebgor committed
Showing with 10 additions and 4 deletions.
  1. +10 −4 mod/assignment/lib.php
View
14 mod/assignment/lib.php
@@ -1349,6 +1349,7 @@ function display_submissions($message='') {
$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 @@ function display_submissions($message='') {
///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 = '<div id="ts'.$auser->id.'">'.$this->print_student_answer($auser->id)
- . userdate($auser->timemodified).'</div>';
+ $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 = '<div id="ts'.$auser->id.'">&nbsp;</div>';
+ $studentmodifiedcontent = '&nbsp;';
}
+ $studentmodified = html_writer::tag('div', $studentmodifiedcontent, array('id' => 'ts' . $auser->id));
///Print grade, dropdown or text
if ($auser->timemarked > 0) {
$teachermodified = '<div id="tt'.$auser->id.'">'.userdate($auser->timemarked).'</div>';
@@ -1486,7 +1492,7 @@ function display_submissions($message='') {
if ($uses_outcomes) {
$row[] = $outcomes;
}
- $table->add_data($row);
+ $table->add_data($row, $rowclass);
}
$currentposition++;
}
Please sign in to comment.
Something went wrong with that request. Please try again.