Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 12... Línea 12...
12
      | fullname | shortname | format |
12
      | fullname | shortname | format |
13
      | Course 1 | C1        | weeks  |
13
      | Course 1 | C1        | weeks  |
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:
-
 
18
      | activity | name    | course | idnumber |
-
 
19
      | qbank    | Qbank 1 | C1     | qbank1   |
17
    And I log in as "teacher1"
20
    And I log in as "teacher1"
18
    And I am on "Course 1" course homepage
21
    And I am on "Course 1" course homepage
Línea 19... Línea 22...
19
 
22
 
20
  Scenario: A question can only have a unique idnumber within a category
23
  Scenario: A question can only have a unique idnumber within a category
21
    When the following "question categories" exist:
24
    When the following "question categories" exist:
22
      | contextlevel | reference | questioncategory | name           | idnumber |
25
      | contextlevel    | reference | questioncategory | name           | idnumber |
23
      | Course       | C1        | Top              | top            |          |
26
      | Activity module | qbank1    | Top              | top            |          |
24
      | Course       | C1        | top              | Used category  | c1used   |
27
      | Activity module | qbank1    | top              | Used category  | c1used   |
25
    And the following "questions" exist:
28
    And the following "questions" exist:
26
      | questioncategory | qtype | name            | questiontext                  | idnumber |
29
      | questioncategory | qtype | name            | questiontext                  | idnumber |
27
      | Used category    | essay | Test question 1 | Write about whatever you want | q1       |
30
      | Used category    | essay | Test question 1 | Write about whatever you want | q1       |
28
      | Used category    | essay | Test question 2 | Write about whatever you want | q2       |
31
      | Used category    | essay | Test question 2 | Write about whatever you want | q2       |
Línea 32... Línea 35...
32
    # This is the standard form warning reminding the user that the idnumber needs to be unique for a category.
35
    # This is the standard form warning reminding the user that the idnumber needs to be unique for a category.
33
    Then I should see "This ID number is already in use"
36
    Then I should see "This ID number is already in use"
Línea 34... Línea 37...
34
 
37
 
35
  Scenario: A question can be edited and saved without changing the idnumber
38
  Scenario: A question can be edited and saved without changing the idnumber
36
    When the following "question categories" exist:
39
    When the following "question categories" exist:
37
      | contextlevel | reference | questioncategory | name           | idnumber |
40
      | contextlevel    | reference | questioncategory | name           | idnumber |
38
      | Course       | C1        | Top              | top            |          |
41
      | Activity module | qbank1    | Top              | top            |          |
39
      | Course       | C1        | top              | Used category  | c1used   |
42
      | Activity module | qbank1    | top              | Used category  | c1used   |
40
    And the following "questions" exist:
43
    And the following "questions" exist:
41
      | questioncategory | qtype | name            | questiontext                  | idnumber |
44
      | questioncategory | qtype | name            | questiontext                  | idnumber |
42
      | Used category    | essay | Test question 1 | Write about whatever you want | q1       |
45
      | Used category    | essay | Test question 1 | Write about whatever you want | q1       |
43
    And I am on the "Test question 1" "core_question > edit" page
46
    And I am on the "Test question 1" "core_question > edit" page
44
    And I press "Save changes"
47
    And I press "Save changes"
Línea 45... Línea 48...
45
    Then I should not see "This ID number is already in use"
48
    Then I should not see "This ID number is already in use"
46
 
49
 
47
  Scenario: Question idnumber conflicts found when saving to the same category.
50
  Scenario: Question idnumber conflicts found when saving to the same category.
48
    When the following "question categories" exist:
51
    When the following "question categories" exist:
49
      | contextlevel | reference | questioncategory | name       |
52
      | contextlevel    | reference | questioncategory | name       |
50
      | Course       | C1        | Top              | top        |
53
      | Activity module | qbank1    | Top              | top        |
51
      | Course       | C1        | top              | Category 1 |
54
      | Activity module | qbank1    | top              | Category 1 |
52
      | Course       | C1        | top              | Category 2 |
55
      | Activity module | qbank1    | top              | Category 2 |
53
    And the following "questions" exist:
56
    And the following "questions" exist:
54
      | questioncategory | qtype | name             | questiontext                  | idnumber |
57
      | questioncategory | qtype | name             | questiontext                  | idnumber |
55
      | Category 1       | essay | Question to edit | Write about whatever you want | q1       |
58
      | Category 1       | essay | Question to edit | Write about whatever you want | q1       |
Línea 60... Línea 63...
60
    Then I should see "This ID number is already in use"
63
    Then I should see "This ID number is already in use"
Línea 61... Línea 64...
61
 
64
 
62
  @javascript
65
  @javascript
63
  Scenario: Moving a question between categories can force a change to the idnumber
66
  Scenario: Moving a question between categories can force a change to the idnumber
64
    And the following "question categories" exist:
67
    And the following "question categories" exist:
65
      | contextlevel | reference | questioncategory | name           | idnumber |
68
      | contextlevel    | reference | questioncategory | name           | idnumber |
66
      | Course       | C1        | Top              | top            |          |
69
      | Activity module | qbank1    | Top              | top            |          |
67
      | Course       | C1        | top              | Subcategory    | c1sub    |
70
      | Activity module | qbank1    | top              | Subcategory    | c1sub    |
68
      | Course       | C1        | top              | Used category  | c1used   |
71
      | Activity module | qbank1    | top              | Used category  | c1used   |
69
    And the following "questions" exist:
72
    And the following "questions" exist:
70
      | questioncategory | qtype | name            | questiontext                  | idnumber |
73
      | questioncategory | qtype | name            | questiontext                  | idnumber |
71
      | Used category    | essay | Test question 1 | Write about whatever you want | q1       |
74
      | Used category    | essay | Test question 1 | Write about whatever you want | q1       |
72
      | Used category    | essay | Test question 2 | Write about whatever you want | q2       |
75
      | Used category    | essay | Test question 2 | Write about whatever you want | q2       |
Línea 77... Línea 80...
77
    And I press "submitbutton"
80
    And I press "submitbutton"
78
    # Javascript is required for the next step.
81
    # Javascript is required for the next step.
79
    And I click on "Test question 3" "checkbox" in the "Test question 3" "table_row"
82
    And I click on "Test question 3" "checkbox" in the "Test question 3" "table_row"
80
    And I click on "With selected" "button"
83
    And I click on "With selected" "button"
81
    And I click on question bulk action "move"
84
    And I click on question bulk action "move"
-
 
85
    And I open the autocomplete suggestions list in the ".search-categories" "css_element"
-
 
86
    And I click on "Used category" "list_item" in the "Move the selected questions to..." "dialogue"
82
    And I set the field "Question category" to "Subcategory"
87
    And I click on "Move questions" "button"
-
 
88
    And I should see "Are you sure you want to move these questions?"
83
    And I press "Move to"
89
    And I click on "Confirm" "button"
-
 
90
    And I wait until the page is ready
84
    And I choose "Edit question" action for "Test question 3" in the question bank
91
    And I choose "Edit question" action for "Test question 3" in the question bank
85
    # The question just moved into this category needs to have a unique idnumber, so a number is appended.
92
    # The question just moved into this category needs to have a unique idnumber, so a number is appended.
86
    Then the field "ID number" matches value "q1_1"
93
    Then the field "ID number" matches value "q1_1"