1 |
efrain |
1 |
@mod @mod_choice
|
|
|
2 |
Feature: Allow choice preview
|
|
|
3 |
In order to allow students to preview options before a choice activity is opened for submission
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to enable the choice preview option
|
|
|
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 the following "activity" exists:
|
|
|
20 |
| activity | choice |
|
|
|
21 |
| course | C1 |
|
|
|
22 |
| idnumber | choice1 |
|
|
|
23 |
| name | Choice name |
|
|
|
24 |
| intro | Choice Description |
|
|
|
25 |
| section | 1 |
|
|
|
26 |
| option | Option 1, Option 2 |
|
|
|
27 |
And I log in as "teacher1"
|
|
|
28 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
29 |
|
|
|
30 |
Scenario: Enable the choice preview option and view the activity as a student before the opening time
|
|
|
31 |
And I follow "Choice name"
|
|
|
32 |
And I navigate to "Settings" in current page administration
|
|
|
33 |
And I set the following fields to these values:
|
|
|
34 |
| timeopen[enabled] | 1 |
|
|
|
35 |
| timeclose[enabled] | 1 |
|
|
|
36 |
| timeopen[day] | 30 |
|
|
|
37 |
| timeopen[month] | December |
|
|
|
38 |
| timeopen[year] | 2037 |
|
|
|
39 |
| timeclose[day] | 31 |
|
|
|
40 |
| timeclose[month] | December |
|
|
|
41 |
| timeclose[year] | 2037 |
|
|
|
42 |
| Show preview | 1 |
|
|
|
43 |
And I press "Save and return to course"
|
|
|
44 |
And I log out
|
|
|
45 |
When I log in as "student1"
|
|
|
46 |
And I am on "Course 1" course homepage
|
|
|
47 |
And I follow "Choice name"
|
|
|
48 |
Then I should see "This is just a preview of the available options for this activity"
|
|
|
49 |
And the "choice_1" "radio" should be disabled
|
|
|
50 |
And the "choice_2" "radio" should be disabled
|
|
|
51 |
And "Save my choice" "button" should not exist
|