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
5 I need to set a time limit
8 Scenario: Accessing as student to a lesson with time limit
9 Given the following "users" exists:
10 | username | firstname | lastname | email |
11 | teacher1 | Teacher | 1 | teacher1@asd.com |
12 | student1 | Student | 1 | student1@asd.com |
13 And the following "courses" exists:
14 | fullname | shortname | category |
16 And the following "course enrolments" exists:
17 | user | course | role |
18 | teacher1 | C1 | editingteacher |
19 | student1 | C1 | student |
20 And I log in as "teacher1"
21 And I follow "Course 1"
22 And I turn editing mode on
23 And I add a "Lesson" to section "1" and I fill the form with:
24 | Name | Test lesson |
27 And I follow "Test lesson"
28 And I follow "Add a content page"
29 And I fill the moodle form with:
30 | Page title | Lesson page name |
31 | Page contents | Single lesson page contents |
32 | Description | Single button |
33 And I press "Save page"
35 And I log in as "student1"
36 And I follow "Course 1"
37 When I follow "Test lesson"
38 Then I should see "You have 1 minute(s) to finish the lesson."
39 And I wait "3" seconds
40 And I should see "Time remaining"
41 And I press "Single button"
42 And I should see " 0:00:"
43 And I should see "Warning: You have 1 minute or less to finish the lesson."
44 And I wait "60" seconds
45 And I press "Single button"
46 And I should see "Attention: You ran out of time for this lesson. 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"