Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-34377: Fix: assignments overview page shows a unset due date as E…

…poch and counts draft submissions
  • Loading branch information...
commit 9da954c0b69d702d4f6fc9f831a6194e46879b2f 1 parent 01ac783
@raymondAntonio raymondAntonio authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 mod/assign/index.php
View
9 mod/assign/index.php
@@ -56,8 +56,13 @@
$cm = get_coursemodule_from_instance('assign', $assignment->id, 0, false, MUST_EXIST);
$link = html_writer::link(new moodle_url('/mod/assign/view.php', array('id' => $cm->id)), $assignment->name);
- $date = userdate($assignment->duedate);
- $submissions = $DB->count_records('assign_submission', array('assignment'=>$cm->instance));
+ $date = '-';
+ if (!empty($assignment->duedate)) {
+ $date = userdate($assignment->duedate);
+ }
+
+ $params = array('assignment'=>$cm->instance, 'status'=>ASSIGN_SUBMISSION_STATUS_SUBMITTED);
+ $submissions = $DB->count_records('assign_submission', $params);
$row = array($link, $date, $submissions);
$table->data[] = $row;
Please sign in to comment.
Something went wrong with that request. Please try again.