1 |
efrain |
1 |
@mod @mod_resource @core_completion @_file_upload
|
|
|
2 |
Feature: View activity completion information for file resources
|
|
|
3 |
In order to have visibility of file resource completion requirements
|
|
|
4 |
As a student
|
|
|
5 |
I need to be able to view my file resource 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 | category | enablecompletion |
|
|
|
14 |
| Course 1 | C1 | 0 | 1 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| student1 | C1 | student |
|
|
|
18 |
| teacher1 | C1 | editingteacher |
|
|
|
19 |
And the following config values are set as admin:
|
|
|
20 |
| displayoptions | 0,1,2,3,4,5,6 | resource |
|
|
|
21 |
|
|
|
22 |
@javascript
|
|
|
23 |
Scenario Outline: The manual completion button will be shown on the course page for Open, In pop-up, New window and Force download display mode if Show activity completion conditions is set to No
|
|
|
24 |
Given the following "activities" exist:
|
|
|
25 |
| activity | course | name | display | showsize | showtype | showdate | completion | defaultfilename | popupwidth | popupheight | uploaded |
|
|
|
26 |
| resource | C1 | Myfile | <display> | 0 | 0 | 0 | 1 | mod/resource/tests/fixtures/samplefile.txt | 620 | 450 | 1 |
|
|
|
27 |
And I am on the "Course 1" course page logged in as teacher1
|
|
|
28 |
# Teacher view.
|
|
|
29 |
And "Myfile" should have the "Mark as done" completion condition
|
|
|
30 |
# Student view.
|
|
|
31 |
When I am on the "Course 1" course page logged in as student1
|
|
|
32 |
Then the manual completion button for "Myfile" should exist
|
|
|
33 |
And the manual completion button of "Myfile" is displayed as "Mark as done"
|
|
|
34 |
And I toggle the manual completion state of "Myfile"
|
|
|
35 |
And the manual completion button of "Myfile" is displayed as "Done"
|
|
|
36 |
|
|
|
37 |
Examples:
|
|
|
38 |
| display |
|
|
|
39 |
| 5 |
|
|
|
40 |
| 6 |
|
|
|
41 |
| 4 |
|
|
|
42 |
| 3 |
|
|
|
43 |
|
|
|
44 |
@javascript
|
|
|
45 |
Scenario: The manual completion button will be shown on the activity page and course page if Show activity completion conditions is set to Yes
|
|
|
46 |
Given the following "activities" exist:
|
|
|
47 |
| activity | course | name | display | defaultfilename | uploaded |
|
|
|
48 |
| resource | C1 | Myfile | 1 | mod/resource/tests/fixtures/samplefile.txt | 1 |
|
|
|
49 |
And I am on the "Course 1" "course editing" page logged in as "teacher1"
|
|
|
50 |
And I expand all fieldsets
|
|
|
51 |
And I set the field "Show activity completion conditions" to "Yes"
|
|
|
52 |
And I press "Save and display"
|
|
|
53 |
And I am on the "Myfile" "resource activity editing" page
|
|
|
54 |
And I set the following fields to these values:
|
|
|
55 |
| Students must manually mark the activity as done | 1 |
|
|
|
56 |
And I click on "Save and return to course" "button"
|
|
|
57 |
# Teacher view.
|
|
|
58 |
And "Myfile" should have the "Mark as done" completion condition
|
|
|
59 |
And I am on the "Myfile" "resource activity" page
|
|
|
60 |
And the manual completion button for "Myfile" should exist
|
|
|
61 |
And the manual completion button for "Myfile" should be disabled
|
|
|
62 |
# Student view.
|
|
|
63 |
When I am on the "Course 1" course page logged in as student1
|
|
|
64 |
Then the manual completion button for "Myfile" should exist
|
|
|
65 |
And I am on the "Myfile" "resource activity" page
|
|
|
66 |
And the manual completion button of "Myfile" is displayed as "Mark as done"
|
|
|
67 |
And I toggle the manual completion state of "Myfile"
|
|
|
68 |
And the manual completion button of "Myfile" is displayed as "Done"
|
|
|
69 |
|
|
|
70 |
@javascript
|
|
|
71 |
Scenario: View automatic completion items
|
|
|
72 |
Given the following "activities" exist:
|
|
|
73 |
| activity | course | name | display | defaultfilename | uploaded |
|
|
|
74 |
| resource | C1 | Myfile | 1 | mod/resource/tests/fixtures/samplefile.txt | 1 |
|
|
|
75 |
And I am on the "Course 1" "course editing" page logged in as "teacher1"
|
|
|
76 |
And I expand all fieldsets
|
|
|
77 |
And I set the field "Show activity completion conditions" to "Yes"
|
|
|
78 |
And I press "Save and display"
|
|
|
79 |
And I am on the "Myfile" "resource activity editing" page
|
|
|
80 |
And I set the following fields to these values:
|
|
|
81 |
| Add requirements | 1 |
|
|
|
82 |
| View the activity | 1 |
|
|
|
83 |
And I press "Save and display"
|
|
|
84 |
# Teacher view.
|
|
|
85 |
And I am on the "Myfile" "resource activity" page
|
|
|
86 |
And "Myfile" should have the "View" completion condition
|
|
|
87 |
# Student view.
|
|
|
88 |
When I am on the "Myfile" "resource activity" page logged in as student1
|
|
|
89 |
Then the "View" completion condition of "Myfile" is displayed as "done"
|