Browse files

MDL-44098: Late submissions with extension calculate period of latene…

…ss incorrectly
  • Loading branch information...
1 parent e6c69d8 commit 837e3741fdf4098879b6bc1225649694229509bd @greg-or greg-or committed May 27, 2014
Showing with 11 additions and 14 deletions.
  1. +11 −14 mod/assign/gradingtable.php
View
25 mod/assign/gradingtable.php
@@ -915,20 +915,21 @@ public function col_status(stdClass $row) {
$instance = $this->assignment->get_instance();
+ $due = $instance->duedate;
+ if ($row->extensionduedate) {
+ $due = $row->extensionduedate;
+ }
+
if ($this->assignment->is_any_submission_plugin_enabled()) {
$o .= $this->output->container(get_string('submissionstatus_' . $row->status, 'assign'),
array('class'=>'submissionstatus' .$row->status));
- if ($instance->duedate &&
- $row->timesubmitted > $instance->duedate) {
- if (!$row->extensionduedate ||
- $row->timesubmitted > $row->extensionduedate) {
- $usertime = format_time($row->timesubmitted - $instance->duedate);
- $latemessage = get_string('submittedlateshort',
- 'assign',
- $usertime);
- $o .= $this->output->container($latemessage, 'latesubmission');
- }
+ if ($due && $row->timesubmitted > $due) {
+ $usertime = format_time($row->timesubmitted - $due);
+ $latemessage = get_string('submittedlateshort',
+ 'assign',
+ $usertime);
+ $o .= $this->output->container($latemessage, 'latesubmission');
}
if ($row->locked) {
$lockedstr = get_string('submissionslockedshort', 'assign');
@@ -944,10 +945,6 @@ public function col_status(stdClass $row) {
if (!$row->timesubmitted) {
$now = time();
- $due = $instance->duedate;
- if ($row->extensionduedate) {
- $due = $row->extensionduedate;
- }
if ($due && ($now > $due)) {
$overduestr = get_string('overdue', 'assign', format_time($now - $due));
$o .= $this->output->container($overduestr, 'overduesubmission');

0 comments on commit 837e374

Please sign in to comment.