[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

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

   1  @mod @mod_lesson
   2  Feature: In a lesson activity, teacher can delete question answers and
   3  branch table contents
   4    In order to modify an existing lesson
   5    As a teacher
   6    I need to question answers and branch table contents in the lesson
   7  
   8    Background:
   9      Given the following "users" exist:
  10        | username | firstname | lastname | email |
  11        | teacher1 | Teacher | 1 | teacher1@example.com |
  12        | student1 | Student | 1 | student1@example.com |
  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        | id_answer_editor_1 | Previous page |
  34        | id_jumpto_1 | Previous page |
  35      And I press "Save page"
  36      And I select "Question" from the "qtype" singleselect
  37      And I set the field "Select a question type" to "Numerical"
  38      And I press "Add a question page"
  39      And I set the following fields to these values:
  40        | Page title | Hardest question ever |
  41        | Page contents | 1 + 1? |
  42        | id_answer_editor_0 | 2 |
  43        | id_response_editor_0 | Correct answer |
  44        | id_jumpto_0 | End of lesson |
  45        | id_score_0 | 1 |
  46        | id_answer_editor_1 | 1 |
  47        | id_response_editor_1 | Incorrect answer |
  48        | id_jumpto_1 | First page name |
  49        | id_score_1 | 0 |
  50      And I press "Save page"
  51      And I follow "Expanded"
  52  
  53    Scenario: Edit lesson content page
  54      Given I click on "//th[normalize-space(.)='First page name']/descendant::a[2]" "xpath_element"
  55      When I set the following fields to these values:
  56        | id_answer_editor_1 | |
  57      And I press "Save page"
  58      And I should not see "Previous page"
  59      And I log out
  60      And I log in as "student1"
  61      And I follow "Course 1"
  62      And I follow "Test lesson name"
  63      And I should see "First page contents"
  64      And I should not see "Previous page"
  65      And I press "Next page"
  66      And I should see "1 + 1?"
  67      And I set the following fields to these values:
  68        | Your answer | 2 |
  69      And I press "Submit"
  70      And I should see "Correct answer"
  71      And I should not see "Incorrect answer"
  72      And I press "Continue"
  73      And I should see "Congratulations - end of lesson reached"
  74      And I should see "Your score is 1 (out of 1)."
  75  
  76    Scenario: Edit lesson question page
  77      Given I click on "//th[normalize-space(.)='Hardest question ever']/descendant::a[2]" "xpath_element"
  78      When I set the following fields to these values:
  79        | id_answer_editor_1 | |
  80      And I press "Save page"
  81      And I should not see "Incorrect answer"
  82      And I log out
  83      And I log in as "student1"
  84      And I follow "Course 1"
  85      And I follow "Test lesson name"
  86      And I should see "First page contents"
  87      And I press "Next page"
  88      And I should see "1 + 1?"
  89      And I set the following fields to these values:
  90        | Your answer | 1 |
  91      And I press "Submit"
  92      And I should not see "Incorrect answer"
  93      And I should see "Congratulations - end of lesson reached"
  94      And I should see "Your score is 0 (out of 1)."


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1