1 |
efrain |
1 |
@core @core_question
|
|
|
2 |
Feature: A teacher can move questions between categories in the question bank
|
|
|
3 |
In order to organize my questions
|
|
|
4 |
As a teacher
|
|
|
5 |
I move questions between categories
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname | format |
|
|
|
13 |
| Course 1 | C1 | weeks |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| teacher1 | C1 | editingteacher |
|
|
|
17 |
And the following "question categories" exist:
|
|
|
18 |
| contextlevel | reference | questioncategory | name |
|
|
|
19 |
| Course | C1 | Top | top |
|
|
|
20 |
| Course | C1 | top | Default for C1 |
|
|
|
21 |
| Course | C1 | Default for C1 | Subcategory |
|
|
|
22 |
| Course | C1 | top | Used category |
|
|
|
23 |
And the following "questions" exist:
|
|
|
24 |
| questioncategory | qtype | name | questiontext |
|
|
|
25 |
| Used category | essay | Test question to be moved | Write about whatever you want |
|
|
|
26 |
And I log in as "teacher1"
|
|
|
27 |
And I am on "Course 1" course homepage
|
|
|
28 |
|
|
|
29 |
@javascript
|
|
|
30 |
Scenario: Move a question between categories via the question page
|
|
|
31 |
When I am on the "Course 1" "core_question > course question bank" page logged in as "teacher1"
|
|
|
32 |
And I apply question bank filter "Category" with value "Used category"
|
|
|
33 |
And I click on "Test question to be moved" "checkbox" in the "Test question to be moved" "table_row"
|
|
|
34 |
And I click on "With selected" "button"
|
|
|
35 |
And I click on question bulk action "move"
|
|
|
36 |
And I set the field "Question category" to "Subcategory"
|
|
|
37 |
And I press "Move to"
|
|
|
38 |
Then I should see "Test question to be moved"
|
|
|
39 |
And I should see "Subcategory (1)" in the ".form-autocomplete-selection" "css_element"
|