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
5 I need to use the PDF editor
8 Scenario: Submit a PDF file as a student and annotate the PDF as a teacher
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 I log in as "admin"
22 And I navigate to "Annotate PDF" node in "Site administration > Plugins > Activity modules > Assignment > Feedback plugins"
23 And I upload "pix/help.png" file to "" filemanager
24 And I upload "pix/docs.png" file to "" filemanager
25 When I press "Save changes"
26 Then I should see "Changes saved"
27 And I follow "Test ghostscript path"
28 And I should see "The ghostscript path appears to be OK"
30 And I log in as "teacher1"
31 And I follow "Course 1"
32 And I turn editing mode on
33 And I add a "Assignment" to section "1" and I fill the form with:
34 | Assignment name | Test assignment name |
35 | Description | Submit your PDF file |
36 | assignsubmission_file_enabled | 1 |
37 | Maximum number of uploaded files | 2 |
39 And I log in as "student1"
40 And I follow "Course 1"
41 And I follow "Test assignment name"
42 And I press "Add submission"
43 And I upload "mod/assign/feedback/editpdf/tests/fixtures/submission.pdf" file to "File submissions" filemanager
44 And I upload "mod/assign/feedback/editpdf/tests/fixtures/testgs.pdf" file to "File submissions" filemanager
45 And I press "Save changes"
46 And I should see "Submitted for grading"
47 And I should see "submission.pdf"
48 And I should see "Not graded"
50 And I log in as "teacher1"
51 And I follow "Course 1"
52 And I follow "Test assignment name"
53 And I follow "View/grade all submissions"
54 And I click on "Edit" "link" in the "Submitted for grading" "table_row"
55 And I click on "Grade" "link" in the "Submitted for grading" "table_row"
56 And I follow "Launch PDF editor..."
57 And I change window size to "large"
58 And I should see "Page 1 of 3"
59 And I click on ".navigate-next-button" "css_element"
60 And I should see "Page 2 of 3"
61 And I click on ".stampbutton" "css_element"
62 And I click on ".linebutton" "css_element"
63 And I click on ".commentcolourbutton" "css_element"
64 And I click on "//img[@alt=\"Blue\"]/parent::button" "xpath_element"
65 And I change window size to "medium"
66 And I wait until the page is ready
67 And I click on "Close" "button"
68 And I press "Save changes"
69 And I should see "The grade changes were saved"
72 Scenario: Submit a PDF file as a student in a team and annotate the PDF as a teacher
73 Given ghostscript is installed
74 And the following "courses" exist:
75 | fullname | shortname | category | groupmode |
76 | Course 1 | C1 | 0 | 1 |
77 And the following "users" exist:
78 | username | firstname | lastname | email |
79 | teacher1 | Teacher | 1 | teacher1@example.com |
80 | student1 | Student | 1 | student1@example.com |
81 | student2 | Student | 2 | student2@example.com |
82 | student3 | Student | 3 | student3@example.com |
83 | student4 | Student | 4 | student4@example.com |
84 And the following "course enrolments" exist:
85 | user | course | role |
86 | teacher1 | C1 | editingteacher |
87 | student1 | C1 | student |
88 | student2 | C1 | student |
89 | student3 | C1 | student |
90 | student4 | C1 | student |
91 And the following "groups" exist:
92 | name | course | idnumber |
95 And the following "groupings" exist:
96 | name | course | idnumber |
98 And the following "group members" exist:
104 And the following "grouping groups" exist:
108 And I log in as "teacher1"
109 And I follow "Course 1"
110 And I turn editing mode on
111 And I add a "Assignment" to section "1" and I fill the form with:
112 | Assignment name | Test assignment name |
113 | Description | Submit your PDF file |
114 | assignsubmission_file_enabled | 1 |
115 | Maximum number of uploaded files | 2 |
116 | Students submit in groups | Yes |
117 | Grouping for student groups | G1 |
119 When I log in as "student1"
120 And I follow "Course 1"
121 And I follow "Test assignment name"
122 And I press "Add submission"
123 And I upload "mod/assign/feedback/editpdf/tests/fixtures/submission.pdf" file to "File submissions" filemanager
124 And I press "Save changes"
125 Then I should see "Submitted for grading"
126 And I should see "submission.pdf"
127 And I should see "Not graded"
129 And I log in as "teacher1"
130 And I follow "Course 1"
131 And I follow "Test assignment name"
132 And I follow "View/grade all submissions"
133 And I click on "Edit" "link" in the "Student 2" "table_row"
134 And I click on "Grade" "link" in the "Student 2" "table_row"
135 And I follow "Launch PDF editor..."
136 And I change window size to "large"
137 And I click on ".stampbutton" "css_element"
138 And I click on ".drawingcanvas" "css_element"
139 And I change window size to "medium"
140 And I wait until the page is ready
141 And I click on "Close" "button"
142 And I press "Save changes"
143 And I should see "The grade changes were saved"
144 And I press "Continue"
145 And I should see "View annotated PDF..." in the "student2@example.com" "table_row"