Rev 1 | AutorÃa | Comparar con el anterior | Ultima modificación | Ver Log |
@qbank @qbank_managecategories @category_reorder @javascriptFeature: A teacher can reorder question categoriesIn order to change question category orderAs a teacherI need to reorder themBackground:Given the following "users" exist:| username | firstname | lastname | email || teacher1 | Teacher | 1 | teacher1@example.com |And the following "courses" exist:| fullname | shortname | format || Course 1 | C1 | weeks |And the following "activities" exist:| activity | name | intro | course | idnumber || qbank | Qbank 1 | Question bank 1 | C1 | qbank1 || qbank | Qbank 2 | Question bank 2 | C1 | qbank2 |And the following "course enrolments" exist:| user | course | role || teacher1 | C1 | editingteacher |And the following "system role assigns" exist:| user | role | contextlevel || teacher1 | editingteacher | System |And the following "question categories" exist:| contextlevel | reference | name | idnumber || Activity module | qbank1 | Course category 1 | questioncat1 || Activity module | qbank1 | Course category 2 | questioncat2 || Activity module | qbank1 | Course category 3 | questioncat3 |And I am on the "Qbank 1" "core_question > question categories" page logged in as "teacher1"Scenario: Teacher cannot move or delete single category under contextAnd I am on the "Qbank 2" "core_question > question categories" page logged in as "teacher1"When I open the action menu in "Default for Qbank 2" "list_item"Then I should not see "Delete"Scenario: Teacher can see complete edit menu if multiples categories exist under contextWhen I open the action menu in "Course category 1" "list_item"Then I should see "Edit settings"And I should see "Delete"And I should see "Export as Moodle XML"Scenario: Teacher can move one category after anotherGiven "Course category 1" "list_item" should appear before "Course category 2" "list_item"And "Course category 2" "list_item" should appear before "Course category 3" "list_item"When I open the action menu in "Course category 1" "list_item"And I choose "Move" in the open action menuAnd I click on "After Course category 3" "link" in the "Move Course category 1" "dialogue"Then "Course category 2" "list_item" should appear before "Course category 3" "list_item"And "Course category 3" "list_item" should appear before "Course category 1" "list_item"Scenario: Teacher can move one category before anotherGiven "Course category 1" "list_item" should appear before "Course category 2" "list_item"And "Course category 2" "list_item" should appear before "Course category 3" "list_item"And I open the action menu in "Course category 3" "list_item"And I choose "Move" in the open action menuAnd I click on "Before Course category 1" "link" in the "Move Course category 3" "dialogue"Given "Course category 3" "list_item" should appear before "Course category 1" "list_item"And "Course category 1" "list_item" should appear before "Course category 2" "list_item"Scenario: Teacher can make a category a child of an existing categoryGiven "Course category 1" "list_item" should appear before "Course category 2" "list_item"And "Course category 2" "list_item" should appear before "Course category 3" "list_item"And "Course category 3" "list_item" should not exist in the "Course category 1" "list_item"When I open the action menu in "Course category 3" "list_item"And I choose "Move" in the open action menuAnd I click on "As new child of Course category 1" "link" in the "Move Course category 3" "dialogue"And "Course category 3" "list_item" should appear before "Course category 2" "list_item"And "Course category 3" "list_item" should exist in the "Course category 1" "list_item"Scenario: Teacher can display and hide category descriptionsGiven I am on the "Qbank 2" "core_question > question categories" page logged in as "teacher1"When I click on "Show descriptions" "checkbox"Then I should see "The default category for questions shared in context 'Qbank 2'."And I click on "Show descriptions" "checkbox"And I should not see "The default category for questions shared in context 'Qbank 2'."Scenario: Teacher can move a category via the edit formGiven "Course category 1" "list_item" should appear before "Course category 2" "list_item"And "Course category 2" "list_item" should appear before "Course category 3" "list_item"When I open the action menu in "Course category 3" "list_item"And I choose "Edit" in the open action menuAnd I should see "Top for Qbank 1" in the "Parent category" "select"And I should see "Course category 1" in the "Parent category" "field"And I should see "Course category 2" in the "Parent category" "field"And I should not see "Course category 3" in the "Parent category" "field"And I set the field "Parent category" to "Course category 1"And I press "Save changes"Then "Course category 1" "list_item" should appear before "Course category 3" "list_item"And "Course category 3" "list_item" should appear before "Course category 2" "list_item"And I open the action menu in "Course category 1" "list_item"And I choose "Edit" in the open action menuAnd I should see "Top for Qbank 1" in the "Parent category" "select"And I should not see "Course category 1" in the "Parent category" "field"And I should see "Course category 2" in the "Parent category" "field"And I should not see "Course category 3" in the "Parent category" "field"