MDL-72413 choice: Use the common module for setting the header

This commit is contained in:
Peter Dias 2021-09-21 09:23:13 +08:00
parent c2c12a7b15
commit ea76db4cbc
2 changed files with 5 additions and 15 deletions

View File

@ -67,10 +67,12 @@
$PAGE->navbar->add($strresponses);
$PAGE->set_title(format_string($choice->name).": $strresponses");
$PAGE->set_heading($course->fullname);
$PAGE->activityheader->set_attrs([
'hidecompletion' => true,
'description' => ''
]);
echo $OUTPUT->header();
if (!$PAGE->has_secondary_navigation()) {
echo $OUTPUT->heading(format_string($choice->name), 2, null);
}
/// Check to see if groups are being used in this choice
$groupmode = groups_get_activity_groupmode($cm);
if ($groupmode) {

View File

@ -98,14 +98,6 @@ if (data_submitted() && !empty($action) && confirm_sesskey()) {
choice_view($choice, $course, $cm, $context);
echo $OUTPUT->header();
if (!$PAGE->has_secondary_navigation()) {
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') {
@ -140,10 +132,6 @@ if (has_capability('mod/choice:readresponses', $context) && !$PAGE->has_secondar
echo '<div class="clearer"></div>';
if ($choice->intro) {
echo $OUTPUT->box(format_module_intro('choice', $choice, $cm->id), 'generalbox', 'intro');
}
$timenow = time();
$current = choice_get_my_response($choice);
//if user has already made a selection, and they are not allowed to update it or if choice is not open, show their selected answer.