Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 1... Línea 1...
1
@core @core_question
1
@qbank @qbank_managecategories @category_reorder @javascript
2
Feature: A teacher can move question categories in the question bank
2
Feature: A teacher can reorder question categories
3
  In order to organize my questions
3
  In order to change question category order
4
  As a teacher
4
  As a teacher
5
  I create question categories and move them in the question bank
5
  I need to reorder them
Línea 6... Línea 6...
6
 
6
 
7
  Background:
7
  Background:
8
    Given the following "users" exist:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
9
      | username | firstname | lastname | email                |
10
      | teacher1 | T1        | Teacher1 | teacher1@example.com |
10
      | teacher1 | Teacher   | 1        | teacher1@example.com |
11
    And the following "courses" exist:
11
    And the following "courses" exist:
12
      | fullname | shortname | category |
12
      | fullname | shortname | format |
-
 
13
      | Course 1 | C1        | weeks  |
-
 
14
    And the following "activities" exist:
-
 
15
      | activity   | name    | intro           | course | idnumber |
-
 
16
      | qbank      | Qbank 1 | Question bank 1 | C1     | qbank1   |
13
      | Course 1 | C1        | 0        |
17
      | qbank      | Qbank 2 | Question bank 2 | C1     | qbank2   |
14
    And the following "course enrolments" exist:
18
    And the following "course enrolments" exist:
15
      | user     | course | role           |
19
      | user     | course | role           |
16
      | teacher1 | C1     | editingteacher |
20
      | teacher1 | C1     | editingteacher |
17
    And the following "activities" exist:
21
    And the following "system role assigns" exist:
18
      | activity | name      | course | idnumber |
22
      | user     | role           | contextlevel |
-
 
23
      | teacher1 | editingteacher | System       |
-
 
24
    And the following "question categories" exist:
-
 
25
      | contextlevel    | reference | name                   | idnumber     |
-
 
26
      | Activity module | qbank1    | Course category 1      | questioncat1 |
-
 
27
      | Activity module | qbank1    | Course category 2      | questioncat2 |
-
 
28
      | Activity module | qbank1    | Course category 3      | questioncat3 |
-
 
29
    And I am on the "Qbank 1" "core_question > question categories" page logged in as "teacher1"
-
 
30
 
-
 
31
  Scenario: Teacher cannot move or delete single category under context
-
 
32
    And I am on the "Qbank 2" "core_question > question categories" page logged in as "teacher1"
-
 
33
    When I open the action menu in "Default for Qbank 2" "list_item"
-
 
34
    Then I should not see "Delete"
-
 
35
 
-
 
36
  Scenario: Teacher can see complete edit menu if multiples categories exist under context
-
 
37
    When I open the action menu in "Course category 1" "list_item"
-
 
38
    Then I should see "Edit settings"
-
 
39
    And I should see "Delete"
-
 
40
    And I should see "Export as Moodle XML"
-
 
41
 
-
 
42
  Scenario: Teacher can move one category after another
-
 
43
    Given "Course category 1" "list_item" should appear before "Course category 2" "list_item"
-
 
44
    And "Course category 2" "list_item" should appear before "Course category 3" "list_item"
-
 
45
    When I open the action menu in "Course category 1" "list_item"
-
 
46
    And I choose "Move" in the open action menu
-
 
47
    And I click on "After Course category 3" "link" in the "Move Course category 1" "dialogue"
-
 
48
    Then "Course category 2" "list_item" should appear before "Course category 3" "list_item"
-
 
49
    And "Course category 3" "list_item" should appear before "Course category 1" "list_item"
-
 
50
 
-
 
51
  Scenario: Teacher can move one category before another
-
 
52
    Given "Course category 1" "list_item" should appear before "Course category 2" "list_item"
-
 
53
    And "Course category 2" "list_item" should appear before "Course category 3" "list_item"
-
 
54
    And I open the action menu in "Course category 3" "list_item"
-
 
