From 469f035a4c22689f69a1fdeddcc9f0e3e17796cb Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Sun, 7 Feb 2021 13:44:02 +0800 Subject: [PATCH] MDL-70817 mod_choice: Show choice activity info --- mod/choice/view.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mod/choice/view.php b/mod/choice/view.php index 63f797893eac6..495ed91d62e18 100644 --- a/mod/choice/view.php +++ b/mod/choice/view.php @@ -19,6 +19,7 @@ if (! $cm = get_coursemodule_from_id('choice', $id)) { print_error('invalidcoursemodule'); } +$cm = cm_info::create($cm); if (! $course = $DB->get_record("course", array("id" => $cm->course))) { print_error('coursemisconf'); @@ -99,6 +100,11 @@ echo $OUTPUT->header(); echo $OUTPUT->heading(format_string($choice->name), 2, null); +// Render the activity information. +$completiondetails = \core_completion\cm_completion_details::get_instance($cm, $USER->id); +$activitydates = \core\activity_dates::get_dates_for_module($cm, $USER->id); +echo $OUTPUT->activity_information($cm, $completiondetails, $activitydates); + if ($notify and confirm_sesskey()) { if ($notify === 'choicesaved') { echo $OUTPUT->notification(get_string('choicesaved', 'choice'), 'notifysuccess');