Merge branch 'MDL-84255-405' of https://github.com/lucaboesch/moodle into MOODLE_405_STABLE

This commit is contained in:
Mihail Geshoski
2025-07-09 23:17:22 +08:00
3 changed files with 47 additions and 23 deletions
+3 -1
View File
@@ -140,7 +140,9 @@ $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);
$PAGE->activityheader->disable();
if ($PAGE->pagelayout !== 'secure') {
$PAGE->activityheader->disable();
}
if ($attemptobj->is_last_page($page)) {
$nextpage = -1;
} else {
@@ -234,25 +234,3 @@ Feature: Attempt a quiz
And I press "Continue your attempt"
Then I should see "First question"
And I should not see "First question version 2"
@javascript
Scenario: User image in the quiz navigation in normal mode.
Given I am on the "Quiz 1" "quiz activity editing" page logged in as "admin"
And I expand all fieldsets
And I set the field "Show the user's picture" to "Large image"
And I press "Save and return to course"
And I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I press "Attempt quiz"
Then "Student One" "link" should exist in the "Quiz navigation" "block"
@javascript
Scenario: User image in the quiz navigation in secure layout.
Given I am on the "Quiz 1" "quiz activity editing" page logged in as "admin"
And I expand all fieldsets
And I set the field "Show the user's picture" to "Large image"
And I set the field "Browser security" to "Full screen pop-up with some JavaScript security"
And I press "Save and return to course"
And I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I press "Attempt quiz"
And I switch to a second window
Then "Student One" "link" should not exist in the "Quiz navigation" "block"
@@ -0,0 +1,44 @@
@mod @mod_quiz
Feature: Attempt a quiz in secure layout
As a student
In order to demonstrate what I know
I need to be able to attempt quizzes in secure layout
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student | Student | One | student@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| student | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber | grade | navmethod | browsersecurity | showuserpicture |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | 100 | free | securewindow | 2 |
And the following "question categories" exist:
| contextlevel | reference | name |
| Activity module | quiz1 | Test questions |
And the following "questions" exist:
| questioncategory | qtype | name | questiontext |
| Test questions | truefalse | TF1 | First question |
| Test questions | truefalse | TF2 | Second question |
And quiz "Quiz 1" contains the following questions:
| question | page | maxmark |
| TF1 | 1 | |
| TF2 | 1 | 3.0 |
@javascript
Scenario: Large user image in the quiz navigation in secure layout
Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I press "Attempt quiz"
And I switch to a second window
Then "Student One" "link" should not exist in the "Quiz navigation" "block"
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"
When I press "Attempt quiz"
Then I should see "Course 1"
And I should see "Quiz 1"
And I should see "Quiz 1 description"