diff --git a/mod/quiz/tests/behat/attempt_require_previous.feature b/mod/quiz/tests/behat/attempt_require_previous.feature index 4703e754b93..4450cc3e572 100644 --- a/mod/quiz/tests/behat/attempt_require_previous.feature +++ b/mod/quiz/tests/behat/attempt_require_previous.feature @@ -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 | | 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,44 @@ 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 requires the previous one becomes available when the first one is answered + 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 | | + And quiz "Quiz 1" contains the following questions: + | question | page | requireprevious | + | TF1 | 1 | 0 | + | TF2 | 1 | 1 | + When I am on the "Quiz 1" "mod_quiz > View" page logged in as "teacher" + And I press "Preview quiz" + 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" + + Examples: + | quizbehaviour | + | immediatefeedback | + | interactive | + + @javascript + 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 | | And quiz "Quiz 1" contains the following questions: | question | page | requireprevious | | TF1 | 1 | 0 | @@ -73,6 +101,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: