1 |
efrain |
1 |
@mod @mod_lesson
|
|
|
2 |
Feature: A teacher can set a time limit for a lesson
|
|
|
3 |
In order to restrict the time students have to complete a lesson
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to set a time limit
|
|
|
6 |
|
|
|
7 |
@javascript
|
|
|
8 |
Scenario: Accessing as student to a lesson with time limit
|
|
|
9 |
Given the following "users" exist:
|
|
|
10 |
| username | firstname | lastname | email |
|
|
|
11 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
12 |
| student1 | Student | 1 | student1@example.com |
|
|
|
13 |
And the following "courses" exist:
|
|
|
14 |
| fullname | shortname | category |
|
|
|
15 |
| Course 1 | C1 | 0 |
|
|
|
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 |
| activity | course | name |
|
|
|
22 |
| lesson | C1 | Test lesson |
|
|
|
23 |
And the following "mod_lesson > page" exist:
|
|
|
24 |
| lesson | qtype | title | content |
|
|
|
25 |
| Test lesson | content | Lesson page name | Single lesson page contents |
|
|
|
26 |
And the following "mod_lesson > answer" exist:
|
|
|
27 |
| page | answer | jumpto |
|
|
|
28 |
| Lesson page name | Single button | This page |
|
|
|
29 |
And I am on the "Test lesson" "lesson activity editing" page logged in as teacher1
|
|
|
30 |
And I expand all fieldsets
|
|
|
31 |
And I set the following fields to these values:
|
|
|
32 |
| timelimit[enabled] | 1 |
|
|
|
33 |
| timelimit[timeunit] | 1 |
|
|
|
34 |
| timelimit[number] | 10 |
|
|
|
35 |
And I press "Save and display"
|
|
|
36 |
When I am on the "Test lesson" "lesson activity" page logged in as student1
|
|
|
37 |
Then I should see "You have 10 secs to finish the lesson."
|
|
|
38 |
And I wait "3" seconds
|
|
|
39 |
And I should see "Time remaining"
|
|
|
40 |
And I press "Single button"
|
|
|
41 |
And I should see "0:00:"
|
|
|
42 |
And I should see "Warning: You have 1 minute or less to finish the lesson."
|
|
|
43 |
And I wait "10" seconds
|
|
|
44 |
And I press "Single button"
|
|
|
45 |
And I should see "You ran out of time for this lesson."
|
|
|
46 |
And I should see "Your last answer may not have counted if it was answered after the time was up."
|
|
|
47 |
And I should see "Congratulations - end of lesson reached"
|
|
|
48 |
And I should not see "Single lesson page contents"
|