MDL-80402 mod_quiz: Behat for interactive quiz question dependency

This commit is contained in:
Angelia Dela Cruz 2023-12-13 12:32:19 +08:00
parent 3fc907e3d8
commit a79c061821

View File

@ -21,14 +21,14 @@ Feature: Attempt a quiz where some questions require that the previous question
| Course | C1 | Test questions |
@javascript
Scenario: A question that requires the previous one is initally blocked
Scenario Outline: A question that requires the previous one is initially blocked
Given the following "questions" exist:
| questioncategory | qtype | name | questiontext |
| Test questions | truefalse | TF1 | First question |
| Test questions | truefalse | TF2 | Second question |
And the following "activities" exist:
| activity | name | intro | course | idnumber | preferredbehaviour |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | immediatefeedback |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | <quizbehaviour> |
And quiz "Quiz 1" contains the following questions:
| question | page | requireprevious |
| TF1 | 1 | 0 |
@ -40,7 +40,6 @@ Feature: Attempt a quiz where some questions require that the previous question
Then I should see "First question"
And I should see "This question cannot be attempted until the previous question has been completed."
And I should not see "Second question"
And I log out
And I am on the "Quiz 1 > student > Attempt 1" "mod_quiz > Attempt review" page logged in as "teacher"
And I should see "First question"
And I should see "This question cannot be attempted until the previous question has been completed."
@ -48,15 +47,20 @@ Feature: Attempt a quiz where some questions require that the previous question
And "Question 1" "link" should exist
And "Question 2" "link" should not exist
Examples:
| quizbehaviour |
| immediatefeedback |
| interactive |
@javascript
Scenario: A question is shown as blocked when previewing a quiz
Scenario Outline: A question is shown as blocked when previewing a quiz
Given the following "questions" exist:
| questioncategory | qtype | name | questiontext |
| Test questions | truefalse | TF1 | First question |
| Test questions | truefalse | TF2 | Second question |
And the following "activities" exist:
| activity | name | intro | course | idnumber | preferredbehaviour |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | immediatefeedback |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | <quizbehaviour> |
And quiz "Quiz 1" contains the following questions:
| question | page | requireprevious |
| TF1 | 1 | 0 |
@ -69,15 +73,20 @@ Feature: Attempt a quiz where some questions require that the previous question
And I should see "This question cannot be attempted until the previous question has been completed."
And I should not see "Second question"
Examples:
| quizbehaviour |
| immediatefeedback |
| interactive |
@javascript
Scenario: A question requires the previous one becomes available when the first one is answered
Scenario Outline: A question requires the previous one becomes available when the first one is answered
Given the following "questions" exist:
| questioncategory | qtype | name | questiontext |
| Test questions | truefalse | TF1 | First question |
| Test questions | truefalse | TF2 | Second question |
And the following "activities" exist:
| activity | name | intro | course | idnumber | preferredbehaviour |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | immediatefeedback |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | <quizbehaviour> |
And quiz "Quiz 1" contains the following questions:
| question | page | requireprevious |
| TF1 | 1 | 0 |
@ -94,6 +103,11 @@ Feature: Attempt a quiz where some questions require that the previous question
And "Question 1" "link" should exist
And "Question 2" "link" should exist
Examples:
| quizbehaviour |
| immediatefeedback |
| interactive |
@javascript
Scenario: After quiz submitted, all questions show on the review page
Given the following "questions" exist: