Skip to content

Commit

Permalink
MDL-70817 mod_choice: Show choice activity info
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Apr 2, 2021
1 parent dd32d65 commit 469f035
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mod/choice/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 469f035

Please sign in to comment.