Merge branch 'MDL-83778-404' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_404_STABLE

This commit is contained in:
Huong Nguyen 2024-12-02 10:44:38 +07:00
commit 9ce7e40f2e
No known key found for this signature in database
GPG Key ID: 40D88AB693A3E72A
2 changed files with 19 additions and 0 deletions

View File

@ -104,3 +104,20 @@ Feature: The various checks that may happen when an attept is started
And I press "Cancel"
Then I should see "Quiz 1 description"
And "Attempt quiz" "button" should be visible
@javascript
Scenario: Quiz attempt page reloads upon navigating back using the browser's back button
Given the following "activities" exist:
| activity | name | intro | course | idnumber | timelimit |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | 3600 |
And quiz "Quiz 1" contains the following questions:
| question | page |
| TF1 | 1 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I press "Attempt quiz"
And I should see "Your attempt will have a time limit of 1 hour. When you " in the "Start attempt" "dialogue"
And I start watching to see if a new page loads
And I click on "Start attempt" "button" in the "Start attempt" "dialogue"
And I press the "back" button in the browser
Then a new page should have loaded since I started watching
And I should see "Continue your attempt"

View File

@ -68,6 +68,8 @@ quiz_view($quiz, $course, $cm, $context);
// Initialize $PAGE, compute blocks.
$PAGE->set_url('/mod/quiz/view.php', ['id' => $cm->id]);
// On the quiz view page, the browser back/forwards buttons should force a reload.
$PAGE->set_cacheable(false);
// Create view object which collects all the information the renderer will need.
$viewobj = new view_page();