Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 13... Línea 13...
13
      | Course 1 | C1        |
13
      | Course 1 | C1        |
14
    And the following "course enrolments" exist:
14
    And the following "course enrolments" exist:
15
      | user     | course | role           |
15
      | user     | course | role           |
16
      | teacher1 | C1     | editingteacher |
16
      | teacher1 | C1     | editingteacher |
17
    And the following "activities" exist:
17
    And the following "activities" exist:
18
      | activity   | name   | intro                                           | course | idnumber |
18
      | activity   | name    | intro                                             | course | idnumber |
19
      | quiz       | Quiz 1 | Quiz 1 for testing the Add random question form | C1     | quiz1    |
19
      | quiz       | Quiz 1  | Quiz 1 for testing the Add random question form   | C1     | quiz1    |
-
 
20
      | qbank      | Qbank 1 | Qbank 1 for testing the Edit random question form | C1     | qbank1   |
20
    And the following "question categories" exist:
21
    And the following "question categories" exist:
21
      | contextlevel | reference | name                |
22
      | contextlevel    | reference | name                |
22
      | Course       | C1        | Questions Category 1|
23
      | Activity module | quiz1     | Questions Category 1|
23
      | Course       | C1        | Questions Category 2|
24
      | Activity module | quiz1     | Questions Category 2|
-
 
25
      | Activity module | qbank1    | Questions Category 3|
24
    And the following "questions" exist:
26
    And the following "questions" exist:
25
      | questioncategory     | qtype | name            | user     | questiontext    |
27
      | questioncategory     | qtype | name            | user     | questiontext    |
26
      | Questions Category 1 | essay | question 1 name | admin    | Question 1 text |
28
      | Questions Category 1 | essay | question 1 name | admin    | Question 1 text |
27
      | Questions Category 1 | essay | question 2 name | teacher1 | Question 2 text |
29
      | Questions Category 1 | essay | question 2 name | teacher1 | Question 2 text |
-
 
30
      | Questions Category 3 | essay | question 3 name | teacher1 | Question 3 text |
28
    And the following "core_question > Tags" exist:
31
    And the following "core_question > Tags" exist:
29
      | question        | tag   |
32
      | question        | tag   |
30
      | question 1 name | easy  |
33
      | question 1 name | easy  |
31
      | question 1 name | essay |
34
      | question 1 name | essay |
32
      | question 2 name | hard  |
35
      | question 2 name | hard  |
33
      | question 2 name | essay |
36
      | question 2 name | essay |
-
 
37
      | question 3 name | essay |
Línea 34... Línea 38...
34
 
38
 
35
  Scenario: Editing tags on one slot does not delete the rest
39
  Scenario: Editing tags on one slot does not delete the rest
36
    Given I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
40
    Given I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
37
    And I open the "last" add to quiz menu
41
    And I open the "last" add to quiz menu
-
 
42
    And I follow "a random question"
38
    And I follow "a random question"
43
    And I apply question bank filter "Category" with value "Questions Category 1"
39
    # To actually reproduce MDL-68733 it would be better to set tags easy,essay here, and then below just delete one tag.
44
    # To actually reproduce MDL-68733 it would be better to set tags easy,essay here, and then below just delete one tag.
40
    # However, the state of Behat for autocomplete fields does not let us actually do that.
45
    # However, the state of Behat for autocomplete fields does not let us actually do that.
41
    And I apply question bank filter "Tag" with value "easy"
46
    And I apply question bank filter "Tag" with value "easy"
42
    And I press "Add random question"
47
    And I press "Add random question"
43
    And I open the "Page 1" add to quiz menu
48
    And I open the "Page 1" add to quiz menu
-
 
49
    And I follow "a random question"
44
    And I follow "a random question"
50
    And I apply question bank filter "Category" with value "Questions Category 1"
45
    And I apply question bank filter "Tag" with value "hard"
51
    And I apply question bank filter "Tag" with value "hard"
46
    And I press "Add random question"
52
    And I press "Add random question"
47
    And I follow "Add page break"
53
    And I follow "Add page break"
48
    When I click on "Configure question" "link" in the "Random question based on filter condition with tags: easy" "list_item"
54
    When I click on "Configure question" "link" in the "Random (Questions Category 1) based on filter condition with tags: easy" "list_item"
49
    And I apply question bank filter "Tag" with value "essay"
55
    And I apply question bank filter "Tag" with value "essay"
50
    And I press "Update filter conditions"
56
    And I press "Update filter conditions"
51
    Then I should see "Random question based on filter condition with tags: essay" on quiz page "1"
57
    Then I should see "Random (Questions Category 1) based on filter condition with tags: essay" on quiz page "1"
52
    And I should see "Random question based on filter condition with tags: hard" on quiz page "2"
58
    And I should see "Random (Questions Category 1) based on filter condition with tags: hard" on quiz page "2"
53
    And I click on "Configure question" "link" in the "Random question based on filter condition with tags: hard" "list_item"
59
    And I click on "Configure question" "link" in the "Random (Questions Category 1) based on filter condition with tags: hard" "list_item"
-
 
60
    And "hard" "autocomplete_selection" should be visible
-
 
61
 
-
 
62
  Scenario: Switch banks when editing a random question
-
 
63
    Given I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
-
 
64
    And I open the "last" add to quiz menu
-
 
65
    And I follow "a random question"
-
 
66
    And I apply question bank filter "Category" with value "Questions Category 1"
-
 
67
    And I apply question bank filter "Tag" with value "essay"
-
 
68
    And I press "Add random question"
-
 
69
    When I click on "Configure question" "link" in the "Random (Questions Category 1) based on filter condition with tags: essay" "list_item"
-
 
70
    And I press "Switch bank"
-
 
71
    And I click on "Qbank 1" "link" in the "Select question bank" "dialogue"
-
 
72
    And the field "filter-value-qtagids" matches value "essay"
-
 
73
    And I apply question bank filter "Category" with value "Questions Category 3 (1)"
-
 
74
    And I should see "question 3 name"
-
 
75
    And I press "Update filter conditions"
-
 
76
    Then I should see "Random (Questions Category 3) based on filter condition with tags: essay" on quiz page "1"
-
 
77
 
-
 
78
  Scenario: "Go back" from bank switcher keeps existing filter values.
-
 
79
    Given I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
-
 
80
    And I open the "last" add to quiz menu
-
 
81
    And I follow "a random question"
-
 
82
    And I apply question bank filter "Category" with value "Questions Category 1"
-
 
83
    And I apply question bank filter "Tag" with value "essay"
-
 
84
    And I press "Add random question"
-
 
85
    When I click on "Configure question" "link" in the "Random (Questions Category 1) based on filter condition with tags: essay" "list_item"
-
 
86
    And the field "filter-value-category" matches value "   Questions Category 1 (2)"
-
 
87
    And the field "filter-value-qtagids" matches value "essay"
-
 
88
    And I press "Switch bank"
-
 
89
    And I press "Go back"
-
 
90
    Then the field "filter-value-category" matches value "   Questions Category 1 (2)"