55
    And I choose "Move" in the open action menu
-
 
56
    And I click on "Before Course category 1" "link" in the "Move Course category 3" "dialogue"
-
 
57
    Given "Course category 3" "list_item" should appear before "Course category 1" "list_item"
-
 
58
    And "Course category 1" "list_item" should appear before "Course category 2" "list_item"
-
 
59
 
-
 
60
  Scenario: Teacher can make a category a child of an existing category
-
 
61
    Given "Course category 1" "list_item" should appear before "Course category 2" "list_item"
-
 
62
    And "Course category 2" "list_item" should appear before "Course category 3" "list_item"
-
 
63
    And "Course category 3" "list_item" should not exist in the "Course category 1" "list_item"
-
 
64
    When I open the action menu in "Course category 3" "list_item"
-
 
65
    And I choose "Move" in the open action menu
-
 
66
    And I click on "As new child of Course category 1" "link" in the "Move Course category 3" "dialogue"
-
 
67
    And "Course category 3" "list_item" should appear before "Course category 2" "list_item"
-
 
68
    And "Course category 3" "list_item" should exist in the "Course category 1" "list_item"
-
 
69
 
-
 
70
  Scenario: Teacher can display and hide category descriptions
-
 
71
    Given I am on the "Qbank 2" "core_question > question categories" page logged in as "teacher1"
-
 
72
    When I click on "Show descriptions" "checkbox"
-
 
73
    Then I should see "The default category for questions shared in context 'Qbank 2'."
-
 
74
    And I click on "Show descriptions" "checkbox"
Línea 19... Línea 75...
19
      | quiz     | Test quiz | C1     | quiz1    |
75
    And I should not see "The default category for questions shared in context 'Qbank 2'."
20
 
76
 
21
  Scenario: A question category can be moved to another context
77
  Scenario: Teacher can move a category via the edit form
22
    Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
78
    Given "Course category 1" "list_item" should appear before "Course category 2" "list_item"
23
    And I select "Categories" from the "Question bank tertiary navigation" singleselect
79
    And "Course category 2" "list_item" should appear before "Course category 3" "list_item"
24
    And I follow "Add category"
80
    When I open the action menu in "Course category 3" "list_item"
25
    And I set the following fields to these values:
81
    And I choose "Edit" in the open action menu
26
      | Name            | Test category         |
82
    And I should see "Top for Qbank 1" in the "Parent category" "select"
27
      | Parent category | Top for Test quiz     |
83
    And I should see "Course category 1" in the "Parent category" "field"
28
    And I press "submitbutton"
84
    And I should see "Course category 2" in the "Parent category" "field"
29
    And I click on "Share in context for Course: Course 1" "link" in the "Test category" "list_item"
-
 
30
    Then I should see "Test category" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' questioncategories ') and contains(concat(' ', normalize-space(@class), ' '), ' contextlevel50 ')]" "xpath_element"
85
    And I should not see "Course category 3" in the "Parent category" "field"
31
 
86
    And I set the field "Parent category" to "Course category 1"
32
  Scenario: A question category can be moved to top level
87
    And I press "Save changes"
33
    Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
88
    Then "Course category 1" "list_item" should appear before "Course category 3" "list_item"
34
    And I select "Categories" from the "Question bank tertiary navigation" singleselect
89
    And "Course category 3" "list_item" should appear before "Course category 2" "list_item"
35
    And I follow "Add category"
90
    And I open the action menu in "Course category 1" "list_item"
36
    And I set the following fields to these values:
91
    And I choose "Edit" in the open action menu
37
      | Name            | Test category         |
92
    And I should see "Top for Qbank 1" in the "Parent category" "select"
38
      | Parent category | Default for Test quiz |
-
 
39
      | Category info   | Created as a test     |
93
    And I should not see "Course category 1" in the "Parent category" "field"
40
    And I press "submitbutton"
-
 
41
    And I click on "Move to top level" "link" in the "Test category" "list_item"
-