Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1441 ariadna 1
@qbank @qbank_managecategories @category_reorder @javascript
2
Feature: A teacher can reorder question categories
3
  In order to change question category order
1 efrain 4
  As a teacher
1441 ariadna 5
  I need to reorder them
1 efrain 6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
1441 ariadna 10
      | teacher1 | Teacher   | 1        | teacher1@example.com |
1 efrain 11
    And the following "courses" exist:
1441 ariadna 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   |
17
      | qbank      | Qbank 2 | Question bank 2 | C1     | qbank2   |
1 efrain 18
    And the following "course enrolments" exist:
19
      | user     | course | role           |
20
      | teacher1 | C1     | editingteacher |
1441 ariadna 21
    And the following "system role assigns" exist:
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"
1 efrain 30
 
1441 ariadna 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"
1 efrain 35
 
1441 ariadna 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"
75
    And I should not see "The default category for questions shared in context 'Qbank 2'."
76
 
77
  Scenario: Teacher can move a category via the edit form
78
    Given "Course category 1" "list_item" should appear before "Course category 2" "list_item"
79
    And "Course category 2" "list_item" should appear before "Course category 3" "list_item"
80
    When I open the action menu in "Course category 3" "list_item"
81
    And I choose "Edit" in the open action menu
82
    And I should see "Top for Qbank 1" in the "Parent category" "select"
83
    And I should see "Course category 1" in the "Parent category" "field"
84
    And I should see "Course category 2" in the "Parent category" "field"
85
    And I should not see "Course category 3" in the "Parent category" "field"
86
    And I set the field "Parent category" to "Course category 1"
87
    And I press "Save changes"
88
    Then "Course category 1" "list_item" should appear before "Course category 3" "list_item"
89
    And "Course category 3" "list_item" should appear before "Course category 2" "list_item"
90
    And I open the action menu in "Course category 1" "list_item"
91
    And I choose "Edit" in the open action menu
92
    And I should see "Top for Qbank 1" in the "Parent category" "select"
93
    And I should not see "Course category 1" in the "Parent category" "field"
94
    And I should see "Course category 2" in the "Parent category" "field"
95
    And I should not see "Course category 3" in the "Parent category" "field"