2 Feature: In an assignment, students can comment in their submissions
3 In order to refine assignment submissions
5 I need to add comments about submissions
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 And the following "course enrolments" exist:
16 | user | course | role |
17 | teacher1 | C1 | editingteacher |
18 | student1 | C1 | student |
21 Scenario: Student comments an assignment submission
22 Given the following "activities" exist:
23 | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled |
24 | assign | C1 | assign1 | Test assignment name | Test assignment description | 1 |
25 And I log in as "student1"
26 And I follow "Course 1"
27 And I follow "Test assignment name"
28 When I press "Add submission"
29 And I set the following fields to these values:
30 | Online text | I'm the student submission |
31 And I press "Save changes"
32 And I click on ".comment-link" "css_element"
33 And I set the field "content" to "First student comment"
34 And I follow "Save comment"
35 Then I should see "First student comment"
36 And the field "content" matches value "Add a comment..."
37 And I follow "Delete this comment"
38 # Wait for the animation to finish.
39 And I wait "2" seconds
40 And I set the field "content" to "Second student comment"
41 And I follow "Save comment"
42 And I should see "Second student comment"
43 And I should not see "First student comment"
44 And I follow "Test assignment name"
45 And I click on ".comment-link" "css_element"
46 And I should see "Second student comment"
47 And I should not see "First student comment"
50 Scenario: Teacher can comment on an offline assignment
51 Given the following "activities" exist:
52 | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | assignmentsubmission_file_enabled | assignfeedback_comments_enabled |
53 | assign | C1 | assign1 | Test assignment name | Test assignment description | 0 | 0 | 1 |
54 And I log in as "teacher1"
55 And I follow "Course 1"
56 And I follow "Test assignment name"
57 And I follow "View/grade all submissions"
58 And I click on "Grade Student 1" "link" in the "Student 1" "table_row"
59 When I set the following fields to these values:
60 | Grade out of 100 | 50 |
61 | Feedback comments | I'm the teacher feedback |
62 And I press "Save changes"
63 And I press "Continue"
64 Then I should see "50.00" in the "Student 1" "table_row"
65 And I should see "I'm the teacher feedback" in the "Student 1" "table_row"
67 Scenario: Teacher can comment on assignments with a zero grade
68 Given the following "activities" exist:
69 | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | assignmentsubmission_file_enabled | assignfeedback_comments_enabled |
70 | assign | C1 | assign1 | Test assignment name | Test assignment description | 0 | 0 | 1 |
71 And I log in as "teacher1"
72 And I follow "Course 1"
73 And I follow "Test assignment name"
74 And I follow "View/grade all submissions"
75 And I click on "Grade Student 1" "link" in the "Student 1" "table_row"
76 And I set the following fields to these values:
77 | Grade out of 100 | 0 |
78 And I press "Save changes"
79 And I should see "The grade changes were saved"
80 And I press "Continue"
81 When I click on "Grade Student 1" "link" in the "Student 1" "table_row"
82 And I set the following fields to these values:
83 | Feedback comments | I'm the teacher feedback |
84 And I press "Save changes"
85 Then I should see "The grade changes were saved"