diff --git a/mod/quiz/attempt.php b/mod/quiz/attempt.php index 45106bfea41..d7f0d25edde 100644 --- a/mod/quiz/attempt.php +++ b/mod/quiz/attempt.php @@ -140,7 +140,12 @@ $headtags = $attemptobj->get_html_head_contributions($page); $PAGE->set_title($attemptobj->attempt_page_title($page)); $PAGE->add_body_class('limitedwidth'); $PAGE->set_heading($attemptobj->get_course()->fullname); -if ($PAGE->pagelayout !== 'secure') { +if ($PAGE->pagelayout === 'secure') { + // Show the activity header (but only the name) in the secure layout on quiz pages. + $PAGE->activityheader->set_attrs([ + 'description' => '', + ]); +} else { $PAGE->activityheader->disable(); } if ($attemptobj->is_last_page($page)) { diff --git a/mod/quiz/tests/behat/attempt_secure_layout.feature b/mod/quiz/tests/behat/attempt_secure_layout.feature index 9f863a5cd2c..7c7e1c4ca29 100644 --- a/mod/quiz/tests/behat/attempt_secure_layout.feature +++ b/mod/quiz/tests/behat/attempt_secure_layout.feature @@ -38,7 +38,9 @@ Feature: Attempt a quiz in secure layout Scenario: A quiz page on the secure layout shows both the course name and the quiz name Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "student" + And I should see "Quiz 1" + And I should see "Quiz 1 description" When I press "Attempt quiz" Then I should see "Course 1" And I should see "Quiz 1" - And I should see "Quiz 1 description" + But I should not see "Quiz 1 description"