mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 09:56:38 +02:00
MDL-37490 mod_assign: Add setting to show the due date on the course page.
This commit is contained in:
parent
b3be471f52
commit
ef8a6dfb33
9 changed files with 69 additions and 8 deletions
|
@ -257,7 +257,7 @@ function assign_get_coursemodule_info($coursemodule) {
|
|||
global $CFG, $DB;
|
||||
|
||||
$dbparams = array('id'=>$coursemodule->instance);
|
||||
$fields = 'id, name, alwaysshowdescription, allowsubmissionsfromdate, intro, introformat';
|
||||
$fields = 'id, name, alwaysshowdescription, allowsubmissionsfromdate, intro, introformat, duedate, displayduedate';
|
||||
if (! $assignment = $DB->get_record('assign', $dbparams, $fields)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -270,6 +270,14 @@ function assign_get_coursemodule_info($coursemodule) {
|
|||
$result->content = format_module_intro('assign', $assignment, $coursemodule->id, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (($assignment->duedate > 0) && ($assignment->displayduedate)) {
|
||||
if (empty($result->content)){
|
||||
$result->content = '';
|
||||
}
|
||||
$result->content .= html_writer::tag('p', get_string('duedate', 'assign') . ': ' . userdate($assignment->duedate));
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue