%PDF- %PDF-
Direktori : /home/vacivi36/ava/mod/lesson/tests/behat/ |
Current File : /home/vacivi36/ava/mod/lesson/tests/behat/lesson_report.feature |
@mod @mod_lesson Feature: In a lesson activity, teachers can review student attempts To review student attempts in a lesson As a Teacher I need to view the reports. Background: Given the following "users" exist: | username | firstname | lastname | email | | teacher1 | Teacher | 1 | teacher1@example.com | | student1 | Student | 1 | student1@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 | And the following "activities" exist: | activity | name | course | idnumber | retake | | lesson | Test lesson name | C1 | lesson1 | 1 | And I am on the "Test lesson name" "lesson activity" page logged in as teacher1 Scenario: View student attempts in a lesson containing both content and question pages Given I follow "Add a content page" And I set the following fields to these values: | Page title | First page name | | Page contents | First page contents | | id_answer_editor_0 | Next page | | id_jumpto_0 | Next 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 | Kermit is a frog | | 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 "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 1 | | 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 "Add a content page" from the "qtype" singleselect And I set the following fields to these values: | Page title | Third page name | | Page contents | Third page contents | | id_answer_editor_0 | Previous page | | id_jumpto_0 | Previous page | | id_answer_editor_1 | Next page | | id_jumpto_1 | Next page | And I press "Save page" And I select "Add a content page" from the "qtype" singleselect And I set the following fields to these values: | Page title | Second page name | | Page contents | Second page contents | | id_answer_editor_0 | Previous page | | id_jumpto_0 | Previous page | | id_answer_editor_1 | Next page | | id_jumpto_1 | Next page | And I press "Save page" When I am on the "Test lesson name" "lesson activity" page logged in as student1 And I should see "First page contents" And I press "Next page" And I should see "Second page contents" And I press "Next page" And I should see "Third page contents" And I press "Next page" 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 "Kermit is a frog" 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" Then I am on the "Test lesson name" "lesson activity" page logged in as teacher1 And I navigate to "Reports" in current page administration And I should see "Student 1" And I should see "100%" And I should see "High score" And I should see "Average score" And I should see "Low score" Scenario: View student attempts in a lesson containing only content pages Given I follow "Add a content page" And I set the following fields to these values: | Page title | First page name | | Page contents | First page contents | | id_answer_editor_0 | Next page | | id_jumpto_0 | Next page | And I press "Save page" And I select "Add a content page" from the "qtype" singleselect And I set the following fields to these values: | Page title | Fourth page name | | Page contents | Fourth page contents | | id_answer_editor_0 | Previous page | | id_jumpto_0 | Previous page | | id_answer_editor_1 | End of lesson | | id_jumpto_1 | End of lesson | And I press "Save page" And I select "Add a content page" from the "qtype" singleselect And I set the following fields to these values: | Page title | Third page name | | Page contents | Third page contents | | id_answer_editor_0 | Previous page | | id_jumpto_0 | Previous page | | id_answer_editor_1 | Next page | | id_jumpto_1 | Next page | And I press "Save page" And I select "Add a content page" from the "qtype" singleselect And I set the following fields to these values: | Page title | Second page name | | Page contents | Second page contents | | id_answer_editor_0 | Previous page | | id_jumpto_0 | Previous page | | id_answer_editor_1 | Next page | | id_jumpto_1 | Next page | And I press "Save page" When I am on the "Test lesson name" "lesson activity" page logged in as student1 And I should see "First page contents" And I press "Next page" And I should see "Second page contents" And I press "Next page" And I should see "Third page contents" And I press "Next page" And I should see "Fourth page contents" And I press "End of lesson" Then I am on the "Test lesson name" "lesson activity" page logged in as teacher1 And I navigate to "Reports" in current page administration And I should see "Student 1" And I should not see "High score" And I should not see "Average score" And I should not see "Low score"