| 1441 |
ariadna |
1 |
@qbank @qbank_managecategories @question_categories_idnumber @javascript
|
| 1 |
efrain |
2 |
Feature: A teacher can put questions with idnumbers in categories with idnumbers in the question bank
|
|
|
3 |
In order to organize my questions
|
|
|
4 |
As a teacher
|
|
|
5 |
I create and edit categories (now with idnumbers)
|
|
|
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 |
|
| 1441 |
ariadna |
17 |
And the following "activities" exist:
|
|
|
18 |
| activity | name | course | idnumber |
|
|
|
19 |
| qbank | Qbank 1 | C1 | qbank1 |
|
| 1 |
efrain |
20 |
And I log in as "teacher1"
|
|
|
21 |
And I am on "Course 1" course homepage
|
|
|
22 |
|
|
|
23 |
Scenario: A new question category can only be created with a unique idnumber for a context
|
|
|
24 |
# Note need to create the top category each time.
|
|
|
25 |
When the following "question categories" exist:
|
| 1441 |
ariadna |
26 |
| contextlevel | reference | questioncategory | name | idnumber |
|
|
|
27 |
| Activity module | qbank1 | top | Used category | c1used |
|
|
|
28 |
And I am on the "Qbank 1" "core_question > question categories" page
|
|
|
29 |
And I press "Add category"
|
| 1 |
efrain |
30 |
And I set the following fields to these values:
|
| 1441 |
ariadna |
31 |
| Name | New cat |
|
|
|
32 |
| Parent category | Top for Qbank 1 |
|
| 1 |
efrain |
33 |
| Category info | Created as a test |
|
|
|
34 |
| ID number | c1used |
|
| 1441 |
ariadna |
35 |
And I click on "Add category" "button" in the "Add category" "dialogue"
|
| 1 |
efrain |
36 |
# Standard warning.
|
|
|
37 |
Then I should see "This ID number is already in use"
|
|
|
38 |
# Correction to a unique idnumber for the context.
|
|
|
39 |
And I set the field "ID number" to "c1unused"
|
| 1441 |
ariadna |
40 |
And I click on "Add category" "button" in the "Add category" "dialogue"
|
|
|
41 |
Then I should see "New cat"
|
| 1 |
efrain |
42 |
And I should see "ID number"
|
|
|
43 |
And I should see "c1unused"
|
|
|
44 |
And I should see "(0)"
|
| 1441 |
ariadna |
45 |
And I click on "Show descriptions" "checkbox"
|
|
|
46 |
And I should see "Created as a test" in the "New cat" "list_item"
|
| 1 |
efrain |
47 |
|
|
|
48 |
Scenario: A question category can be edited and saved without changing the idnumber
|
|
|
49 |
When the following "question categories" exist:
|
| 1441 |
ariadna |
50 |
| contextlevel | reference | questioncategory | name | idnumber |
|
|
|
51 |
| Activity module | qbank1 | top | Used category | c1used |
|
|
|
52 |
And I am on the "Qbank 1" "core_question > question categories" page
|
|
|
53 |
Then I open the action menu in "Used category" "list_item"
|
|
|
54 |
And I choose "Edit settings" in the open action menu
|
|
|
55 |
And I click on "Save changes" "button" in the "Edit category" "dialogue"
|
| 1 |
efrain |
56 |
Then I should not see "This ID number is already in use"
|