1 |
efrain |
1 |
@mod @mod_assign @javascript
|
|
|
2 |
Feature: In an assignment, students can comment in their submissions
|
|
|
3 |
In order to refine assignment submissions
|
|
|
4 |
As a student
|
|
|
5 |
I need to add comments about submissions
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category | groupmode |
|
|
|
10 |
| Course 1 | C1 | 0 | 1 |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
| username | firstname | lastname | email |
|
|
|
13 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
14 |
| student1 | Student | 1 | student1@example.com |
|
|
|
15 |
| student2 | Student | 2 | student2@example.com |
|
|
|
16 |
And the following "course enrolments" exist:
|
|
|
17 |
| user | course | role |
|
|
|
18 |
| teacher1 | C1 | editingteacher |
|
|
|
19 |
| student1 | C1 | student |
|
|
|
20 |
| student2 | C1 | student |
|
|
|
21 |
|
|
|
22 |
Scenario: Student comments an assignment submission
|
|
|
23 |
Given the following "activities" exist:
|
|
|
24 |
| activity | course | name | assignsubmission_onlinetext_enabled |
|
|
|
25 |
| assign | C1 | Test assignment name | 1 |
|
|
|
26 |
And I am on the "Test assignment name" Activity page logged in as student1
|
|
|
27 |
When I press "Add submission"
|
|
|
28 |
And I set the following fields to these values:
|
|
|
29 |
| Online text | I'm the student submission |
|
|
|
30 |
And I press "Save changes"
|
|
|
31 |
And I click on ".comment-link" "css_element"
|
|
|
32 |
And I set the field "content" to "First student comment"
|
|
|
33 |
And I follow "Save comment"
|
|
|
34 |
Then I should see "First student comment"
|
|
|
35 |
And the field "content" matches value "Add a comment..."
|
|
|
36 |
And I click on "Delete comment posted by Student 1" "link"
|
|
|
37 |
# Wait for the animation to finish.
|
|
|
38 |
And I wait "2" seconds
|
|
|
39 |
And I set the field "content" to "Second student comment"
|
|
|
40 |
And I follow "Save comment"
|
|
|
41 |
And I should see "Second student comment"
|
|
|
42 |
And I should not see "First student comment"
|
|
|
43 |
And I am on the "Test assignment name" "assign activity" page
|
|
|
44 |
And I click on ".comment-link" "css_element"
|
|
|
45 |
And I should see "Second student comment"
|
|
|
46 |
And I should not see "First student comment"
|
|
|
47 |
|
|
|
48 |
Scenario: Teacher updated the comment box and clicked the save changes to reflect the comment
|
|
|
49 |
Given the following "activities" exist:
|
|
|
50 |
| activity | course | name | assignsubmission_onlinetext_enabled |
|
|
|
51 |
| assign | C1 | Test assignment name | 1 |
|
|
|
52 |
And the following "mod_assign > submissions" exist:
|
|
|
53 |
| assign | user | onlinetext |
|
|
|
54 |
| Test assignment name | student1 | student one submission |
|
|
|
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 "Student 1" "table_row"
|
|
|
58 |
And I click on ".comment-link" "css_element"
|
|
|
59 |
When I set the field "content" to "Teacher feedback first comment"
|
|
|
60 |
And I press "Save changes"
|
|
|
61 |
And I should see "Comments (1)" in the ".comment-link" "css_element"
|
|
|
62 |
And I click on ".comment-link" "css_element"
|
|
|
63 |
Then I should see "Teacher feedback first comment" in the ".comment-list" "css_element"
|
|
|
64 |
|
|
|
65 |
Scenario: Teacher updated the comment box and clicked on save and show next to reflect the comment
|
|
|
66 |
Given the following "activities" exist:
|
|
|
67 |
| activity | course | name | assignsubmission_onlinetext_enabled |
|
|
|
68 |
| assign | C1 | Test assignment name | 1 |
|
|
|
69 |
And the following "mod_assign > submissions" exist:
|
|
|
70 |
| assign | user | onlinetext |
|
|
|
71 |
| Test assignment name | student1 | I'm the student submission |
|
|
|
72 |
|
|
|
73 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
74 |
And I follow "View all submissions"
|
|
|
75 |
And I click on "Grade" "link" in the "Student 1" "table_row"
|
|
|
76 |
And I click on ".comment-link" "css_element"
|
|
|
77 |
When I set the field "content" to "Teacher feedback first comment"
|
|
|
78 |
# click the save and show next twice as we have only 2 students
|
|
|
79 |
# so the second time you click we reach the same student who made
|
|
|
80 |
# the change
|
|
|
81 |
And I press "Save and show next"
|
|
|
82 |
And I press "Save and show next"
|
|
|
83 |
And I click on ".comment-link" "css_element"
|
|
|
84 |
Then I should see "Teacher feedback first comment" in the ".comment-list" "css_element"
|
|
|
85 |
|
|
|
86 |
Scenario: Teacher can comment on an offline assignment
|
|
|
87 |
Given the following "activities" exist:
|
|
|
88 |
| activity | course | name | assignsubmission_onlinetext_enabled | assignmentsubmission_file_enabled | assignfeedback_comments_enabled |
|
|
|
89 |
| assign | C1 | Test assignment name | 0 | 0 | 1 |
|
|
|
90 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
91 |
And I follow "View all submissions"
|
|
|
92 |
And I click on "Grade" "link" in the "Student 1" "table_row"
|
|
|
93 |
When I set the following fields to these values:
|
|
|
94 |
| Grade out of 100 | 50 |
|
|
|
95 |
| Feedback comments | I'm the teacher feedback |
|
|
|
96 |
And I press "Save changes"
|
|
|
97 |
And I follow "View all submissions"
|
|
|
98 |
Then I should see "50.00" in the "Student 1" "table_row"
|
|
|
99 |
And I should see "I'm the teacher feedback" in the "Student 1" "table_row"
|
|
|
100 |
|
|
|
101 |
Scenario: Teacher can comment on assignments with a zero grade
|
|
|
102 |
Given the following "activities" exist:
|
|
|
103 |
| activity | course | name | assignsubmission_onlinetext_enabled | assignmentsubmission_file_enabled | assignfeedback_comments_enabled |
|
|
|
104 |
| assign | C1 | Test assignment name | 0 | 0 | 1 |
|
|
|
105 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
106 |
And I follow "View all submissions"
|
|
|
107 |
And I click on "Grade" "link" in the "Student 1" "table_row"
|
|
|
108 |
And I set the following fields to these values:
|
|
|
109 |
| Grade out of 100 | 0 |
|
|
|
110 |
And I press "Save changes"
|
|
|
111 |
And I should see "The changes to the grade and feedback were saved"
|
|
|
112 |
And I set the following fields to these values:
|
|
|
113 |
| Feedback comments | I'm the teacher feedback |
|
|
|
114 |
And I press "Save changes"
|
|
|
115 |
Then I should see "The changes to the grade and feedback were saved"
|