[ Index ] |
PHP Cross Reference of moodle-2.8 |
[Summary view] [Print] [Text view]
1 @mod @mod_lesson 2 Feature: In a lesson activity, students can navigate through a series of pages in various ways depending upon their answers to questions 3 In order to create a lesson with conditional paths 4 As a teacher 5 I need to add pages and questions with links between them 6 7 @javascript 8 Scenario: Student navigation with pages and questions 9 Given the following "users" exist: 10 | username | firstname | lastname | email | 11 | teacher1 | Teacher | 1 | [email protected] | 12 | student1 | Student | 1 | [email protected] | 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 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 name | 25 | Description | Test lesson description | 26 And I follow "Test lesson name" 27 And I follow "Add a content page" 28 And I set the following fields to these values: 29 | Page title | First page name | 30 | Page contents | First page contents | 31 | id_answer_editor_0 | Next page | 32 | id_jumpto_0 | Next page | 33 And I press "Save page" 34 And I set the field "qtype" to "Add a content page" 35 And I set the following fields to these values: 36 | Page title | Second page name | 37 | Page contents | Second page contents | 38 | id_answer_editor_0 | Previous page | 39 | id_jumpto_0 | Previous page | 40 | id_answer_editor_1 | Next page | 41 | id_jumpto_1 | Next page | 42 And I press "Save page" 43 And I follow "Expanded" 44 And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][3]" "xpath_element" 45 And I set the field "Select a question type" to "Numerical" 46 And I press "Add a question page" 47 And I set the following fields to these values: 48 | Page title | Hardest question ever | 49 | Page contents | 1 + 1? | 50 | id_answer_editor_0 | 2 | 51 | id_response_editor_0 | Correct answer | 52 | id_jumpto_0 | End of lesson | 53 | id_score_0 | 1 | 54 | id_answer_editor_1 | 1 | 55 | id_response_editor_1 | Incorrect answer | 56 | id_jumpto_1 | Second page name | 57 | id_score_1 | 0 | 58 And I press "Save page" 59 And I log out 60 And I log in as "student1" 61 And I follow "Course 1" 62 When I follow "Test lesson name" 63 Then I should see "First page contents" 64 And I press "Next page" 65 And I should see "Second page contents" 66 And I should not see "First page contents" 67 And I press "Previous page" 68 And I should see "First page contents" 69 And I should not see "Second page contents" 70 And I press "Next page" 71 And I should see "Second page contents" 72 And I press "Next page" 73 And I should see "1 + 1?" 74 And I set the following fields to these values: 75 | Your answer | 1 | 76 And I press "Submit" 77 And I should see "Incorrect answer" 78 And I press "Continue" 79 And I should see "Second page name" 80 And I press "Next page" 81 And I should see "1 + 1?" 82 And I set the following fields to these values: 83 | Your answer | 2 | 84 And I press "Submit" 85 And I should see "Correct answer" 86 And I should not see "Incorrect answer" 87 And I press "Continue" 88 And I should see "Congratulations - end of lesson reached" 89 And I should see "Your score is 0 (out of 1)."
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:29:05 2014 | Cross-referenced by PHPXref 0.7.1 |