Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 14... Línea 14...
14
      | Course 1 | C1 | weeks |
14
      | Course 1 | C1 | weeks |
15
    And the following "course enrolments" exist:
15
    And the following "course enrolments" exist:
16
      | user | course | role |
16
      | user | course | role |
17
      | teacher1 | C1 | editingteacher |
17
      | teacher1 | C1 | editingteacher |
18
    And the following "activities" exist:
18
    And the following "activities" exist:
19
      | activity   | name   | intro                                           | course | idnumber |
19
      | activity   | name    | intro                                           | course | idnumber |
20
      | quiz       | Quiz 1 | Quiz 1 for testing the Add random question form | C1     | quiz1    |
20
      | quiz       | Quiz 1  | Quiz 1 for testing the Add random question form | C1     | quiz1    |
-
 
21
      | qbank      | Qbank 1 | Question bank 1                                 | C1     | qbank1   |
21
    And the following "question categories" exist:
22
    And the following "question categories" exist:
22
      | contextlevel | reference | questioncategory | name           |
23
      | contextlevel    | reference     | questioncategory    | name                |
23
      | Course       | C1        | Top              | top            |
-
 
24
      | Course       | C1        | top              | Default for C1 |
24
      | Activity module | qbank1        | top                 | Default for Qbank 1 |
25
      | Course       | C1        | Default for C1   | Subcategory    |
25
      | Activity module | qbank1        | Default for Qbank 1 | Subcategory         |
26
      | Course       | C1        | top              | Used category  |
26
      | Activity module | qbank1        | top                 | Used category       |
27
    And the following "questions" exist:
27
    And the following "questions" exist:
28
      | questioncategory | qtype | name                      | questiontext                  |
28
      | questioncategory | qtype | name                      | questiontext                  |
29
      | Used category    | essay | Test question to be moved | Write about whatever you want |
29
      | Used category    | essay | Test question to be moved | Write about whatever you want |
Línea 30... Línea 30...
30
 
30
 
31
  @javascript
31
  @javascript
32
  Scenario: Moving a question should not change the random question
32
  Scenario: Moving a question should not change the random question
33
    Given I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
33
    Given I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
34
    When I open the "last" add to quiz menu
34
    When I open the "last" add to quiz menu
-
 
35
    And I follow "a random question"
-
 
36
    And I click on "Switch bank" "button"
35
    And I follow "a random question"
37
    And I click on "Qbank 1" "link" in the "Select question bank" "dialogue"
36
    And I apply question bank filter "Category" with value "Used category"
38
    And I apply question bank filter "Category" with value "Used category"
37
    And I press "Add random question"
39
    And I press "Add random question"
38
    And I should see "Random question based on filter condition" on quiz page "1"
40
    And I should see "Random (Used category) based on filter condition" on quiz page "1"
39
    And I click on "Configure question" "link" in the "Random question based on filter condition" "list_item"
41
    And I click on "Configure question" "link" in the "Random (Used category) based on filter condition" "list_item"
40
    And I should see "Used category"
42
    And I should see "Used category"
41
    And I am on "Course 1" course homepage
43
    And I am on "Course 1" course homepage
-
 
44
    And I navigate to "Question banks" in current page administration
42
    And I navigate to "Question bank" in current page administration
45
    And I click on "Qbank 1" "link"
43
    And I apply question bank filter "Category" with value "Used category"
46
    And I apply question bank filter "Category" with value "Used category"
44
    And I click on "Test question to be moved" "checkbox" in the "Test question to be moved" "table_row"
47
    And I click on "Test question to be moved" "checkbox" in the "Test question to be moved" "table_row"
45
    And I click on "With selected" "button"
48
    And I click on "With selected" "button"
46
    And I click on question bulk action "move"
49
    And I click on question bulk action "move"
-
 
50
    And I open the autocomplete suggestions list in the ".search-categories" "css_element"
47
    And I set the field "Question category" to "Subcategory"
