1 |
efrain |
1 |
@mod @mod_lesson @core_completion
|
|
|
2 |
Feature: Pass grade activity completion in the lesson activity
|
|
|
3 |
|
|
|
4 |
Background:
|
|
|
5 |
Given the following "users" exist:
|
|
|
6 |
| username | firstname | lastname | email |
|
|
|
7 |
| student1 | Vinnie | Student1 | student1@example.com |
|
|
|
8 |
| student2 | Vinnie | Student2 | student2@example.com |
|
|
|
9 |
| student3 | Vinnie | Student3 | student3@example.com |
|
|
|
10 |
| teacher1 | Darrell | Teacher1 | teacher1@example.com |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname | category | enablecompletion | showcompletionconditions |
|
|
|
13 |
| Course 1 | C1 | 0 | 1 | 1 |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| student1 | C1 | student |
|
|
|
17 |
| student2 | C1 | student |
|
|
|
18 |
| student3 | C1 | student |
|
|
|
19 |
| teacher1 | C1 | editingteacher |
|
|
|
20 |
And the following "activity" exists:
|
|
|
21 |
| activity | lesson |
|
|
|
22 |
| course | C1 |
|
|
|
23 |
| idnumber | mh1 |
|
|
|
24 |
| name | Music history |
|
|
|
25 |
| gradepass | 50 |
|
|
|
26 |
| completion | 2 |
|
|
|
27 |
| completionusegrade | 1 |
|
|
|
28 |
| completionpassgrade | 1 |
|
|
|
29 |
And the following "mod_lesson > page" exist:
|
|
|
30 |
| lesson | qtype | title | content |
|
|
|
31 |
| Music history | numeric | Numerical question | What is 1 + 2? |
|
|
|
32 |
And the following "mod_lesson > answers" exist:
|
|
|
33 |
| page | answer | jumpto | score |
|
|
|
34 |
| Numerical question | 3 | End of lesson | 1 |
|
|
|
35 |
| Numerical question | @#wronganswer#@ | Next page | 0 |
|
|
|
36 |
|
|
|
37 |
Scenario: View automatic completion items as a teacher
|
|
|
38 |
When I am on the "Music history" "lesson activity" page logged in as teacher1
|
|
|
39 |
And "Music history" should have the "Receive a grade" completion condition
|
|
|
40 |
And "Music history" should have the "Receive a passing grade" completion condition
|
|
|
41 |
|
|
|
42 |
Scenario: View automatic completion items as a student
|
|
|
43 |
Given I am on the "Music history" "lesson activity" page logged in as student1
|
|
|
44 |
And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
|
|
|
45 |
And the "Receive a passing grade" completion condition of "Music history" is displayed as "todo"
|
|
|
46 |
When I am on the "Music history" "lesson activity" page
|
|
|
47 |
And I set the field "Your answer" to "3"
|
|
|
48 |
And I press "Submit"
|
|
|
49 |
And the "Receive a grade" completion condition of "Music history" is displayed as "done"
|
|
|
50 |
And the "Receive a passing grade" completion condition of "Music history" is displayed as "done"
|
|
|
51 |
And I am on the "Music history" "lesson activity" page logged in as student2
|
|
|
52 |
And I set the field "Your answer" to "0"
|
|
|
53 |
And I press "Submit"
|
|
|
54 |
And the "Receive a grade" completion condition of "Music history" is displayed as "done"
|
|
|
55 |
And the "Receive a passing grade" completion condition of "Music history" is displayed as "failed"
|
|
|
56 |
And I am on the "Course 1" course page logged in as teacher1
|
|
|
57 |
And "Vinnie Student1" user has completed "Music history" activity
|
|
|
58 |
And "Vinnie Student2" user has completed "Music history" activity
|
|
|
59 |
And "Vinnie Student3" user has not completed "Music history" activity
|