-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassignment_drafts.feature
149 lines (146 loc) · 7.11 KB
/
assignment_drafts.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
142
143
144
145
146
147
148
149
@plugin @plagiarism @plagiarism_turnitinsim @plagiarism_turnitinsim_assignment @plagiarism_turnitinsim_assignment_drafts
Feature: Plagiarism plugin works with a Moodle Assignment
In order to allow students to send assignment submissions to Turnitin
As a user
I need to create an assignment with the plugin enabled and the assignment to launch successfully.
Background: Set up the users, course and assignment with plugin enabled
Given the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And I create a unique moodle user with username "student1"
And I create a unique moodle user with username "student2"
And I create a unique moodle user with username "instructor1"
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student2 | C1 | student |
| instructor1 | C1 | editingteacher |
# Enable and configure plugin.
When I log in as "admin"
And I navigate to "Advanced features" in site administration
And I set the field "Enable plagiarism plugins" to "1"
And I press "Save changes"
And I navigate to "Plugins > Plagiarism > Turnitin Integrity plugin" in site administration
And I configure Turnitin Integrity credentials
And I set the following fields to these values:
| Enable Turnitin Integrity for Assign | 1 |
And I press "Save changes"
# Create Assignment.
And I am on "Course 1" course homepage with editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| submissiondrafts | 1 |
| turnitinenabled | 1 |
| accessoptions[accessstudents] | 1 |
| queuedrafts | 1 |
And I follow "Test assignment name"
Then I should see "Grading summary"
@javascript @_file_upload
Scenario: A student can submit a draft and it is sent to Turnitin.
Given I log out
# Student submits.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I press "Add submission"
And I click on "#turnitinsim_eula_accept" "css_element"
And I upload "plagiarism/turnitinsim/tests/fixtures/testfile.txt" file to "File submissions" filemanager
And I press "Save changes"
Then I should see "Not graded"
And I should see "Queued"
And I log out
# Admin runs scheduled task to send submission to Turnitin.
And I log in as "admin"
And I run the scheduled task "plagiarism_turnitinsim\task\send_submissions"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
When I navigate to "View all submissions" in current page administration
Then "student1 student1" row "File submissions" column of "generaltable" table should contain "Pending"
# Student can see post has been sent to Turnitin.
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
Then I should see "Pending"
And I log out
# Admin runs scheduled task to request an originality report.
And I log in as "admin"
And I wait "10" seconds
And I run the scheduled task "plagiarism_turnitinsim\task\get_reports"
# Admin runs scheduled task to request originality report score.
And I wait "20" seconds
And I run the scheduled task "plagiarism_turnitinsim\task\get_reports"
And I wait "30" seconds
And I run the scheduled task "plagiarism_turnitinsim\task\get_reports"
And I log out
# Open the Cloud Viewer as instructor1.
And I log in as "instructor1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
When I navigate to "View all submissions" in current page administration
Then "student1 student1" row "File submissions" column of "generaltable" table should contain "%"
And I click on ".turnitinsim_or_score" "css_element"
And I switch to viewer window
And I click on "Accept" "button"
Then I should see "testfile.txt"
And I should see "student1 student1"
@javascript @_file_upload
Scenario: A student can submit a draft and it is not sent to Turnitin until it is submitted.
Given I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| queuedrafts | 0 |
And I press "Save and display"
Given I log out
# Student submits.
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I press "Add submission"
And I click on "#turnitinsim_eula_accept" "css_element"
And I upload "plagiarism/turnitinsim/tests/fixtures/testfile.txt" file to "File submissions" filemanager
And I press "Save changes"
Then I should see "Not graded"
And I log out
# Admin runs scheduled task to send submission to Turnitin.
And I log in as "admin"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
When I navigate to "View all submissions" in current page administration
Then "student2 student2" row "File submissions" column of "generaltable" table should not contain "Queued"
And I run the scheduled task "plagiarism_turnitinsim\task\send_submissions"
#Student finalises submission.
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I press "Submit assignment"
And I press "Continue"
Then I should see "Queued"
# Admin runs scheduled task to send submission to Turnitin.
And I log out
And I log in as "admin"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
When I navigate to "View all submissions" in current page administration
Then "student2 student2" row "File submissions" column of "generaltable" table should contain "Queued"
And I run the scheduled task "plagiarism_turnitinsim\task\send_submissions"
# Admin runs scheduled task to request an originality report.
And I wait "10" seconds
And I run the scheduled task "plagiarism_turnitinsim\task\get_reports"
# Admin runs scheduled task to request originality report score.
And I wait "30" seconds
And I run the scheduled task "plagiarism_turnitinsim\task\get_reports"
And I wait "30" seconds
And I run the scheduled task "plagiarism_turnitinsim\task\get_reports"
And I log out
# Open the Cloud Viewer as instructor1.
And I log in as "instructor1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
When I navigate to "View all submissions" in current page administration
Then "student2 student2" row "File submissions" column of "generaltable" table should contain "%"
And I click on ".turnitinsim_or_score" "css_element"
And I switch to viewer window
And I click on "Accept" "button"
Then I should see "testfile.txt"
And I should see "student2 student2"