Skip to content

Commit

Permalink
Merge branch 'MDL-80402-401' of https://github.com/andelacruz/moodle
Browse files Browse the repository at this point in the history
…into MOODLE_401_STABLE
  • Loading branch information
junpataleta committed Feb 13, 2024
2 parents 8a38a37 + 5a7963d commit 652633b
Showing 1 changed file with 38 additions and 5 deletions.
43 changes: 38 additions & 5 deletions mod/quiz/tests/behat/attempt_require_previous.feature
Expand Up @@ -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 |
Expand All @@ -40,23 +40,51 @@ 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."
And I should not see "Second 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 | <quizbehaviour> |
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 | <quizbehaviour> |
And quiz "Quiz 1" contains the following questions:
| question | page | requireprevious |
| TF1 | 1 | 0 |
Expand All @@ -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:
Expand Down

0 comments on commit 652633b

Please sign in to comment.