--- current-assignment/lib.php 2009-11-03 12:26:32.000000000 -0800 +++ working-copy/mod/assignment/lib.php 2009-11-03 12:25:28.000000000 -0800 @@ -3027,7 +3027,27 @@ $str .= $strsubmitted . ', ' . $strgraded; } } else { - $str .= $strnotsubmittedyet . ' ' . assignment_display_lateness(time(), $assignment->timedue); + // MOD -- Students are shown that they're assignment is late when it's not an assignment + // that should be marked as such (eg, an offline activity) + // So, assignment classes have logic to properly return the lateness of an assignment, + // so we load up that class and use it's functions, rather than the generic assignment_display_lateness + // function + $classfile = "$CFG->dirroot/mod/assignment/type/$assignment->assignmenttype/assignment.class.php"; + if (file_exists($classfile)) { + require_once($classfile); + $assignmentclass = "assignment_$assignment->assignmenttype"; + + } else { + debugging("Missing assignment plug-in: {$assignment->assignmenttype}. Using base class for deleting instead."); + $assignmentclass = "assignment_base"; + } + $ass = new $assignmentclass('staticonly'); + $ass->assignment = $assignment; + $late = $ass->display_lateness(time()); + if(!empty($late)) { + $str .= $strnotsubmittedyet . ' ' . $late; + } + // End MOD } } $str .= '';