1 |
efrain |
1 |
@mod @mod_assign @assignfeedback @assignfeedback_editpdf @_file_upload
|
|
|
2 |
Feature: In an assignment, teacher can annotate PDF files during grading
|
|
|
3 |
In order to provide visual report on a graded PDF
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to use the PDF editor
|
|
|
6 |
|
|
|
7 |
@javascript
|
|
|
8 |
Scenario: Submit a PDF file as a student and annotate the PDF as a teacher then overwrite the submission as a student
|
|
|
9 |
Given ghostscript is installed
|
|
|
10 |
And the following "courses" exist:
|
|
|
11 |
| fullname | shortname | category | groupmode |
|
|
|
12 |
| Course 1 | C1 | 0 | 1 |
|
|
|
13 |
And the following "users" exist:
|
|
|
14 |
| username | firstname | lastname | email |
|
|
|
15 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
16 |
| student1 | Student | 1 | student1@example.com |
|
|
|
17 |
And the following "course enrolments" exist:
|
|
|
18 |
| user | course | role |
|
|
|
19 |
| teacher1 | C1 | editingteacher |
|
|
|
20 |
| student1 | C1 | student |
|
|
|
21 |
And the following "activity" exists:
|
|
|
22 |
| activity | assign |
|
|
|
23 |
| course | C1 |
|
|
|
24 |
| name | Test assignment name |
|
|
|
25 |
| assignfeedback_editpdf_enabled | 1 |
|
|
|
26 |
| assignfeedback_comments_enabled | 1 |
|
|
|
27 |
| assignsubmission_file_enabled | 1 |
|
|
|
28 |
| assignsubmission_file_maxfiles | 2 |
|
|
|
29 |
| assignsubmission_file_maxsizebytes | 102400 |
|
|
|
30 |
| maxfilessubmission | 2 |
|
|
|
31 |
| submissiondrafts | 0 |
|
|
|
32 |
And the following "mod_assign > submission" exists:
|
|
|
33 |
| assign | Test assignment name |
|
|
|
34 |
| user | student1 |
|
|
|
35 |
| file | mod/assign/feedback/editpdf/tests/fixtures/testgs.pdf |
|
|
|
36 |
|
|
|
37 |
When I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
38 |
And I follow "View all submissions"
|
|
|
39 |
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
|
|
|
40 |
Then I should see "Page 1 of 1"
|
|
|
41 |
And I wait for the complete PDF to load
|
|
|
42 |
And I click on ".linebutton" "css_element"
|
|
|
43 |
And I draw on the pdf
|
|
|
44 |
And I press "Save changes"
|
|
|
45 |
And I should see "The changes to the grade and feedback were saved"
|
|
|
46 |
And I am on the "Test assignment name" Activity page logged in as student1
|
|
|
47 |
And I follow "View annotated PDF..."
|
|
|
48 |
Then I should see "Page 1 of 1"
|
|
|
49 |
And I click on ".closebutton" "css_element"
|
|
|
50 |
And I press "Edit submission"
|
|
|
51 |
And I upload "mod/assign/feedback/editpdf/tests/fixtures/submission.pdf" file to "File submissions" filemanager
|
|
|
52 |
And I press "Save changes"
|
|
|
53 |
And I follow "View annotated PDF..."
|
|
|
54 |
Then I should see "Page 1 of 1"
|
|
|
55 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
56 |
And I follow "View all submissions"
|
|
|
57 |
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
|
|
|
58 |
Then I should see "Page 1 of 3"
|
|
|
59 |
And I wait for the complete PDF to load
|
|
|
60 |
And I click on ".linebutton" "css_element"
|
|
|
61 |
And I draw on the pdf
|
|
|
62 |
And I press "Save changes"
|
|
|
63 |
And I should see "The changes to the grade and feedback were saved"
|
|
|
64 |
And I am on the "Test assignment name" Activity page logged in as student1
|
|
|
65 |
And I follow "View annotated PDF..."
|
|
|
66 |
Then I should see "Page 1 of 3"
|
|
|
67 |
|
|
|
68 |
@javascript
|
|
|
69 |
Scenario: Submit a PDF file as a student and annotate the PDF as a teacher
|
|
|
70 |
Given ghostscript is installed
|
|
|
71 |
And the following "courses" exist:
|
|
|
72 |
| fullname | shortname | category | groupmode |
|
|
|
73 |
| Course 1 | C1 | 0 | 1 |
|
|
|
74 |
And the following "users" exist:
|
|
|
75 |
| username | firstname | lastname | email |
|
|
|
76 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
77 |
| student1 | Student | 1 | student1@example.com |
|
|
|
78 |
And the following "course enrolments" exist:
|
|
|
79 |
| user | course | role |
|
|
|
80 |
| teacher1 | C1 | editingteacher |
|
|
|
81 |
| student1 | C1 | student |
|
|
|
82 |
And the following "activity" exists:
|
|
|
83 |
| activity | assign |
|
|
|
84 |
| course | C1 |
|
|
|
85 |
| name | Test assignment name |
|
|
|
86 |
| assignfeedback_editpdf_enabled | 1 |
|
|
|
87 |
| assignfeedback_comments_enabled | 1 |
|
|
|
88 |
| assignsubmission_file_enabled | 1 |
|
|
|
89 |
| assignsubmission_file_maxfiles | 2 |
|
|
|
90 |
| assignsubmission_file_maxsizebytes | 102400 |
|
|
|
91 |
| maxfilessubmission | 2 |
|
|
|
92 |
| submissiondrafts | 0 |
|
|
|
93 |
And the following "mod_assign > submission" exists:
|
|
|
94 |
| assign | Test assignment name |
|
|
|
95 |
| user | student1 |
|
|
|
96 |
| file | mod/assign/feedback/editpdf/tests/fixtures/submission.pdf, mod/assign/feedback/editpdf/tests/fixtures/testgs.pdf |
|
|
|
97 |
And I log in as "admin"
|
|
|
98 |
And I am on site homepage
|
|
|
99 |
And I navigate to "Plugins > Activity modules > Assignment > Feedback plugins > Annotate PDF" in site administration
|
|
|
100 |
And I upload "pix/help.png" file to "" filemanager
|
|
|
101 |
And I upload "pix/docs.png" file to "" filemanager
|
|
|
102 |
And I press "Save changes"
|
|
|
103 |
And I should see "Changes saved"
|
|
|
104 |
And I follow "Test ghostscript path"
|
|
|
105 |
And I should see "The ghostscript path appears to be OK"
|
|
|
106 |
And I am on site homepage
|
|
|
107 |
And I log out
|
|
|
108 |
|
|
|
109 |
When I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
110 |
And I follow "View all submissions"
|
|
|
111 |
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
|
|
|
112 |
Then I should see "Page 1 of 3"
|
|
|
113 |
And I click on ".navigate-next-button" "css_element"
|
|
|
114 |
And I should see "Page 2 of 3"
|
|
|
115 |
And I click on ".stampbutton" "css_element"
|
|
|
116 |
And I click on ".linebutton" "css_element"
|
|
|
117 |
And I click on ".commentcolourbutton" "css_element"
|
|
|
118 |
And I click on "//img[@alt=\"Blue\"]/parent::button" "xpath_element"
|
|
|
119 |
And I wait until the page is ready
|
|
|
120 |
And I press "Save changes"
|
|
|
121 |
And I wait until the page is ready
|
|
|
122 |
And I should see "The changes to the grade and feedback were saved"
|
|
|
123 |
|
|
|
124 |
@javascript
|
|
|
125 |
Scenario: Submit a PDF file as a student in a team and annotate the PDF as a teacher
|
|
|
126 |
Given ghostscript is installed
|
|
|
127 |
And the following "courses" exist:
|
|
|
128 |
| fullname | shortname | category | groupmode |
|
|
|
129 |
| Course 1 | C1 | 0 | 1 |
|
|
|
130 |
And the following "users" exist:
|
|
|
131 |
| username | firstname | lastname | email |
|
|
|
132 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
133 |
| student1 | Student | 1 | student1@example.com |
|
|
|
134 |
| student2 | Student | 2 | student2@example.com |
|
|
|
135 |
| student3 | Student | 3 | student3@example.com |
|
|
|
136 |
| student4 | Student | 4 | student4@example.com |
|
|
|
137 |
And the following "course enrolments" exist:
|
|
|
138 |
| user | course | role |
|
|
|
139 |
| teacher1 | C1 | editingteacher |
|
|
|
140 |
| student1 | C1 | student |
|
|
|
141 |
| student2 | C1 | student |
|
|
|
142 |
| student3 | C1 | student |
|
|
|
143 |
| student4 | C1 | student |
|
|
|
144 |
And the following "groups" exist:
|
|
|
145 |
| name | course | idnumber |
|
|
|
146 |
| G1 | C1 | G1 |
|
|
|
147 |
| G2 | C1 | G2 |
|
|
|
148 |
And the following "groupings" exist:
|
|
|
149 |
| name | course | idnumber |
|
|
|
150 |
| G1 | C1 | G1 |
|
|
|
151 |
And the following "group members" exist:
|
|
|
152 |
| user | group |
|
|
|
153 |
| student1 | G1 |
|
|
|
154 |
| student2 | G1 |
|
|
|
155 |
| student3 | G2 |
|
|
|
156 |
| student4 | G2 |
|
|
|
157 |
And the following "grouping groups" exist:
|
|
|
158 |
| grouping | group |
|
|
|
159 |
| G1 | G1 |
|
|
|
160 |
| G1 | G2 |
|
|
|
161 |
And the following "activity" exists:
|
|
|
162 |
| activity | assign |
|
|
|
163 |
| course | C1 |
|
|
|
164 |
| name | Test assignment name |
|
|
|
165 |
| assignfeedback_comments_enabled | 1 |
|
|
|
166 |
| assignfeedback_editpdf_enabled | 1 |
|
|
|
167 |
| assignsubmission_file_enabled | 1 |
|
|
|
168 |
| assignsubmission_file_maxfiles | 2 |
|
|
|
169 |
| assignsubmission_file_maxsizebytes | 102400 |
|
|
|
170 |
| maxfilessubmission | 2 |
|
|
|
171 |
| teamsubmission | 1 |
|
|
|
172 |
| grouping | G1 |
|
|
|
173 |
| submissiondrafts | 0 |
|
|
|
174 |
And the following "mod_assign > submission" exists:
|
|
|
175 |
| assign | Test assignment name |
|
|
|
176 |
| user | student1 |
|
|
|
177 |
| file | mod/assign/feedback/editpdf/tests/fixtures/submission.pdf |
|
|
|
178 |
|
|
|
179 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
180 |
And I follow "View all submissions"
|
|
|
181 |
And I open the action menu in "Student 2" "table_row"
|
|
|
182 |
And I click on "Grade" "link" in the "Student 2" "table_row"
|
|
|
183 |
And I wait for the complete PDF to load
|
|
|
184 |
And I click on ".linebutton" "css_element"
|
|
|
185 |
And I draw on the pdf
|
|
|
186 |
And I press "Save changes"
|
|
|
187 |
And I should see "The changes to the grade and feedback were saved"
|
|
|
188 |
And I follow "View all submissions"
|
|
|
189 |
And I should see "View annotated PDF..." in the "student2@example.com" "table_row"
|