1 |
efrain |
1 |
@core @core_completion
|
|
|
2 |
Feature: Restrict activity availability through grade conditions
|
|
|
3 |
In order to control activity access through grade condition
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to set grade condition to restrict activity access
|
|
|
6 |
|
|
|
7 |
@javascript
|
|
|
8 |
Scenario: Show activity greyed-out to students when grade condition is not satisfied
|
|
|
9 |
Given the following "courses" exist:
|
|
|
10 |
| fullname | shortname | category |
|
|
|
11 |
| Course 1 | C1 | 0 |
|
|
|
12 |
And the following "users" exist:
|
|
|
13 |
| username | firstname | lastname | email |
|
|
|
14 |
| teacher1 | Teacher | First | teacher1@example.com |
|
|
|
15 |
| student1 | Student | First | student1@example.com |
|
|
|
16 |
And the following "course enrolments" exist:
|
|
|
17 |
| user | course | role |
|
|
|
18 |
| teacher1 | C1 | editingteacher |
|
|
|
19 |
| student1 | C1 | student |
|
|
|
20 |
And the following "activities" exist:
|
|
|
21 |
| course | activity | idnumber | name | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled | submissiondrafts |
|
|
|
22 |
| C1 | assign | Grade assignment | Grade assignment | 1 | 0 | 0 |
|
|
|
23 |
| C1 | page | Grade page | Test page name | | | |
|
|
|
24 |
# Adding the page like this because id_availableform_enabled needs to be clicked to trigger the action.
|
|
|
25 |
And I am on the "Test page name" "page activity editing" page logged in as "teacher1"
|
|
|
26 |
And I expand all fieldsets
|
|
|
27 |
And I click on "Add restriction..." "button"
|
|
|
28 |
And I click on "Grade" "button" in the "Add restriction..." "dialogue"
|
|
|
29 |
And I click on "min" "checkbox"
|
|
|
30 |
And I set the following fields to these values:
|
|
|
31 |
| id | Grade assignment |
|
|
|
32 |
| minval | 20 |
|
|
|
33 |
And I press "Save and return to course"
|
|
|
34 |
|
|
|
35 |
When I am on the "Course 1" course page logged in as student1
|
|
|
36 |
Then I should see "Not available unless: You achieve higher than a certain score in Grade assignment"
|
|
|
37 |
And I should see "Test page name"
|
|
|
38 |
And "Test page name" "link" should not exist in the "region-main" "region"
|
|
|
39 |
And I am on the "Grade assignment" "assign activity" page
|
|
|
40 |
And I press "Add submission"
|
|
|
41 |
And I set the following fields to these values:
|
|
|
42 |
| Online text | I'm the student submission |
|
|
|
43 |
And I press "Save changes"
|
|
|
44 |
And I should see "Submitted for grading"
|
|
|
45 |
|
|
|
46 |
And I am on the "Grade assignment" "assign activity" page logged in as teacher1
|
|
|
47 |
And I follow "View all submissions"
|
|
|
48 |
And I click on "Grade" "link" in the "Student First" "table_row"
|
|
|
49 |
And I set the following fields to these values:
|
|
|
50 |
| Grade | 21 |
|
|
|
51 |
And I press "Save changes"
|
|
|
52 |
|
|
|
53 |
And I am on the "Course 1" course page logged in as student1
|
|
|
54 |
And "Test page name" activity should be visible
|
|
|
55 |
And I should not see "Not available unless: You achieve higher than a certain score in Grade assignment"
|