%PDF- %PDF-
Direktori : /home/vacivi36/ava/mod/lesson/tests/behat/ |
Current File : /home/vacivi36/ava/mod/lesson/tests/behat/lesson_number_of_student_attempts.feature |
@mod @mod_lesson Feature: In Dashboard, teacher can see the number of student attempts to lessons In order to know the number of student attempts to a lesson As a teacher I need to see it in Dashboard Background: Given the following "users" exist: | username | firstname | lastname | email | | teacher1 | Teacher | 1 | teacher1@example.com | | student1 | Student | 1 | student1@example.com | | student2 | Student | 2 | student2@example.com | And the following "courses" exist: | fullname | shortname | category | | Course 1 | C1 | 0 | And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | | student2 | C1 | student | And I log in as "teacher1" Scenario: number of student attempts Given the following "activity" exists: | activity | lesson | | course | C1 | | idnumber | 0001 | | name | Test lesson name | | retake | 1 | When I am on the "Test lesson name" "lesson activity editing" page And I expand all fieldsets And I set the following fields to these values: | id_deadline_enabled | 1 | | deadline[day] | 1 | | deadline[month] | January | | deadline[year] | 2030 | | deadline[hour] | 08 | | deadline[minute] | 00 | And I press "Save and display" And I follow "Add a question page" And I set the field "Select a question type" to "True/false" And I press "Add a question page" And I set the following fields to these values: | Page title | True/false question 1 | | Page contents | Cat is an amphibian | | id_answer_editor_0 | False | | id_response_editor_0 | Correct | | id_jumpto_0 | Next page | | id_answer_editor_1 | True | | id_response_editor_1 | Wrong | | id_jumpto_1 | This page | And I press "Save page" And I select "Add a question page" from the "qtype" singleselect And I set the field "Select a question type" to "True/false" And I press "Add a question page" And I set the following fields to these values: | Page title | True/false question 2 | | Page contents | Paper is made from trees. | | id_answer_editor_0 | True | | id_response_editor_0 | Correct | | id_jumpto_0 | Next page | | id_answer_editor_1 | False | | id_response_editor_1 | Wrong | | id_jumpto_1 | This page | And I press "Save page" And I select edit type "Expanded" And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][3]" "xpath_element" And I set the field "Select a question type" to "True/false" And I press "Add a question page" And I set the following fields to these values: | Page title | True/false question 3 | | Page contents | 1+1=2 | | id_answer_editor_0 | True | | id_response_editor_0 | Correct | | id_jumpto_0 | Next page | | id_answer_editor_1 | False | | id_response_editor_1 | Wrong | | id_jumpto_1 | This page | And I press "Save page" And I am on the "Test lesson name" "lesson activity" page logged in as student1 And I should see "Cat is an amphibian" And I set the following fields to these values: | False | 1 | And I press "Submit" And I press "Continue" And I should see "Paper is made from trees." And I set the following fields to these values: | False | 1 | And I press "Submit" And I press "Continue" And I should see "1+1=2" And I set the following fields to these values: | False | 1 | And I press "Submit" And I press "Continue" And I should see "Congratulations - end of lesson reached" And I should see "Your score is 1 (out of 3)." And I follow "Return to Course 1" And I follow "Test lesson name" And I should see "Cat is an amphibian" And I set the following fields to these values: | False | 1 | And I press "Submit" And I press "Continue" And I should see "Paper is made from trees." And I set the following fields to these values: | True | 1 | And I press "Submit" And I press "Continue" And I should see "1+1=2" And I set the following fields to these values: | True | 1 | And I press "Submit" And I press "Continue" And I should see "Congratulations - end of lesson reached" And I should see "Your score is 3 (out of 3)." And I log out And I am on the "Test lesson name" "lesson activity" page logged in as student2 And I should see "Cat is an amphibian" And I set the following fields to these values: | True | 1 | And I press "Submit" And I press "Continue" And I should see "Paper is made from trees." And I set the following fields to these values: | True | 1 | And I press "Submit" And I press "Continue" And I should see "1+1=2" And I set the following fields to these values: | True | 1 | And I press "Submit" And I press "Continue" And I should see "Congratulations - end of lesson reached" And I should see "Your score is 2 (out of 3)."