1 |
efrain |
1 |
@mod @mod_choice
|
|
|
2 |
Feature: Restrict availability of the choice module to a deadline
|
|
|
3 |
In order to limit the time a student can mace a selection
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to restrict answering to within a time period
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname | category |
|
|
|
14 |
| Course 1 | C1 | 0 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
And I log in as "teacher1"
|
|
|
20 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
21 |
|
|
|
22 |
Scenario: Enable the choice activity with a start deadline in the future
|
|
|
23 |
Given the following "activities" exist:
|
|
|
24 |
| activity | name | intro | course | idnumber | option | section |
|
|
|
25 |
| choice | Choice name | Choice Description | C1 | choice1 | Option 1, Option 2 | 1 |
|
|
|
26 |
And I am on "Course 1" course homepage
|
|
|
27 |
And I follow "Choice name"
|
|
|
28 |
And I navigate to "Settings" in current page administration
|
|
|
29 |
And I set the following fields to these values:
|
|
|
30 |
| timeopen[enabled] | 1 |
|
|
|
31 |
| timeopen[day] | 30 |
|
|
|
32 |
| timeopen[month] | December |
|
|
|
33 |
| timeopen[year] | 2037 |
|
|
|
34 |
And I press "Save and return to course"
|
|
|
35 |
And I log out
|
|
|
36 |
When I log in as "student1"
|
|
|
37 |
And I am on "Course 1" course homepage
|
|
|
38 |
And I follow "Choice name"
|
|
|
39 |
Then "choice_1" "radio" should not exist
|
|
|
40 |
And "choice_2" "radio" should not exist
|
|
|
41 |
And "Save my choice" "button" should not exist
|
|
|
42 |
|
|
|
43 |
Scenario: Enable the choice activity with a start deadline in the past
|
|
|
44 |
Given the following "activities" exist:
|
|
|
45 |
| activity | name | intro | course | idnumber | option | section |
|
|
|
46 |
| choice | Choice name | Choice Description | C1 | choice1 | Option 1, Option 2 | 1 |
|
|
|
47 |
And I am on "Course 1" course homepage
|
|
|
48 |
And I follow "Choice name"
|
|
|
49 |
And I navigate to "Settings" in current page administration
|
|
|
50 |
And I set the following fields to these values:
|
|
|
51 |
| timeopen[enabled] | 1 |
|
|
|
52 |
| timeopen[day] | 30 |
|
|
|
53 |
| timeopen[month] | December |
|
|
|
54 |
| timeopen[year] | 2007 |
|
|
|
55 |
And I press "Save and return to course"
|
|
|
56 |
And I log out
|
|
|
57 |
When I log in as "student1"
|
|
|
58 |
And I am on "Course 1" course homepage
|
|
|
59 |
And I follow "Choice name"
|
|
|
60 |
And "choice_1" "radio" should exist
|
|
|
61 |
And "choice_2" "radio" should exist
|
|
|
62 |
And "Save my choice" "button" should exist
|
|
|
63 |
|
|
|
64 |
Scenario: Enable the choice activity with a end deadline in the future
|
|
|
65 |
Given the following "activities" exist:
|
|
|
66 |
| activity | name | intro | course | idnumber | option | section |
|
|
|
67 |
| choice | Choice name | Choice Description | C1 | choice1 | Option 1, Option 2 | 1 |
|
|
|
68 |
And I am on "Course 1" course homepage
|
|
|
69 |
And I follow "Choice name"
|
|
|
70 |
And I navigate to "Settings" in current page administration
|
|
|
71 |
And I set the following fields to these values:
|
|
|
72 |
| timeclose[enabled] | 1 |
|
|
|
73 |
| timeclose[day] | 30 |
|
|
|
74 |
| timeclose[month] | December |
|
|
|
75 |
| timeclose[year] | 2037 |
|
|
|
76 |
And I press "Save and return to course"
|
|
|
77 |
And I log out
|
|
|
78 |
When I log in as "student1"
|
|
|
79 |
And I am on "Course 1" course homepage
|
|
|
80 |
And I follow "Choice name"
|
|
|
81 |
And "choice_1" "radio" should exist
|
|
|
82 |
And "choice_2" "radio" should exist
|
|
|
83 |
And "Save my choice" "button" should exist
|
|
|
84 |
|
|
|
85 |
Scenario: Enable the choice activity with a end deadline in the past
|
|
|
86 |
Given the following "activities" exist:
|
|
|
87 |
| activity | name | intro | course | idnumber | option | section |
|
|
|
88 |
| choice | Choice name | Choice Description | C1 | choice1 | Option 1, Option 2 | 1 |
|
|
|
89 |
And I am on "Course 1" course homepage
|
|
|
90 |
And I follow "Choice name"
|
|
|
91 |
And I navigate to "Settings" in current page administration
|
|
|
92 |
And I set the following fields to these values:
|
|
|
93 |
| timeclose[enabled] | 1 |
|
|
|
94 |
| timeclose[day] | 30 |
|
|
|
95 |
| timeclose[month] | December |
|
|
|
96 |
| timeclose[year] | 2007 |
|
|
|
97 |
And I press "Save and return to course"
|
|
|
98 |
And I log out
|
|
|
99 |
When I log in as "student1"
|
|
|
100 |
And I am on "Course 1" course homepage
|
|
|
101 |
And I follow "Choice name"
|
|
|
102 |
Then "choice_1" "radio" should not exist
|
|
|
103 |
And "choice_2" "radio" should not exist
|
|
|
104 |
And "Save my choice" "button" should not exist
|