1 |
efrain |
1 |
@mod @mod_lesson
|
|
|
2 |
Feature: In a lesson activity, students can review the answers they gave to questions
|
|
|
3 |
To review questions of a lesson
|
|
|
4 |
As a student
|
|
|
5 |
I need to complete a lesson answering all of the questions.
|
|
|
6 |
|
|
|
7 |
Scenario: Student answers questions and then reviews them.
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname | category |
|
|
|
14 |
| Course 1 | C1 | 0 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
And the following "activity" exists:
|
|
|
20 |
| activity | lesson |
|
|
|
21 |
| name | Test lesson name |
|
|
|
22 |
| course | C1 |
|
|
|
23 |
| idnumber | lesson1 |
|
|
|
24 |
# Display ongoing score = Yes
|
|
|
25 |
| ongoing | 1 |
|
|
|
26 |
# Slideshow = Yes
|
|
|
27 |
| slideshow | 1 |
|
|
|
28 |
# Maximum number of answers = 10
|
|
|
29 |
| maxanswers | 10 |
|
|
|
30 |
# Allow student review = Yes
|
|
|
31 |
| modattempts | 1 |
|
|
|
32 |
# Maximum number of attempts per question
|
|
|
33 |
| maxattempts | 3 |
|
|
|
34 |
# Custom scoring = No
|
|
|
35 |
| custom | 0 |
|
|
|
36 |
# Re-takes allowed = Yes
|
|
|
37 |
| retake | 1 |
|
|
|
38 |
And the following "mod_lesson > pages" exist:
|
|
|
39 |
| lesson | qtype | title | content |
|
|
|
40 |
| Test lesson name | numeric | Hardest question ever | 1 + 1? |
|
|
|
41 |
| Test lesson name | truefalse | Next question | Paper is made from trees. |
|
|
|
42 |
And the following "mod_lesson > answers" exist:
|
|
|
43 |
| page | answer | response | jumpto | score |
|
|
|
44 |
| Hardest question ever | 2 | Correct answer 1 | Next page | 1 |
|
|
|
45 |
| Hardest question ever | 1 | Incorrect answer 1 | This page | 0 |
|
|
|
46 |
| Next question | True | Correct answer 2 | Next page | 1 |
|
|
|
47 |
| Next question | False | Incorrect answer 2 | This page | 0 |
|
|
|
48 |
And I am on the "Test lesson name" "lesson activity" page logged in as student1
|
|
|
49 |
And I should see "You have answered 0 correctly out of 0 attempts."
|
|
|
50 |
And I should see "1 + 1?"
|
|
|
51 |
And I wait "1" seconds
|
|
|
52 |
And I set the following fields to these values:
|
|
|
53 |
| Your answer | 1 |
|
|
|
54 |
And I press "Submit"
|
|
|
55 |
And I should see "You have answered 0 correctly out of 1 attempts."
|
|
|
56 |
And I press "Continue"
|
|
|
57 |
And I should see "1 + 1?"
|
|
|
58 |
And I wait "1" seconds
|
|
|
59 |
And I set the following fields to these values:
|
|
|
60 |
| Your answer | 2 |
|
|
|
61 |
And I press "Submit"
|
|
|
62 |
And I should see "You have answered 1 correctly out of 2 attempts."
|
|
|
63 |
And I press "Continue"
|
|
|
64 |
And I should see "Paper is made from trees."
|
|
|
65 |
And I wait "1" seconds
|
|
|
66 |
And I set the following fields to these values:
|
|
|
67 |
| True | 1 |
|
|
|
68 |
And I press "Submit"
|
|
|
69 |
And I should see "You have answered 2 correctly out of 3 attempts."
|
|
|
70 |
And I should see "Paper is made from trees."
|
|
|
71 |
And I press "Continue"
|
|
|
72 |
And I should see "Congratulations - end of lesson reached"
|
|
|
73 |
And I should see "Number of questions answered: 2"
|
|
|
74 |
And I should see "Number of correct answers: 2"
|
|
|
75 |
And I should see "Your score is 2 (out of 3)."
|
|
|
76 |
When I follow "Review lesson"
|
|
|
77 |
Then I should see "You have answered 2 correctly out of 3 attempts."
|
|
|
78 |
And I should see "1 + 1?"
|
|
|
79 |
And I press "Next page"
|
|
|
80 |
And I should see "You have answered 2 correctly out of 3 attempts."
|
|
|
81 |
And I should see "1 + 1?"
|
|
|
82 |
And I should see "Correct answer 1"
|
|
|
83 |
And I press "Continue"
|
|
|
84 |
And I should see "You have answered 2 correctly out of 3 attempts."
|
|
|
85 |
And I should see "Paper is made from trees."
|
|
|
86 |
And I press "Next page"
|
|
|
87 |
And I should see "You have answered 2 correctly out of 3 attempts."
|
|
|
88 |
And I should see "Paper is made from trees."
|
|
|
89 |
And I should see "Correct answer 2"
|
|
|
90 |
And I press "Continue"
|
|
|
91 |
And I should see "Congratulations - end of lesson reached"
|