mirrored from git://git.moodle.org/moodle.git
/
annotate_pdf.feature
141 lines (139 loc) · 5.88 KB
/
annotate_pdf.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
@mod @mod_assign @assignfeedback @assignfeedback_editpdf @_file_upload
Feature: In an assignment, teacher can annotate PDF files during grading
In order to provide visual report on a graded PDF
As a teacher
I need to use the PDF editor
@javascript
Scenario: Submit a PDF file as a student and annotate the PDF as a teacher
Given ghostscript is installed
And the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I navigate to "Annotate PDF" node in "Site administration > Plugins > Activity modules > Assignment > Feedback plugins"
And I upload "pix/help.png" file to "" filemanager
And I upload "pix/docs.png" file to "" filemanager
When I press "Save changes"
Then I should see "Changes saved"
And I follow "Test ghostscript path"
And I should see "The ghostscript path appears to be OK"
And I log out
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Submit your PDF file |
| assignsubmission_file_enabled | 1 |
| Maximum number of uploaded files | 2 |
And I log out
And I log in as "student1"
And I follow "Course 1"
And I follow "Test assignment name"
And I press "Add submission"
And I upload "mod/assign/feedback/editpdf/tests/fixtures/submission.pdf" file to "File submissions" filemanager
And I upload "mod/assign/feedback/editpdf/tests/fixtures/testgs.pdf" file to "File submissions" filemanager
And I press "Save changes"
And I should see "Submitted for grading"
And I should see "submission.pdf"
And I should see "Not graded"
And I log out
And I log in as "teacher1"
And I follow "Course 1"
And I follow "Test assignment name"
And I follow "View all submissions"
And I click on "Edit" "link" in the "Submitted for grading" "table_row"
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
And I should see "Page 1 of 3"
And I click on ".navigate-next-button" "css_element"
And I should see "Page 2 of 3"
And I click on ".stampbutton" "css_element"
And I click on ".linebutton" "css_element"
And I click on ".commentcolourbutton" "css_element"
And I click on "//img[@alt=\"Blue\"]/parent::button" "xpath_element"
And I wait until the page is ready
And I press "Save changes"
And I wait until the page is ready
And I should see "The changes to the grade and feedback were saved"
@javascript
Scenario: Submit a PDF file as a student in a team and annotate the PDF as a teacher
Given ghostscript is installed
And the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
| student3 | Student | 3 | student3@example.com |
| student4 | Student | 4 | student4@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
| student4 | C1 | student |
And the following "groups" exist:
| name | course | idnumber |
| G1 | C1 | G1 |
| G2 | C1 | G2 |
And the following "groupings" exist:
| name | course | idnumber |
| G1 | C1 | G1 |
And the following "group members" exist:
| user | group |
| student1 | G1 |
| student2 | G1 |
| student3 | G2 |
| student4 | G2 |
And the following "grouping groups" exist:
| grouping | group |
| G1 | G1 |
| G1 | G2 |
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Submit your PDF file |
| assignsubmission_file_enabled | 1 |
| Maximum number of uploaded files | 2 |
| Students submit in groups | Yes |
| Grouping for student groups | G1 |
And I log out
When I log in as "student1"
And I follow "Course 1"
And I follow "Test assignment name"
And I press "Add submission"
And I upload "mod/assign/feedback/editpdf/tests/fixtures/submission.pdf" file to "File submissions" filemanager
And I press "Save changes"
Then I should see "Submitted for grading"
And I should see "submission.pdf"
And I should see "Not graded"
And I log out
And I log in as "teacher1"
And I follow "Course 1"
And I follow "Test assignment name"
And I follow "View all submissions"
And I click on "Edit" "link" in the "Student 2" "table_row"
And I click on "Grade" "link" in the "Student 2" "table_row"
And I wait until the page is ready
And I click on ".linebutton" "css_element"
And I draw on the pdf
And I press "Save changes"
And I should see "The changes to the grade and feedback were saved"
And I press "Ok"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I follow "View all submissions"
And I should see "View annotated PDF..." in the "student2@example.com" "table_row"