[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

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

   1  @mod @mod_quiz
   2  Feature: Settings form fields disabled if not required
   3    In to create quizzes as simply as possible
   4    As a teacher
   5    I don't need to to use certain form fields.
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname |
  10        | teacher  | Teach     |
  11        | student1 | Student1  |
  12        | student2 | Student2  |
  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        | teacher  | C1     | editingteacher |
  19        | student1 | C1     | student        |
  20        | student2 | C1     | student        |
  21      And I log in as "teacher"
  22      And I follow "Course 1"
  23      And I turn editing mode on
  24  
  25    @javascript
  26    Scenario: Depending on the number of attempts, different form fields are disabled.
  27      When I add a "Quiz" to section "1"
  28      And I expand all fieldsets
  29      And I set the field "Name" to "Test quiz"
  30      And I set the field "Attempts allowed" to "1"
  31      Then the "Grading method" "field" should be disabled
  32      And the "Each attempt builds on the last" "field" should be disabled
  33      And the "id_delay1_enabled" "field" should be disabled
  34      And the "id_delay2_enabled" "field" should be disabled
  35  
  36      When I set the field "Attempts allowed" to "2"
  37      Then the "Grading method" "field" should be enabled
  38      And the "Each attempt builds on the last" "field" should be enabled
  39      And the "id_delay1_enabled" "field" should be enabled
  40      And the "id_delay2_enabled" "field" should be disabled
  41  
  42      When I set the field "Attempts allowed" to "3"
  43      Then the "Grading method" "field" should be enabled
  44      And the "Each attempt builds on the last" "field" should be enabled
  45      And the "id_delay1_enabled" "field" should be enabled
  46      And the "id_delay2_enabled" "field" should be enabled
  47  
  48      When I set the field "Attempts allowed" to "Unlimited"
  49      Then the "Grading method" "field" should be enabled
  50      And the "Each attempt builds on the last" "field" should be enabled
  51      # And the "id_delay1_enabled" "field" should be enabled
  52      # And the "id_delay2_enabled" "field" should be enabled
  53  
  54      When I press "Save and display"
  55      And I navigate to "User overrides" node in "Quiz administration"
  56      And I press "Add user override"
  57      And I set the following fields to these values:
  58          | Override user    | Student1 |
  59          | Attempts allowed | 3        |
  60      And I press "Save"
  61      And I navigate to "Edit settings" node in "Quiz administration"
  62      And I expand all fieldsets
  63      And I set the field "Attempts allowed" to "1"
  64      Then the "Grading method" "field" should be enabled
  65      And the "Each attempt builds on the last" "field" should be enabled
  66      And the "id_delay1_enabled" "field" should be enabled
  67      And the "id_delay2_enabled" "field" should be enabled
  68  
  69      When I press "Save and display"
  70      And I navigate to "User overrides" node in "Quiz administration"
  71      And I follow "Edit"
  72      And I set the field "Attempts allowed" to "2"
  73      And I press "Save"
  74      And I navigate to "Edit settings" node in "Quiz administration"
  75      And I expand all fieldsets
  76      And I set the field "Attempts allowed" to "1"
  77      Then the "Grading method" "field" should be enabled
  78      And the "Each attempt builds on the last" "field" should be enabled
  79      And the "id_delay1_enabled" "field" should be enabled
  80      And the "id_delay2_enabled" "field" should be disabled
  81  
  82      When I press "Save and display"
  83      And I navigate to "User overrides" node in "Quiz administration"
  84      And I press "Add user override"
  85      And I set the following fields to these values:
  86          | Override user    | Student2  |
  87          | Attempts allowed | Unlimited |
  88      And I press "Save"
  89      And I navigate to "Edit settings" node in "Quiz administration"
  90      And I expand all fieldsets
  91      And I set the field "Attempts allowed" to "1"
  92      Then the "Grading method" "field" should be enabled
  93      And the "Each attempt builds on the last" "field" should be enabled
  94      And the "id_delay1_enabled" "field" should be enabled
  95      And the "id_delay2_enabled" "field" should be enabled


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