1 |
efrain |
1 |
@tool @tool_courserating @javascript
|
|
|
2 |
Feature: Viewing and managing course ratings as a teacher and manager
|
|
|
3 |
|
|
|
4 |
Background:
|
|
|
5 |
Given the following "courses" exist:
|
|
|
6 |
| fullname | shortname | numsections |
|
|
|
7 |
| Course 1 | C1 | 1 |
|
|
|
8 |
| Course 2 | C2 | 1 |
|
|
|
9 |
| Course 3 | C3 | 1 |
|
|
|
10 |
Given the following "users" exist:
|
|
|
11 |
| username | firstname | lastname | email |
|
|
|
12 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
13 |
| student1 | Student | 1 | student1@example.com |
|
|
|
14 |
| student2 | Student | 2 | student2@example.com |
|
|
|
15 |
| student3 | Student | 3 | student3@example.com |
|
|
|
16 |
| manager1 | Manager | 1 | manager1@example.com |
|
|
|
17 |
And the following "course enrolments" exist:
|
|
|
18 |
| user | course | role |
|
|
|
19 |
| student1 | C1 | student |
|
|
|
20 |
| student2 | C1 | student |
|
|
|
21 |
| student3 | C1 | student |
|
|
|
22 |
| teacher1 | C1 | editingteacher |
|
|
|
23 |
And the following "tool_courserating > ratings" exist:
|
|
|
24 |
| user | course | rating | review |
|
|
|
25 |
| student1 | C1 | 3 | abcdef |
|
|
|
26 |
| student2 | C1 | 4 | hello |
|
|
|
27 |
| student3 | C1 | 1 | |
|
|
|
28 |
And the following "role assigns" exist:
|
|
|
29 |
| user | role | contextlevel | reference |
|
|
|
30 |
| manager1 | manager | System | |
|
|
|
31 |
|
|
|
32 |
Scenario: Removing reviews as manager through reviews popup
|
|
|
33 |
When I log in as "manager1"
|
|
|
34 |
And I am on "Course 1" course homepage
|
|
|
35 |
And I click on "2.7" "text" in the "#page-header .tool_courserating-ratings" "css_element"
|
|
|
36 |
And I should see "abcdef" in the "Student 1" "tool_courserating > Review"
|
|
|
37 |
And I click on "Flag" "link" in the "Student 1" "tool_courserating > Review"
|
|
|
38 |
And I should see "You have flagged this review as inappropriate/offensive." in the "Student 1" "tool_courserating > Review"
|
|
|
39 |
And I should see "1 user(s) have flagged this review as inappropriate/offensive."
|
|
|
40 |
And I should see "Permanently delete"
|
|
|
41 |
And I click on "Close" "button" in the ".modal-dialog" "css_element"
|
|
|
42 |
And I click on "2.7" "text" in the "#page-header .tool_courserating-ratings" "css_element"
|
|
|
43 |
And I click on "Permanently delete" "link" in the "Student 1" "tool_courserating > Review"
|
|
|
44 |
And I set the field "Reason for deletion" to "go away"
|
|
|
45 |
And I press "Save changes"
|
|
|
46 |
And I should see "hello" in the "Student 2" "tool_courserating > Review"
|
|
|
47 |
And I should not see "Student 1"
|
|
|
48 |
And I should not see "2.7"
|
|
|
49 |
And I should see "2.5" in the "[data-purpose='average-rating']" "css_element"
|
|
|
50 |
And I click on "Close" "button" in the ".modal-dialog" "css_element"
|
|
|
51 |
And I should not see "2.7"
|
|
|
52 |
And I should see "2.5" in the "#page-header" "css_element"
|
|
|
53 |
|
|
|
54 |
Scenario: Removing reviews as manager through the course report
|
|
|
55 |
When I log in as "manager1"
|
|
|
56 |
And I am on "Course 1" course homepage
|
|
|
57 |
And I navigate to "Course ratings" in current page administration
|
|
|
58 |
And I click on "Permanently delete" "link" in the "Student 3" "table_row"
|
|
|
59 |
And I set the field "Reason for deletion" to "go away"
|
|
|
60 |
And I press "Save changes"
|
|
|
61 |
And I should see "Rating deleted" in the "Student 3" "table_row"
|
|
|
62 |
And I am on "Course 1" course homepage
|
|
|
63 |
And I navigate to "Course ratings" in current page administration
|
|
|
64 |
And I should see "Student 1"
|
|
|
65 |
And I should not see "Student 3"
|
|
|
66 |
|
|
|
67 |
Scenario: Viewing reviews as teacher through the course report
|
|
|
68 |
When I log in as "teacher1"
|
|
|
69 |
And I am on "Course 1" course homepage
|
|
|
70 |
And I navigate to "Course ratings" in current page administration
|
|
|
71 |
And I should see "abcdef" in the "Student 1" "table_row"
|
|
|
72 |
And I should see "hello" in the "Student 2" "table_row"
|
|
|
73 |
And I should not see "Permanently delete"
|
|
|
74 |
|
|
|
75 |
Scenario: Creating course rating report in report builder
|
|
|
76 |
Given reportbuilder is available for tool_courserating
|
|
|
77 |
Given I log in as "admin"
|
|
|
78 |
And I change window size to "large"
|
|
|
79 |
When I navigate to "Reports > Report builder > Custom reports" in site administration
|
|
|
80 |
And I click on "New report" "button"
|
|
|
81 |
And I set the following fields in the "New report" "dialogue" to these values:
|
|
|
82 |
| Name | My report |
|
|
|
83 |
| Report source | Course ratings |
|
|
|
84 |
| Include default setup | 1 |
|
|
|
85 |
And I click on "Save" "button" in the "New report" "dialogue"
|
|
|
86 |
And I click on "Switch to preview mode" "button"
|
|
|
87 |
Then I should see "My report"
|
|
|
88 |
And the following should exist in the "reportbuilder-table" table:
|
|
|
89 |
| Course full name with link | Course rating |
|
|
|
90 |
| Course 1 | 2.7 |
|
|
|
91 |
|
|
|
92 |
Scenario: Deleting ratings from the custom report in report builder
|
|
|
93 |
Given reportbuilder is available for tool_courserating
|
|
|
94 |
Given I log in as "admin"
|
|
|
95 |
When I navigate to "Reports > Report builder > Custom reports" in site administration
|
|
|
96 |
And I click on "New report" "button"
|
|
|
97 |
And I set the following fields in the "New report" "dialogue" to these values:
|
|
|
98 |
| Name | My report |
|
|
|
99 |
| Report source | Course ratings |
|
|
|
100 |
| Include default setup | 0 |
|
|
|
101 |
And I click on "Save" "button" in the "New report" "dialogue"
|
|
|
102 |
And I click on "Add column 'Course full name with link'" "link"
|
|
|
103 |
And I click on "Add column 'Full name with link'" "link"
|
|
|
104 |
And I click on "Add column 'Review'" "link"
|
|
|
105 |
And I click on "Add column 'Actions'" "link"
|
|
|
106 |
And I click on "Switch to preview mode" "button"
|
|
|
107 |
And I click on "Permanently delete" "link" in the "Student 3" "table_row"
|
|
|
108 |
And I set the field "Reason for deletion" to "go away"
|
|
|
109 |
And I press "Save changes"
|
|
|
110 |
And I should see "Rating deleted" in the "Student 3" "table_row"
|
|
|
111 |
And I press "Switch to edit mode"
|
|
|
112 |
And I click on "Switch to preview mode" "button"
|
|
|
113 |
And I should see "Student 1"
|
|
|
114 |
And I should not see "Student 3"
|