1 |
efrain |
1 |
@core @core_analytics @javascript
|
|
|
2 |
Feature: Manage analytics models
|
|
|
3 |
In order to manage analytics models
|
|
|
4 |
As a manager
|
|
|
5 |
I need to create and use a model
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
# Turn off the course welcome message, so we can easily test other messages.
|
|
|
9 |
Given the following config values are set as admin:
|
|
|
10 |
| onlycli | 0 | analytics |
|
|
|
11 |
| sendcoursewelcomemessage | 0 | enrol_manual |
|
|
|
12 |
And the following "users" exist:
|
|
|
13 |
| username | firstname | lastname | email |
|
|
|
14 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
15 |
| manager1 | Manager | 1 | manager1@example.com |
|
|
|
16 |
| student0 | Student | 0 | student0@example.com |
|
|
|
17 |
| student1 | Student | 1 | student1@example.com |
|
|
|
18 |
| student2 | Student | 2 | student2@example.com |
|
|
|
19 |
| student3 | Student | 3 | student3@example.com |
|
|
|
20 |
| student4 | Student | 4 | student4@example.com |
|
|
|
21 |
| student5 | Student | 5 | student5@example.com |
|
|
|
22 |
| student6 | Student | 6 | student6@example.com |
|
|
|
23 |
And the following "system role assigns" exist:
|
|
|
24 |
| user | course | role |
|
|
|
25 |
| manager1 | Acceptance test site | manager |
|
|
|
26 |
And the following "courses" exist:
|
|
|
27 |
| fullname | shortname | category | enddate | startdate | enablecompletion |
|
|
|
28 |
| Course 1 | C1 | 0 | ## yesterday ## | ## 2 days ago ## | 1 |
|
|
|
29 |
| Course 2 | C2 | 0 | ## yesterday ## | ## 2 days ago ## | 1 |
|
|
|
30 |
| Course 3 | C3 | 0 | ## tomorrow ## | ## 2 days ago ## | 1 |
|
|
|
31 |
And the following "course enrolments" exist:
|
|
|
32 |
| user | course | role | timeend | timestart |
|
|
|
33 |
| teacher1 | C1 | editingteacher | ## 1 day ago ## | ## 2 days ago ## |
|
|
|
34 |
| student0 | C1 | student | ## 1 day ago ## | ## 2 days ago ## |
|
|
|
35 |
| student1 | C1 | student | ## 1 day ago ## | ## 2 days ago ## |
|
|
|
36 |
| student2 | C1 | student | ## 1 day ago ## | ## 2 days ago ## |
|
|
|
37 |
| teacher1 | C2 | editingteacher | ## 1 day ago ## | ## 2 days ago ## |
|
|
|
38 |
| student3 | C2 | student | ## 1 day ago ## | ## 2 days ago ## |
|
|
|
39 |
| student4 | C2 | student | ## 1 day ago ## | ## 2 days ago ## |
|
|
|
40 |
| teacher1 | C3 | editingteacher | 0 | ## 2 days ago ## |
|
|
|
41 |
| manager1 | C3 | manager | 0 | ## 2 days ago ## |
|
|
|
42 |
| student5 | C3 | student | 0 | ## 2 days ago ## |
|
|
|
43 |
| student6 | C3 | student | 0 | ## 2 days ago ## |
|
|
|
44 |
And the following "activities" exist:
|
|
|
45 |
| activity | name | intro | course | idnumber | section | completion | completionview |
|
|
|
46 |
| assign | assign1 | A1 desc | C1 | assign1 | 0 | 2 | 1 |
|
|
|
47 |
| assign | assign2 | A2 desc | C2 | assign2 | 0 | 2 | 1 |
|
|
|
48 |
| assign | assign3 | A3 desc | C3 | assign3 | 0 | 2 | 1 |
|
|
|
49 |
And the following "analytics model" exist:
|
|
|
50 |
| target | indicators | timesplitting | enabled |
|
|
|
51 |
| \core_course\analytics\target\course_completion | \core\analytics\indicator\any_write_action,\core\analytics\indicator\read_actions | \core\analytics\time_splitting\single_range | true |
|
|
|
52 |
And I log in as "manager1"
|
|
|
53 |
And I navigate to "Analytics > Analytics models" in site administration
|
|
|
54 |
|
|
|
55 |
Scenario: Create a model
|
|
|
56 |
When I open the action menu in ".top-nav" "css_element"
|
|
|
57 |
And I choose "Create model" in the open action menu
|
|
|
58 |
And I set the field "Enabled" to "Enable"
|
|
|
59 |
And I select "__core_course__analytics__target__course_completion" from the "target" singleselect
|
|
|
60 |
And I set the field "Indicators" to "Read actions amount, Any write action in the course"
|
|
|
61 |
And I select "__core__analytics__time_splitting__single_range" from the "timesplitting" singleselect
|
|
|
62 |
And I press "Save changes"
|
|
|
63 |
Then I should see "No predictions available yet" in the "Students at risk of not meeting the course completion conditions" "table_row"
|
|
|
64 |
|
|
|
65 |
Scenario: Evaluate a model
|
|
|
66 |
Given I am on "Course 1" course homepage
|
|
|
67 |
And I navigate to "Course completion" in current page administration
|
|
|
68 |
And I expand all fieldsets
|
|
|
69 |
And I set the following fields to these values:
|
|
|
70 |
| Assignment - assign1 | 1 |
|
|
|
71 |
And I click on "Save changes" "button"
|
|
|
72 |
And I am on "Course 2" course homepage
|
|
|
73 |
And I navigate to "Course completion" in current page administration
|
|
|
74 |
And I expand all fieldsets
|
|
|
75 |
And I set the following fields to these values:
|
|
|
76 |
| Assignment - assign2 | 1 |
|
|
|
77 |
And I click on "Save changes" "button"
|
|
|
78 |
And I am on "Course 3" course homepage
|
|
|
79 |
And I navigate to "Course completion" in current page administration
|
|
|
80 |
And I expand all fieldsets
|
|
|
81 |
And I set the following fields to these values:
|
|
|
82 |
| Assignment - assign3 | 1 |
|
|
|
83 |
And I click on "Save changes" "button"
|
|
|
84 |
And I am on site homepage
|
|
|
85 |
And I navigate to "Analytics > Analytics models" in site administration
|
|
|
86 |
And I open the action menu in "Students at risk of not meeting the course completion conditions" "table_row"
|
|
|
87 |
And I choose "Evaluate" in the open action menu
|
|
|
88 |
And I press "Evaluate"
|
|
|
89 |
And I should see "Evaluate model"
|
|
|
90 |
And I press "Continue"
|
|
|
91 |
# Evaluation log
|
|
|
92 |
And I open the action menu in "Students at risk of not meeting the course completion conditions" "table_row"
|
|
|
93 |
And I choose "Evaluation log" in the open action menu
|
|
|
94 |
And I should see "Configuration"
|
|
|
95 |
And I click on "View" "link"
|
|
|
96 |
And I should see "Log extra info"
|
|
|
97 |
And I click on "Close" "button" in the "Log extra info" "dialogue"
|
|
|
98 |
And I navigate to "Analytics > Analytics models" in site administration
|
|
|
99 |
# Execute scheduled analysis
|
|
|
100 |
And I open the action menu in "Students at risk of not meeting the course completion conditions" "table_row"
|
|
|
101 |
And I choose "Execute scheduled analysis" in the open action menu
|
|
|
102 |
And I should see "Training results"
|
|
|
103 |
And I press "Continue"
|
|
|
104 |
# Check notifications
|
|
|
105 |
Then I should see "1" in the "#nav-notification-popover-container [data-region='count-container']" "css_element"
|
|
|
106 |
And I open the notification popover
|
|
|
107 |
And I click on "View full notification" "link" in the ".popover-region-notifications" "css_element"
|
|
|
108 |
And I should see "Students at risk in Course 3 course"
|
|
|
109 |
When I am on site homepage
|
|
|
110 |
And I navigate to "Analytics > Analytics models" in site administration
|
|
|
111 |
# View predictions
|
|
|
112 |
When I select "C3" from the "contextid" singleselect
|
|
|
113 |
And I click on "View prediction details" "icon" in the "Student 6" "table_row"
|
|
|
114 |
And I should see "Prediction details"
|
|
|
115 |
And I should see "Any write action"
|
|
|
116 |
And I should see "Read actions amount"
|
|
|
117 |
And I click on "Select Student 6 for bulk action" "checkbox" in the "Student 6" "table_row"
|
|
|
118 |
And I click on "Accept" "button"
|
|
|
119 |
And I click on "Confirm" "button" in the "Accept" "dialogue"
|
|
|
120 |
And I click on "View prediction details" "icon" in the "Student 5" "table_row"
|
|
|
121 |
And I click on "Select Student 5 for bulk action" "checkbox" in the "Student 5" "table_row"
|
|
|
122 |
And I click on "Not applicable" "button"
|
|
|
123 |
And I click on "Confirm" "button" in the "Not applicable" "dialogue"
|
|
|
124 |
And I should see "No insights reported"
|
|
|
125 |
# Clear predictions
|
|
|
126 |
When I am on site homepage
|
|
|
127 |
And I navigate to "Analytics > Analytics models" in site administration
|
|
|
128 |
And I should see "No insights reported" in the "Students at risk of not meeting the course completion conditions" "table_row"
|
|
|
129 |
And I open the action menu in "Students at risk of not meeting the course completion conditions" "table_row"
|
|
|
130 |
And I choose "Clear predictions" in the open action menu
|
|
|
131 |
And I press "Clear predictions"
|
|
|
132 |
Then I should see "No predictions available yet" in the "Students at risk of not meeting the course completion conditions" "table_row"
|
|
|
133 |
|
|
|
134 |
Scenario: Edit a model
|
|
|
135 |
When I open the action menu in "Students at risk of not meeting the course completion conditions" "table_row"
|
|
|
136 |
And I choose "Edit" in the open action menu
|
|
|
137 |
And I click on "Read actions amount" "text" in the ".form-autocomplete-selection" "css_element"
|
|
|
138 |
And I press "Save changes"
|
|
|
139 |
And I should not see "Read actions amount"
|
|
|
140 |
|
|
|
141 |
Scenario: Disable a model
|
|
|
142 |
When I open the action menu in "Students at risk of not meeting the course completion conditions" "table_row"
|
|
|
143 |
And I choose "Disable" in the open action menu
|
|
|
144 |
Then I should see "Disabled model" in the "Students at risk of not meeting the course completion conditions" "table_row"
|
|
|
145 |
|
|
|
146 |
Scenario: Export model
|
|
|
147 |
When I open the action menu in "Students at risk of not meeting the course completion conditions" "table_row"
|
|
|
148 |
And I choose "Export" in the open action menu
|
|
|
149 |
And I click on "Actions" "link" in the "Students at risk of not meeting the course completion conditions" "table_row"
|
|
|
150 |
And following "Export" should download between "100" and "500" bytes
|
|
|
151 |
|
|
|
152 |
Scenario: Check invalid site elements
|
|
|
153 |
When I open the action menu in "Students at risk of not meeting the course completion conditions" "table_row"
|
|
|
154 |
And I choose "Invalid site elements" in the open action menu
|
|
|
155 |
Then I should see "Invalid analysable elements"
|
|
|
156 |
|
|
|
157 |
Scenario: Delete model
|
|
|
158 |
When I open the action menu in "Students at risk of not meeting the course completion conditions" "table_row"
|
|
|
159 |
And I choose "Delete" in the open action menu
|
|
|
160 |
And I click on "Delete" "button" in the "Delete" "dialogue"
|
|
|
161 |
Then I should not see "Students at risk of not meeting the course completion conditions"
|