Skip to content

Commit

Permalink
Merge branch 'MDL-68124-401' of https://github.com/sarjona/moodle int…
Browse files Browse the repository at this point in the history
…o MOODLE_401_STABLE
  • Loading branch information
junpataleta committed Dec 20, 2023
2 parents 148ddd2 + b1e918e commit 3a09825
Showing 1 changed file with 43 additions and 18 deletions.
61 changes: 43 additions & 18 deletions mod/lesson/tests/behat/lesson_review.feature
Expand Up @@ -16,51 +16,76 @@ Feature: In a lesson activity, students can review the answers they gave to ques
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activity" exist:
| activity | name | course | idnumber |
| lesson | Test lesson name | C1 | lesson1 |
And the following "activity" exists:
| activity | lesson |
| name | Test lesson name |
| course | C1 |
| idnumber | lesson1 |
# Display ongoing score = Yes
| ongoing | 1 |
# Slideshow = Yes
| slideshow | 1 |
# Maximum number of answers = 10
| maxanswers | 10 |
# Allow student review = Yes
| modattempts | 1 |
# Maximum number of attempts per question
| maxattempts | 3 |
# Custom scoring = No
| custom | 0 |
# Re-takes allowed = Yes
| retake | 1 |
And the following "mod_lesson > pages" exist:
| lesson | qtype | title | content |
| Test lesson name | numeric | Hardest question ever | 1 + 1? |
| Test lesson name | truefalse | Next question | Paper is made from trees. |
And the following "mod_lesson > answers" exist:
| page | answer | response | jumpto | score |
| Hardest question ever | 2 | Correct answer | Next page | 1 |
| Hardest question ever | 1 | Incorrect answer | This page | 0 |
| Next question | True | Correct | Next page | 1 |
| Next question | False | Wrong | This page | 0 |
And I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
And I set the following fields to these values:
| Display ongoing score | Yes |
| Slideshow | Yes |
| Maximum number of answers | 10 |
| Allow student review | Yes |
| Maximum number of attempts per question | 3 |
| Custom scoring | No |
| Re-takes allowed | Yes |
And I press "Save and display"
| page | answer | response | jumpto | score |
| Hardest question ever | 2 | Correct answer 1 | Next page | 1 |
| Hardest question ever | 1 | Incorrect answer 1 | This page | 0 |
| Next question | True | Correct answer 2 | Next page | 1 |
| Next question | False | Incorrect answer 2 | This page | 0 |
And I am on the "Test lesson name" "lesson activity" page logged in as student1
And I should see "You have answered 0 correctly out of 0 attempts."
And I should see "1 + 1?"
And I wait "1" seconds
And I set the following fields to these values:
| Your answer | 1 |
And I press "Submit"
And I should see "You have answered 0 correctly out of 1 attempts."
And I press "Continue"
And I should see "1 + 1?"
And I wait "1" seconds
And I set the following fields to these values:
| Your answer | 2 |
And I press "Submit"
And I should see "You have answered 1 correctly out of 2 attempts."
And I press "Continue"
And I should see "Paper is made from trees."
And I wait "1" seconds
And I set the following fields to these values:
| True | 1 |
And I press "Submit"
And I should see "You have answered 2 correctly out of 3 attempts."
And I should see "Paper is made from trees."
And I press "Continue"
And I should see "Congratulations - end of lesson reached"
And I should see "Number of questions answered: 2"
And I should see "Number of correct answers: 2"
And I should see "Your score is 2 (out of 3)."
When I follow "Review lesson"
Then I should see "You have answered 2 correctly out of 3 attempts."
And I should see "1 + 1?"
And I press "Next page"
And I should see "You have answered 2 correctly out of 3 attempts."
And I should see "1 + 1?"
And I should see "Correct answer 1"
And I press "Continue"
And I should see "You have answered 2 correctly out of 3 attempts."
And I should see "Paper is made from trees."
And I press "Next page"
And I should see "You have answered 2 correctly out of 3 attempts."
And I should see "Paper is made from trees."
And I should see "Correct answer 2"
And I press "Continue"
And I should see "Congratulations - end of lesson reached"

0 comments on commit 3a09825

Please sign in to comment.