1 |
efrain |
1 |
@mod @mod_h5pactivity @core_h5p
|
|
|
2 |
Feature: Add H5P activity context locking
|
|
|
3 |
In order to let users access a H5P attempts
|
|
|
4 |
As a user
|
|
|
5 |
I need to access attempts reports even if no more users can submit attempts
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following config values are set as admin:
|
|
|
9 |
| contextlocking | 1 |
|
|
|
10 |
And 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 |
And the following "courses" exist:
|
|
|
16 |
| fullname | shortname | category |
|
|
|
17 |
| Course 1 | C1 | 0 |
|
|
|
18 |
And the following "course enrolments" exist:
|
|
|
19 |
| user | course | role |
|
|
|
20 |
| teacher1 | C1 | editingteacher |
|
|
|
21 |
| student1 | C1 | student |
|
|
|
22 |
| student2 | C1 | student |
|
|
|
23 |
# This test is only about reporting, we don't need to specify any valid H5P file for it.
|
|
|
24 |
And the following "activity" exists:
|
|
|
25 |
| activity | h5pactivity |
|
|
|
26 |
| name | H5P package |
|
|
|
27 |
| intro | Test H5P description |
|
|
|
28 |
| course | C1 |
|
|
|
29 |
| idnumber | h5ppackage |
|
|
|
30 |
And the following "mod_h5pactivity > attempt" exists:
|
|
|
31 |
| user | student1 |
|
|
|
32 |
| h5pactivity | H5P package |
|
|
|
33 |
| attempt | 1 |
|
|
|
34 |
| interactiontype | compound |
|
|
|
35 |
| rawscore | 2 |
|
|
|
36 |
| maxscore | 2 |
|
|
|
37 |
| duration | 4 |
|
|
|
38 |
| completion | 1 |
|
|
|
39 |
| success | 1 |
|
|
|
40 |
|
|
|
41 |
Scenario: Access participants report on a freeze context
|
|
|
42 |
Given the "h5ppackage" "Activity module" is context frozen
|
|
|
43 |
And I am on the "H5P package" "h5pactivity activity" page logged in as admin
|
|
|
44 |
When I navigate to "Attempts report" in current page administration
|
|
|
45 |
Then I should see "Student 1"
|
|
|
46 |
And I should see "View (1)" in the "Student 1" "table_row"
|
|
|
47 |
And I should see "Student 2"
|
|
|
48 |
And I should not see "Teacher 1"
|
|
|
49 |
|
|
|
50 |
Scenario: Access own attempts on a freeze context
|
|
|
51 |
Given the "h5ppackage" "Activity module" is context frozen
|
|
|
52 |
And I am on the "H5P package" "h5pactivity activity" page logged in as student1
|
|
|
53 |
When I navigate to "Attempts report" in current page administration
|
|
|
54 |
And I follow "View report"
|
|
|
55 |
Then I should see "Attempt #1: Student 1"
|
|
|
56 |
And I should see "This attempt is completed"
|
|
|
57 |
|
|
|
58 |
Scenario: Access participants report without any user with submit capability
|
|
|
59 |
Given the following "permission overrides" exist:
|
|
|
60 |
| capability | permission | role | contextlevel | reference |
|
|
|
61 |
| mod/h5pactivity:submit | Prohibit | student | System | |
|
|
|
62 |
And I am on the "H5P package" "h5pactivity activity" page logged in as admin
|
|
|
63 |
When I navigate to "Attempts report" in current page administration
|
|
|
64 |
Then I should see "Student 1"
|
|
|
65 |
And I should see "View (1)" in the "Student 1" "table_row"
|
|
|
66 |
And I should see "Student 2"
|
|
|
67 |
And I should not see "Teacher 1"
|
|
|
68 |
|
|
|
69 |
Scenario: Access participant report to list students with submit capability but no view one
|
|
|
70 |
Given the following "permission overrides" exist:
|
|
|
71 |
| capability | permission | role | contextlevel | reference |
|
|
|
72 |
| mod/h5pactivity:view | Prohibit | student | System | |
|
|
|
73 |
And I am on the "H5P package" "h5pactivity activity" page logged in as admin
|
|
|
74 |
When I navigate to "Attempts report" in current page administration
|
|
|
75 |
Then I should see "No participants to display"
|
|
|
76 |
|
|
|
77 |
Scenario: Access participant report but with no users with view or submit capability
|
|
|
78 |
Given the following "permission overrides" exist:
|
|
|
79 |
| capability | permission | role | contextlevel | reference |
|
|
|
80 |
| mod/h5pactivity:submit | Prohibit | student | System | |
|
|
|
81 |
| mod/h5pactivity:view | Prohibit | student | System | |
|
|
|
82 |
And I am on the "H5P package" "h5pactivity activity" page logged in as admin
|
|
|
83 |
When I navigate to "Attempts report" in current page administration
|
|
|
84 |
Then I should see "No participants to display"
|
|
|
85 |
|
|
|
86 |
Scenario: Access participant report in a hidden activity
|
|
|
87 |
Given I log in as "admin"
|
|
|
88 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
89 |
And I click on "Hide" "link" in the "H5P package" activity
|
|
|
90 |
When I am on the "H5P package" "h5pactivity activity" page
|
|
|
91 |
And I navigate to "Attempts report" in current page administration
|
|
|
92 |
Then I should see "Student 1"
|
|
|
93 |
And I should see "View (1)"
|
|
|
94 |
And I should see "Student 2"
|
|
|
95 |
And I should not see "Teacher 1"
|