1 |
efrain |
1 |
@mod @mod_book @core_completion
|
|
|
2 |
Feature: View activity completion information in the book activity
|
|
|
3 |
In order to have visibility of book completion requirements
|
|
|
4 |
As a student
|
|
|
5 |
I need to be able to view my book completion progress
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| student1 | Vinnie | Student1 | student1@example.com |
|
|
|
11 |
| teacher1 | Darrell | Teacher1 | teacher1@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname | enablecompletion | showcompletionconditions |
|
|
|
14 |
| Course 1 | C1 | 1 | 1 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| student1 | C1 | student |
|
|
|
18 |
| teacher1 | C1 | editingteacher |
|
|
|
19 |
And the following "activity" exists:
|
|
|
20 |
| activity | book |
|
|
|
21 |
| course | C1 |
|
|
|
22 |
| idnumber | mh1 |
|
|
|
23 |
| name | Music history |
|
|
|
24 |
| completion | 2 |
|
|
|
25 |
| completionview | 1 |
|
|
|
26 |
|
|
|
27 |
Scenario: View automatic completion items
|
|
|
28 |
Given the following "mod_book > chapter" exists:
|
|
|
29 |
| book | Music history |
|
|
|
30 |
| title | Drum theory |
|
|
|
31 |
| content | Rudiments are important |
|
|
|
32 |
And I am on the "Music history" "book activity" page logged in as teacher1
|
|
|
33 |
And "Music history" should have the "View" completion condition
|
|
|
34 |
# Student view.
|
|
|
35 |
When I am on the "Music history" "book activity" page logged in as student1
|
|
|
36 |
Then the "View" completion condition of "Music history" is displayed as "done"
|
|
|
37 |
|
|
|
38 |
Scenario: View automatic completion items with last section hidden
|
|
|
39 |
Given the following "activity" exists:
|
|
|
40 |
| activity | book |
|
|
|
41 |
| course | C1 |
|
|
|
42 |
| idnumber | arth1 |
|
|
|
43 |
| name | Art history |
|
|
|
44 |
| completion | 2 |
|
|
|
45 |
| completionview | 1 |
|
|
|
46 |
And the following "mod_book > chapters" exist:
|
|
|
47 |
| book | title | content | pagenum | subchapter | hidden |
|
|
|
48 |
| Art history | First chapter | First chapter | 1 | 0 | 0 |
|
|
|
49 |
| Art history | Second chapter | Second chapter | 2 | 0 | 0 |
|
|
|
50 |
| Art history | Sub chapter 1 | Sub chapter | 3 | 1 | 0 |
|
|
|
51 |
| Art history | Sub chapter 2 | Sub chapter | 4 | 1 | 0 |
|
|
|
52 |
| Art history | Sub chapter 3 | Sub chapter | 5 | 1 | 1 |
|
|
|
53 |
When I am on the "Art history" "book activity" page logged in as student1
|
|
|
54 |
And I should see "First chapter"
|
|
|
55 |
And the "View" completion condition of "Art history" is displayed as "todo"
|
|
|
56 |
And I follow "Next"
|
|
|
57 |
And I should see "Second chapter"
|
|
|
58 |
And the "View" completion condition of "Art history" is displayed as "todo"
|
|
|
59 |
And I follow "Next"
|
|
|
60 |
And I should see "Sub chapter 1"
|
|
|
61 |
And the "View" completion condition of "Art history" is displayed as "todo"
|
|
|
62 |
And I follow "Next"
|
|
|
63 |
And I should see "Sub chapter 2"
|
|
|
64 |
And I should not see "Next"
|
|
|
65 |
Then the "View" completion condition of "Art history" is displayed as "done"
|
|
|
66 |
|
|
|
67 |
@javascript
|
|
|
68 |
Scenario: Use manual completion
|
|
|
69 |
Given I am on the "Music history" "book activity editing" page logged in as teacher1
|
|
|
70 |
And I expand all fieldsets
|
|
|
71 |
And I set the field "Students must manually mark the activity as done" to "1"
|
|
|
72 |
And I press "Save and display"
|
|
|
73 |
And I set the following fields to these values:
|
|
|
74 |
| Chapter title | Drum theory |
|
|
|
75 |
| Content | Rudiments are important |
|
|
|
76 |
And I press "Save changes"
|
|
|
77 |
And I am on the "Music history" "book activity" page
|
|
|
78 |
# Teacher view.
|
|
|
79 |
And the manual completion button for "Music history" should be disabled
|
|
|
80 |
# Student view.
|
|
|
81 |
Given I am on the "Music history" "book activity" page logged in as student1
|
|
|
82 |
Then the manual completion button of "Music history" is displayed as "Mark as done"
|
|
|
83 |
And I toggle the manual completion state of "Music history"
|
|
|
84 |
And the manual completion button of "Music history" is displayed as "Done"
|