1 |
efrain |
1 |
@mod @mod_forum @forumreport @forumreport_summary
|
|
|
2 |
Feature: Include private replies in the summary report
|
|
|
3 |
In order to generate accurate reports based on what is visible
|
|
|
4 |
As a teacher
|
|
|
5 |
I should have private replies being counted as well
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| teacher2 | Teacher | 2 | teacher2@example.com |
|
|
|
12 |
| student1 | Student | 1 | student1@example.com |
|
|
|
13 |
| student2 | Student | 2 | student1@example.com |
|
|
|
14 |
And the following "courses" exist:
|
|
|
15 |
| fullname | shortname |
|
|
|
16 |
| Course 1 | C1 |
|
|
|
17 |
And the following "course enrolments" exist:
|
|
|
18 |
| user | course | role |
|
|
|
19 |
| teacher1 | C1 | editingteacher |
|
|
|
20 |
| teacher2 | C1 | editingteacher |
|
|
|
21 |
| student1 | C1 | student |
|
|
|
22 |
| student2 | C1 | student |
|
|
|
23 |
And the following "activities" exist:
|
|
|
24 |
| activity | name | course | idnumber |
|
|
|
25 |
| forum | forum1 | C1 | forum1 |
|
|
|
26 |
And the following "mod_forum > discussions" exist:
|
|
|
27 |
| user | forum | name | message |
|
|
|
28 |
| teacher1 | forum1 | discussion1 | t1 earliest |
|
|
|
29 |
| teacher1 | forum1 | discussion2 | t1 between |
|
|
|
30 |
| teacher1 | forum1 | discussion3 | s1 latest |
|
|
|
31 |
And the following "mod_forum > posts" exist:
|
|
|
32 |
| user | parentsubject | subject | message | privatereplyto |
|
|
|
33 |
| teacher1 | discussion1 | t1 between | t1 between | |
|
|
|
34 |
| teacher1 | discussion2 | t1 latest | t1 latest | |
|
|
|
35 |
| student1 | discussion1 | s1 earliest | s1 earliest | |
|
|
|
36 |
| teacher1 | s1 earliest | This is a private reply | This is a private reply | 1 |
|
|
|
37 |
|
|
|
38 |
Scenario: Private replies are counted for Teacher
|
|
|
39 |
When I am on the forum1 "forum activity" page logged in as teacher2
|
|
|
40 |
And I navigate to "Reports" in current page administration
|
|
|
41 |
Then "Teacher 1" row "Number of replies posted" column of "forumreport_summary_table" table should contain "3"
|
|
|
42 |
|
|
|
43 |
Scenario: Private replies are not counted when Teacher has not capability
|
|
|
44 |
Given the following "permission overrides" exist:
|
|
|
45 |
| capability | permission | role | contextlevel | reference |
|
|
|
46 |
| mod/forum:readprivatereplies | Prevent | editingteacher | Course | C1 |
|
|
|
47 |
When I am on the forum1 "forum activity" page logged in as teacher2
|
|
|
48 |
And I navigate to "Reports" in current page administration
|
|
|
49 |
Then "Teacher 1" row "Number of replies posted" column of "forumreport_summary_table" table should contain "2"
|