MDL-52954 marking guide: Wrap radio fields in a label for styling
[moodle.git] / mod / assign / feedback / editpdf / tests / behat / annotate_pdf.feature
CommitLineData
ef3bffde 1@mod @mod_assign @assignfeedback @assignfeedback_editpdf @_file_upload
9e103d6e
JM
2Feature: 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
9 Given ghostscript is installed
7019e15e 10 And the following "courses" exist:
9e103d6e
JM
11 | fullname | shortname | category | groupmode |
12 | Course 1 | C1 | 0 | 1 |
7019e15e 13 And the following "users" exist:
9e103d6e 14 | username | firstname | lastname | email |
0fe86bbd
RT
15 | teacher1 | Teacher | 1 | teacher1@example.com |
16 | student1 | Student | 1 | student1@example.com |
7019e15e 17 And the following "course enrolments" exist:
9e103d6e
JM
18 | user | course | role |
19 | teacher1 | C1 | editingteacher |
20 | student1 | C1 | student |
21 And I log in as "admin"
f84a0d49 22 And I navigate to "Annotate PDF" node in "Site administration > Plugins > Activity modules > Assignment > Feedback plugins"
9e103d6e
JM
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"
29 And I log out
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 |
38 And I log out
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"
49 And I log out
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"
e01012e9 54 And I click on "Edit" "link" in the "Submitted for grading" "table_row"
9e103d6e
JM
55 And I click on "Grade" "link" in the "Submitted for grading" "table_row"
56 And I follow "Launch PDF editor..."
f84a0d49 57 And I change window size to "large"
0d5a260e 58 And I should see "Page 1 of 3"
9e103d6e 59 And I click on ".navigate-next-button" "css_element"
0d5a260e 60 And I should see "Page 2 of 3"
9e103d6e
JM
61 And I click on ".stampbutton" "css_element"
62 And I click on ".linebutton" "css_element"
63 And I click on ".commentcolourbutton" "css_element"
380ab95f 64 And I click on "//img[@alt=\"Blue\"]/parent::button" "xpath_element"
f84a0d49
RT
65 And I change window size to "medium"
66 And I wait until the page is ready
9e103d6e
JM
67 And I click on "Close" "button"
68 And I press "Save changes"
69 And I should see "The grade changes were saved"
506df250
DW
70
71 @javascript
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 |
0fe86bbd
RT
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 |
506df250
DW
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 |
93 | G1 | C1 | G1 |
94 | G2 | C1 | G2 |
95 And the following "groupings" exist:
96 | name | course | idnumber |
97 | G1 | C1 | G1 |
98 And the following "group members" exist:
99 | user | group |
100 | student1 | G1 |
101 | student2 | G1 |
102 | student3 | G2 |
103 | student4 | G2 |
104 And the following "grouping groups" exist:
105 | grouping | group |
106 | G1 | G1 |
107 | G1 | G2 |
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 |
118 And I log out
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"
128 And I log out
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"
e01012e9 133 And I click on "Edit" "link" in the "Student 2" "table_row"
506df250
DW
134 And I click on "Grade" "link" in the "Student 2" "table_row"
135 And I follow "Launch PDF editor..."
e9671116 136 And I change window size to "large"
47ff1cd9
FM
137 And I click on ".stampbutton" "css_element"
138 And I click on ".drawingcanvas" "css_element"
f84a0d49
RT
139 And I change window size to "medium"
140 And I wait until the page is ready
506df250
DW
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"
2a03c5fe 145 And I should see "View annotated PDF..." in the "student2@example.com" "table_row"