Commit | Line | Data |
---|---|---|
b54f5086 AD |
1 | @core @core_question |
2 | Feature: A teacher can put questions in categories in the question bank | |
3 | In order to organize their questions | |
4 | As a teacher | |
5 | I need to put questions in categories | |
afc33a9a | 6 | |
b54f5086 AD |
7 | Background: |
8 | Given the following "users" exists: | |
9 | | username | firstname | lastname | email | | |
10 | | teacher1 | Teacher | 1 | teacher1@asd.com | | |
11 | And the following "courses" exists: | |
12 | | fullname | shortname | format | | |
13 | | Course 1 | C1 | weeks | | |
14 | And the following "course enrolments" exists: | |
15 | | user | course | role | | |
16 | | teacher1 | C1 | editingteacher | | |
17 | And I log in as "teacher1" | |
18 | And I follow "Course 1" | |
19 | # Add 2 test categories. | |
20 | And I follow "Question bank" | |
21 | And I follow "Categories" | |
22 | And I fill the moodle form with: | |
23 | | Name | New Category 1 | | |
24 | | Parent category | Top | | |
25 | And I press "id_submitbutton" | |
26 | And I fill the moodle form with: | |
27 | | Name | New Category 2 | | |
28 | | Parent category | Top | | |
29 | And I press "id_submitbutton" | |
30 | # Add test question. | |
31 | And I add a "Essay" question filling the form with: | |
32 | | Question name | my test question | | |
33 | | Question text | my test question | | |
34 | | Category | New Category 1 | | |
35 | ||
36 | @javascript | |
37 | Scenario: Move a question between categories via the question page | |
38 | When I select "New Category 1 (1)" from "category" | |
39 | And I click on "my test question" "checkbox" in the "my test question" "table_row" | |
40 | And I select "New Category 2" from "menucategory" | |
41 | And I press "Move to >>" | |
42 | Then I should see "my test question" | |
43 | And the "category" select box should contain "New Category 2 (1)" | |
44 | And the "category" select box should contain "New Category 1" | |
45 | And the "category" select box should not contain "New Category 1 (1)" | |
46 | ||
47 | @javascript | |
48 | Scenario: Move a question between categories via the question settings page | |
49 | When I click on "Edit" "link" in the "my test question" "table_row" | |
50 | And I click on "Use this category" "checkbox" | |
51 | And I select "New Category 2" from "Save in category" | |
52 | And I press "Save changes" | |
53 | Then I should see "my test question" | |
54 | And the "category" select box should contain "New Category 2 (1)" | |
55 | And the "category" select box should not contain "New Category 1 (1)" | |
afc33a9a | 56 | |
b54f5086 AD |
57 | @javascript |
58 | Scenario: Delete a question category | |
59 | When I follow "Categories" | |
60 | And I click on "Delete" "link" in the "//a[text()='New Category 1']/parent::b/parent::li" "xpath_element" | |
61 | Then I should see "The category 'New Category 1' contains 1 questions" | |
62 | And I press "Save in category" | |
63 | And I should not see "New Category 1" |