[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

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

   1  @mod @mod_lesson
   2  Feature: Lesson reset
   3    In order to reuse past lessons
   4    As a teacher
   5    I need to remove all previous data.
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email |
  10        | teacher1 | Tina | Teacher1 | teacher1@example.com |
  11        | student1 | Sam1 | Student1 | student1@example.com |
  12        | student2 | Sam2 | Student2 | student2@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        | student2 | C1 | student |
  21      And the following "groups" exist:
  22        | name    | course | idnumber |
  23        | Group 1 | C1     | G1       |
  24        | Group 2 | C1     | G2       |
  25      And the following "activities" exist:
  26        | activity | name             | intro                   | course | idnumber |
  27        | lesson   | Test lesson name | Test lesson description | C1     | lesson1  |
  28      And I log in as "teacher1"
  29      And I follow "Course 1"
  30      And I turn editing mode on
  31      And I follow "Test lesson name"
  32      And I follow "Add a question page"
  33      And I set the field "Select a question type" to "True/false"
  34      And I press "Add a question page"
  35      And I set the following fields to these values:
  36        | Page title           | True/false question 1 |
  37        | Page contents        | Cat is an amphibian |
  38        | id_answer_editor_0   | False |
  39        | id_response_editor_0 | Correct |
  40        | id_jumpto_0          | Next page |
  41        | id_answer_editor_1   | True |
  42        | id_response_editor_1 | Wrong |
  43        | id_jumpto_1          | This page |
  44      And I press "Save page"
  45  
  46    Scenario: Use course reset to clear all attempt data
  47      When I log out
  48      And I log in as "student1"
  49      And I follow "Course 1"
  50      And I follow "Test lesson name"
  51      And I should see "Cat is an amphibian"
  52      And I set the following fields to these values:
  53        | False | 1 |
  54      And I press "Submit"
  55      And I press "Continue"
  56      And I should see "Congratulations - end of lesson reached"
  57      And I log out
  58      And I log in as "teacher1"
  59      And I follow "Course 1"
  60      And I follow "Test lesson name"
  61      And I navigate to "Overview" node in "Reports"
  62      And I should see "Sam1 Student1"
  63      And I navigate to "Reset" node in "Course administration"
  64      And I set the following fields to these values:
  65          | Delete all lesson attempts | 1  |
  66      And I press "Reset course"
  67      And I press "Continue"
  68      And I follow "Course 1"
  69      And I follow "Test lesson name"
  70      And I navigate to "Overview" node in "Reports"
  71      Then I should see "No attempts have been made on this lesson"
  72  
  73    Scenario: Use course reset to remove user overrides.
  74      When I follow "Test lesson name"
  75      And I navigate to "User overrides" node in "Lesson administration"
  76      And I press "Add user override"
  77      And I set the following fields to these values:
  78          | Override user    | Student1  |
  79          | Re-takes allowed | 1 |
  80      And I press "Save"
  81      And I should see "Sam1 Student1"
  82      And I navigate to "Reset" node in "Course administration"
  83      And I set the following fields to these values:
  84          | Delete all user overrides | 1  |
  85      And I press "Reset course"
  86      And I press "Continue"
  87      And I follow "Course 1"
  88      And I follow "Test lesson name"
  89      And I navigate to "User overrides" node in "Lesson administration"
  90      Then I should not see "Sam1 Student1"
  91  
  92    Scenario: Use course reset to remove group overrides.
  93      When I follow "Test lesson name"
  94      And I navigate to "Group overrides" node in "Lesson administration"
  95      And I press "Add group override"
  96      And I set the following fields to these values:
  97          | Override group   | Group 1  |
  98          | Re-takes allowed | 1 |
  99      And I press "Save"
 100      And I should see "Group 1"
 101      And I navigate to "Reset" node in "Course administration"
 102      And I set the following fields to these values:
 103          | Delete all group overrides | 1  |
 104      And I press "Reset course"
 105      And I press "Continue"
 106      And I follow "Course 1"
 107      And I follow "Test lesson name"
 108      And I navigate to "Group overrides" node in "Lesson administration"
 109      Then I should not see "Group 1"


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