[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/mod/quiz/tests/behat/ -> quiz_reset.feature (source)

   1  @mod @mod_quiz
   2  Feature: Quiz reset
   3    In order to reuse past quizzes
   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 | Terry1    | Teacher1 | teacher1@example.com |
  11        | student1 | Sam1      | Student1 | student1@example.com |
  12      And the following "courses" exist:
  13        | fullname | shortname | category |
  14        | Course 1 | C1        | 0        |
  15      And the following "course enrolments" exist:
  16        | user     | course | role           |
  17        | teacher1 | C1     | editingteacher |
  18        | student1 | C1     | student        |
  19      And the following "groups" exist:
  20        | name    | course | idnumber |
  21        | Group 1 | C1     | G1       |
  22        | Group 2 | C1     | G2       |
  23      And the following "question categories" exist:
  24        | contextlevel | reference | name           |
  25        | Course       | C1        | Test questions |
  26      And the following "questions" exist:
  27        | questioncategory | qtype     | name | questiontext   |
  28        | Test questions   | truefalse | TF1  | First question |
  29      And the following "activities" exist:
  30        | activity | name           | intro                 | course | idnumber |
  31        | quiz     | Test quiz name | Test quiz description | C1     | quiz1    |
  32      And quiz "Test quiz name" contains the following questions:
  33        | question | page |
  34        | TF1      | 1    |
  35  
  36    Scenario: Use course reset to clear all attempt data
  37      When I log in as "student1"
  38      And I follow "Course 1"
  39      And I follow "Test quiz name"
  40      And I press "Attempt quiz now"
  41      And I set the field "True" to "1"
  42      And I press "Finish attempt ..."
  43      And I press "Submit all and finish"
  44      And I log out
  45      And I log in as "teacher1"
  46      And I follow "Course 1"
  47      And I navigate to "Reset" node in "Course administration"
  48      And I set the following fields to these values:
  49          | Delete all quiz attempts | 1  |
  50      And I press "Reset course"
  51      And I press "Continue"
  52      And I follow "Course 1"
  53      And I follow "Test quiz name"
  54      And I navigate to "Results" node in "Quiz administration"
  55      Then I should see "Attempts: 0"
  56  
  57    Scenario: Use course reset to remove user overrides.
  58      When I log in as "teacher1"
  59      And I follow "Course 1"
  60      And I follow "Test quiz name"
  61      And I navigate to "User overrides" node in "Quiz administration"
  62      And I press "Add user override"
  63      And I set the following fields to these values:
  64          | Override user    | Student1  |
  65          | Attempts allowed | 2 |
  66      And I press "Save"
  67      And I should see "Sam1 Student1"
  68      And I navigate to "Reset" node in "Course administration"
  69      And I set the following fields to these values:
  70          | Delete all user overrides | 1  |
  71      And I press "Reset course"
  72      And I press "Continue"
  73      And I follow "Course 1"
  74      And I follow "Test quiz name"
  75      And I navigate to "User overrides" node in "Quiz administration"
  76      Then I should not see "Sam1 Student1"
  77  
  78  Scenario: Use course reset to remove group overrides.
  79      When I log in as "teacher1"
  80      And I follow "Course 1"
  81      And I follow "Test quiz name"
  82      And I navigate to "Group overrides" node in "Quiz administration"
  83      And I press "Add group override"
  84      And I set the following fields to these values:
  85          | Override group    | Group 1  |
  86          | Attempts allowed | 2 |
  87      And I press "Save"
  88      And I should see "Group 1"
  89      And I navigate to "Reset" node in "Course administration"
  90      And I set the following fields to these values:
  91          | Delete all group overrides | 1  |
  92      And I press "Reset course"
  93      And I press "Continue"
  94      And I follow "Course 1"
  95      And I follow "Test quiz name"
  96      And I navigate to "Group overrides" node in "Quiz administration"
  97      Then I should not see "Group 1"


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