[ Index ] |
PHP Cross Reference of Unnamed Project |
[Summary view] [Print] [Text view]
1 @mod @mod_lesson 2 Feature: In a lesson activity, students can see questions in random order and a single question drawn from a branch 3 In order to create a lesson with a cluster and a subcluster 4 As a teacher 5 I need to add content pages and questions with cluster, branchtable and end of branchtable and end of cluster pages 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 follow "Course 1" 21 And I turn editing mode on 22 23 Scenario: Lesson with subcluster 24 Given I add a "Lesson" to section "1" and I fill the form with: 25 | Name | Lesson with subcluster | 26 | Description | Test lesson description | 27 And I follow "Lesson with subcluster" 28 And I follow "Add a content page" 29 And I set the following fields to these values: 30 | Page title | First page name | 31 | Page contents | First page contents | 32 | id_answer_editor_0 | Next page | 33 | id_jumpto_0 | Next page | 34 And I press "Save page" 35 And I follow "Expanded" 36 And I click on "Add a cluster" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][2]" "xpath_element" 37 And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][3]" "xpath_element" 38 And I set the field "Select a question type" to "Multichoice" 39 And I press "Add a question page" 40 And I set the following fields to these values: 41 | Page title | question 1 | 42 | Page contents | Question from cluster | 43 | id_answer_editor_0 | Correct answer | 44 | id_response_editor_0 | Good | 45 | id_jumpto_0 | Cluster | 46 | id_score_0 | 1 | 47 | id_answer_editor_1 | Incorrect answer | 48 | id_response_editor_1 | Bad | 49 | id_jumpto_1 | This page | 50 | id_score_1 | 0 | 51 And I press "Save page" 52 And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][4]" "xpath_element" 53 And I set the field "Select a question type" to "Multichoice" 54 And I press "Add a question page" 55 And I set the following fields to these values: 56 | Page title | question 2 | 57 | Page contents | Question from cluster | 58 | id_answer_editor_0 | Correct answer | 59 | id_response_editor_0 | Good | 60 | id_jumpto_0 | Cluster | 61 | id_score_0 | 1 | 62 | id_answer_editor_1 | Incorrect answer | 63 | id_response_editor_1 | Bad | 64 | id_jumpto_1 | This page | 65 | id_score_1 | 0 | 66 And I press "Save page" 67 And I click on "Add a content page" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][5]" "xpath_element" 68 And I set the following fields to these values: 69 | Page title | Second page name | 70 | Page contents | This page mark the the beginning of the subcluster it should not be seen by students | 71 | id_answer_editor_0 | Next page | 72 | id_jumpto_0 | Next page | 73 And I press "Save page" 74 And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][6]" "xpath_element" 75 And I set the field "Select a question type" to "Multichoice" 76 And I press "Add a question page" 77 And I set the following fields to these values: 78 | Page title | question 3 | 79 | Page contents | Question from cluster | 80 | id_answer_editor_0 | Correct answer | 81 | id_response_editor_0 | Good | 82 | id_jumpto_0 | Cluster | 83 | id_score_0 | 1 | 84 | id_answer_editor_1 | Incorrect answer | 85 | id_response_editor_1 | Bad | 86 | id_jumpto_1 | This page | 87 | id_score_1 | 0 | 88 And I press "Save page" 89 And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][7]" "xpath_element" 90 And I set the field "Select a question type" to "Multichoice" 91 And I press "Add a question page" 92 And I set the following fields to these values: 93 | Page title | question 4 | 94 | Page contents | Question from cluster | 95 | id_answer_editor_0 | Correct answer | 96 | id_response_editor_0 | Good | 97 | id_jumpto_0 | Cluster | 98 | id_score_0 | 1 | 99 | id_answer_editor_1 | Incorrect answer | 100 | id_response_editor_1 | Bad | 101 | id_jumpto_1 | This page | 102 | id_score_1 | 0 | 103 And I press "Save page" 104 And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][8]" "xpath_element" 105 And I set the field "Select a question type" to "Multichoice" 106 And I press "Add a question page" 107 And I set the following fields to these values: 108 | Page title | question 5 | 109 | Page contents | Question from cluster | 110 | id_answer_editor_0 | Correct answer | 111 | id_response_editor_0 | Good | 112 | id_jumpto_0 | Cluster | 113 | id_score_0 | 1 | 114 | id_answer_editor_1 | Incorrect answer | 115 | id_response_editor_1 | Bad | 116 | id_jumpto_1 | This page | 117 | id_score_1 | 0 | 118 And I press "Save page" 119 And I click on "Add an end of branch" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][9]" "xpath_element" 120 And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][10]" "xpath_element" 121 And I set the field "Select a question type" to "Multichoice" 122 And I press "Add a question page" 123 And I set the following fields to these values: 124 | Page title | question 6 | 125 | Page contents | Question from cluster | 126 | id_answer_editor_0 | Correct answer | 127 | id_response_editor_0 | Good | 128 | id_jumpto_0 | Cluster | 129 | id_score_0 | 1 | 130 | id_answer_editor_1 | Incorrect answer | 131 | id_response_editor_1 | Bad | 132 | id_jumpto_1 | This page | 133 | id_score_1 | 0 | 134 And I press "Save page" 135 And I click on "Add an end of cluster" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][11]" "xpath_element" 136 And I click on "Add a content page" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][12]" "xpath_element" 137 And I set the following fields to these values: 138 | Page title | Third page name | 139 | Page contents | Content page after cluster | 140 | id_answer_editor_0 | Next page | 141 | id_jumpto_0 | Next page | 142 And I press "Save page" 143 And I log out 144 And I log in as "student1" 145 And I follow "Course 1" 146 When I follow "Lesson with subcluster" 147 Then I should see "First page contents" 148 And I press "Next page" 149 And I should see "Question from cluster" 150 And I set the following fields to these values: 151 | Correct answer | 1 | 152 And I press "Submit" 153 And I should see "Good" 154 And I press "Continue" 155 And I should see "Question from cluster" 156 And I set the following fields to these values: 157 | Correct answer | 1 | 158 And I press "Submit" 159 And I should see "Good" 160 And I press "Continue" 161 And I should see "Question from cluster" 162 And I set the following fields to these values: 163 | Correct answer | 1 | 164 And I press "Submit" 165 And I should see "Good" 166 And I press "Continue" 167 And I should see "Question from cluster" 168 And I set the following fields to these values: 169 | Correct answer | 1 | 170 And I press "Submit" 171 And I should see "Good" 172 And I press "Continue" 173 And I should see "Content page after cluster" 174 And I press "Next page" 175 And I should see "Congratulations - end of lesson reached" 176 And I should see "Your score is 4 (out of 4)."
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Thu Aug 11 10:00:09 2016 | Cross-referenced by PHPXref 0.7.1 |