1 |
efrain |
1 |
@core @core_question
|
|
|
2 |
Feature: A teacher can move question categories in the question bank
|
|
|
3 |
In order to organize my questions
|
|
|
4 |
As a teacher
|
|
|
5 |
I create question categories and move them in the question bank
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | T1 | Teacher1 | teacher1@example.com |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname | category |
|
|
|
13 |
| Course 1 | C1 | 0 |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| teacher1 | C1 | editingteacher |
|
|
|
17 |
And the following "activities" exist:
|
|
|
18 |
| activity | name | course | idnumber |
|
|
|
19 |
| quiz | Test quiz | C1 | quiz1 |
|
|
|
20 |
|
|
|
21 |
Scenario: A question category can be moved to another context
|
|
|
22 |
Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
|
|
|
23 |
And I select "Categories" from the "Question bank tertiary navigation" singleselect
|
|
|
24 |
And I follow "Add category"
|
|
|
25 |
And I set the following fields to these values:
|
|
|
26 |
| Name | Test category |
|
|
|
27 |
| Parent category | Top for Test quiz |
|
|
|
28 |
And I press "submitbutton"
|
|
|
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"
|
|
|
31 |
|
|
|
32 |
Scenario: A question category can be moved to top level
|
|
|
33 |
Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
|
|
|
34 |
And I select "Categories" from the "Question bank tertiary navigation" singleselect
|
|
|
35 |
And I follow "Add category"
|
|
|
36 |
And I set the following fields to these values:
|
|
|
37 |
| Name | Test category |
|
|
|
38 |
| Parent category | Default for Test quiz |
|
|
|
39 |
| Category info | Created as a test |
|
|
|
40 |
And I press "submitbutton"
|
|
|
41 |
And I click on "Move to top level" "link" in the "Test category" "list_item"
|
|
|
42 |
Then I should see "Test category" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' questioncategories ') and contains(concat(' ', normalize-space(@class), ' '), ' contextlevel70 ')]" "xpath_element"
|
|
|
43 |
And "//div[contains(concat(' ', normalize-space(@class), ' '), ' questioncategories ') and contains(concat(' ', normalize-space(@class), ' '), ' contextlevel70 ')]//li//ul" "xpath_element" should not exist
|