51
    And I click on "Subcategory" "list_item" in the "Move the selected questions to..." "dialogue"
48
    And I press "Move to"
52
    And I click on "Move questions" "button"
-
 
53
    And I should see "Are you sure you want to move these questions?"
-
 
54
    And I click on "Confirm" "button"
49
    Then I should see "Test question to be moved"
55
    And I wait until the page is ready
50
    And I should see "Subcategory (1)"
56
    Then I should see "Subcategory (1)"
51
    And I am on the "Quiz 1" "mod_quiz > Edit" page
57
    And I am on the "Quiz 1" "mod_quiz > Edit" page
52
    And I should see "Random question based on filter condition" on quiz page "1"
58
    And I should see "Random (Used category) based on filter condition" on quiz page "1"
53
    And I click on "Configure question" "link" in the "Random question based on filter condition" "list_item"
59
    And I click on "Configure question" "link" in the "Random (Used category) based on filter condition" "list_item"
Línea 54... Línea 60...
54
    And I should see "Used category"
60
    And I should see "Used category"
55
 
61
 
56
  @javascript
62
  @javascript
57
  Scenario: Renaming a random question category should update the random question
63
  Scenario: Renaming a random question category should update the random question
58
    Given I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
64
    Given I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
-
 
65
    When I open the "last" add to quiz menu
-
 
66
    And I follow "a random question"
59
    When I open the "last" add to quiz menu
67
    Then I click on "Switch bank" "button"
60
    And I follow "a random question"
68
    And I click on "Qbank 1" "link" in the "Select question bank" "dialogue"
61
    And I apply question bank filter "Category" with value "Used category"
69
    And I apply question bank filter "Category" with value "Used category"
62
    And I press "Add random question"
70
    And I press "Add random question"
63
    And I should see "Random question based on filter condition" on quiz page "1"
71
    And I should see "Random (Used category) based on filter condition" on quiz page "1"
-
 
72
    And I am on the "Qbank 1" "core_question > question categories" page
64
    And I am on the "Course 1" "core_question > course question categories" page
73
    And I open the action menu in "Used category" "list_item"
65
    And I click on "Edit this category" "link" in the "Used category" "list_item"
74
    And I choose "Edit" in the open action menu
66
    And I set the following fields to these values:
75
    And I set the following fields to these values:
67
      | Name            | Used category new |
76
      | Name            | Used category new |
-
 
77
      | Category info   | I was edited      |
68
      | Category info   | I was edited      |
78
    And I press "Save changes"
69
    And I press "Save changes"
79
    And I set the field "Show descriptions" to "1"
70
    Then I should see "Used category new"
80
    Then I should see "Used category new"
-
 
81
    And I should see "I was edited" in the "Used category new" "list_item"
-
 
82
    And I am on the "Quiz 1" "mod_quiz > Edit" page
-
 
83
    And I should see "Random (Used category new) based on filter condition" on quiz page "1"
-
 
84
 
-
 
85
  @javascript
-
 
86
  Scenario: A random question with an invalid category should still be editable
-
 
87
    Given I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
-
 
88
    When I open the "last" add to quiz menu
-
 
89
    And I follow "a random question"
-
 
90
    Then I click on "Switch bank" "button"
-
 
91
    And I click on "Qbank 1" "link" in the "Select question bank" "dialogue"
71
    And I should see "I was edited" in the "Used category new" "list_item"
92
    And I apply question bank filter "Category" with value "Used category"
-
 
93
    And I press "Add random question"
-
 
94
    And I should see "Random (Used category) based on filter condition" on quiz page "1"
-
 
95
    And I am on the "Qbank 1" "core_question > question categories" page
-
 
96
    And I open the action menu in "Used category" "list_item"
-
 
97
    And I choose "Delete" in the open action menu
-
 
98
    And I click on "Delete" "button" in the "Delete" "dialogue"
-
 
99
    And I press "Save in category"
-
 
100
    And I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"