Skip to content

Commit

Permalink
Merge branch 'MDL-80402-403' of https://github.com/andelacruz/moodle
Browse files Browse the repository at this point in the history
…into MOODLE_403_STABLE
  • Loading branch information
junpataleta committed Feb 13, 2024
2 parents 28f306a + ab38bff commit 8b009ba
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 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,27 @@ 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 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 |
Expand All @@ -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 |
Expand All @@ -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:
Expand Down

0 comments on commit 8b009ba

Please sign in to comment.