mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-42179 mod_assign: Time remaining issue for group assignment
This commit is contained in:
parent
5fd0df97c5
commit
79397b56cb
4 changed files with 251 additions and 41 deletions
|
@ -558,6 +558,7 @@ class mod_assign_renderer extends plugin_renderer_base {
|
|||
$row->cells = array($cell1, $cell2);
|
||||
$t->data[] = $row;
|
||||
|
||||
$submission = $status->teamsubmission ? $status->teamsubmission : $status->submission;
|
||||
$duedate = $status->duedate;
|
||||
if ($duedate > 0) {
|
||||
// Due date.
|
||||
|
@ -592,8 +593,8 @@ class mod_assign_renderer extends plugin_renderer_base {
|
|||
$row = new html_table_row();
|
||||
$cell1 = new html_table_cell(get_string('timeremaining', 'assign'));
|
||||
if ($duedate - $time <= 0) {
|
||||
if (!$status->submission ||
|
||||
$status->submission->status != ASSIGN_SUBMISSION_STATUS_SUBMITTED) {
|
||||
if (!$submission ||
|
||||
$submission->status != ASSIGN_SUBMISSION_STATUS_SUBMITTED) {
|
||||
if ($status->submissionsenabled) {
|
||||
$overduestr = get_string('overdue', 'assign', format_time($time - $duedate));
|
||||
$cell2 = new html_table_cell($overduestr);
|
||||
|
@ -602,16 +603,16 @@ class mod_assign_renderer extends plugin_renderer_base {
|
|||
$cell2 = new html_table_cell(get_string('duedatereached', 'assign'));
|
||||
}
|
||||
} else {
|
||||
if ($status->submission->timemodified > $duedate) {
|
||||
if ($submission->timemodified > $duedate) {
|
||||
$latestr = get_string('submittedlate',
|
||||
'assign',
|
||||
format_time($status->submission->timemodified - $duedate));
|
||||
format_time($submission->timemodified - $duedate));
|
||||
$cell2 = new html_table_cell($latestr);
|
||||
$cell2->attributes = array('class'=>'latesubmission');
|
||||
} else {
|
||||
$earlystr = get_string('submittedearly',
|
||||
'assign',
|
||||
format_time($status->submission->timemodified - $duedate));
|
||||
format_time($submission->timemodified - $duedate));
|
||||
$cell2 = new html_table_cell($earlystr);
|
||||
$cell2->attributes = array('class'=>'earlysubmission');
|
||||
}
|
||||
|
@ -648,7 +649,6 @@ class mod_assign_renderer extends plugin_renderer_base {
|
|||
}
|
||||
|
||||
// Last modified.
|
||||
$submission = $status->teamsubmission ? $status->teamsubmission : $status->submission;
|
||||
if ($submission) {
|
||||
$row = new html_table_row();
|
||||
$cell1 = new html_table_cell(get_string('timemodified', 'assign'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue