[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/mod/lesson/tests/behat/ -> lesson_review.feature (source)

   1  @mod @mod_lesson
   2  Feature: In a lesson activity, students can review the answers they gave to questions
   3    To review questions of a lesson
   4    As a student
   5    I need to complete a lesson answering all of the questions.
   6  
   7    @javascript
   8    Scenario: Student answers questions and then reviews them.
   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        | Display ongoing score | Yes |
  27        | Slideshow | Yes |
  28        | Maximum number of answers | 10 |
  29        | Allow student review | Yes |
  30        | Maximum number of attempts | 3 |
  31        | Custom scoring | No |
  32        | Re-takes allowed | Yes |
  33      And I follow "Test lesson name"
  34      And I follow "Add a question page"
  35      And I set the field "Select a question type" to "Numerical"
  36      And I press "Add a question page"
  37      And I set the following fields to these values:
  38        | Page title | Hardest question ever |
  39        | Page contents | 1 + 1? |
  40        | id_answer_editor_0 | 2 |
  41        | id_response_editor_0 | Correct answer |
  42        | id_jumpto_0 | Next page |
  43        | id_answer_editor_1 | 1 |
  44        | id_response_editor_1 | Incorrect answer |
  45        | id_jumpto_1 | This page |
  46      And I press "Save page"
  47      And I set the field "qtype" to "Question"
  48      And I set the field "Select a question type" to "True/false"
  49      And I press "Add a question page"
  50      And I set the following fields to these values:
  51        | Page title | Next question |
  52        | Page contents | Paper is made from trees. |
  53        | id_answer_editor_0 | True |
  54        | id_response_editor_0 | Correct |
  55        | id_jumpto_0 | Next page |
  56        | id_answer_editor_1 | False |
  57        | id_response_editor_1 | Wrong |
  58        | id_jumpto_1 | This page |
  59      And I press "Save page"
  60      And I log out
  61      And I log in as "student1"
  62      And I follow "Course 1"
  63      And I follow "Test lesson name"
  64      And I should see "You have answered 0 correctly out of 0 attempts."
  65      And I set the following fields to these values:
  66        | Your answer | 1 |
  67      And I press "Submit"
  68      And I should see "You have answered 0 correctly out of 1 attempts."
  69      And I press "Continue"
  70      And I set the following fields to these values:
  71        | Your answer | 2 |
  72      And I press "Submit"
  73      And I should see "You have answered 1 correctly out of 2 attempts."
  74      And I press "Continue"
  75      And I set the following fields to these values:
  76        | True | 1 |
  77      And I press "Submit"
  78      And I should see "You have answered 2 correctly out of 3 attempts."
  79      And I press "Continue"
  80      When I follow "Review lesson"
  81      Then I should see "You have answered 2 correctly out of 3 attempts."
  82      And I press "Next page"
  83      And I should see "You have answered 2 correctly out of 3 attempts."
  84      And I press "Continue"
  85      And I should see "You have answered 2 correctly out of 3 attempts."
  86      And I press "Next page"
  87      And I should see "You have answered 2 correctly out of 3 attempts."


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1