1441 |
ariadna |
1 |
@mod @mod_qbank @javascript
|
|
|
2 |
Feature: Switching question bank when adding questions to a quiz
|
|
|
3 |
In order to re-use questions
|
|
|
4 |
As a teacher
|
|
|
5 |
I want to be able to switch to other banks I have access to.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username |
|
|
|
10 |
| teacher |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname |
|
|
|
13 |
| Course 1 | C1 |
|
|
|
14 |
| Course 2 | C2 |
|
|
|
15 |
| Course 3 | C3 |
|
|
|
16 |
And the following "course enrolments" exist:
|
|
|
17 |
| user | course | role |
|
|
|
18 |
| teacher | C1 | editingteacher |
|
|
|
19 |
| teacher | C2 | teacher |
|
|
|
20 |
And the following "activities" exist:
|
|
|
21 |
| activity | name | intro | course | idnumber |
|
|
|
22 |
| quiz | Quiz 1 | Quiz 1 for testing the Add menu | C1 | quiz1 |
|
|
|
23 |
| qbank | Qbank 1 | Question bank 1 for testing the Add menu | C1 | qbank1 |
|
|
|
24 |
| qbank | Qbank 2 | Question bank 2 for testing the Add menu | C1 | qbank2 |
|
|
|
25 |
| qbank | Qbank 3 | Question bank 3 for testing the Add menu | C2 | qbank3 |
|
|
|
26 |
| qbank | Qbank 4 | Question bank 4 for testing the Add menu | C3 | qbank4 |
|
|
|
27 |
And the following "question categories" exist:
|
|
|
28 |
| contextlevel | reference | name |
|
|
|
29 |
| Activity module | qbank1 | Test questions 1 |
|
|
|
30 |
| Activity module | qbank2 | Test questions 2 |
|
|
|
31 |
| Activity module | qbank3 | Test questions 3 |
|
|
|
32 |
| Activity module | qbank4 | Test questions 4 |
|
|
|
33 |
| Activity module | quiz1 | Test questions 5 |
|
|
|
34 |
And I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher"
|
|
|
35 |
|
|
|
36 |
Scenario: Switching to another bank shows the expected banks
|
|
|
37 |
When I open the "last" add to quiz menu
|
|
|
38 |
And I follow "from question bank"
|
|
|
39 |
When I click on "Switch bank" "button"
|
|
|
40 |
Then I should see "Quiz 1"
|
|
|
41 |
And I should see "Qbank 1"
|
|
|
42 |
And I should see "Qbank 2"
|
|
|
43 |
But I should not see "Qbank 3"
|
|
|
44 |
|
|
|
45 |
Scenario: Searching for another shared bank shows the expected bank
|
|
|
46 |
When I open the "last" add to quiz menu
|
|
|
47 |
And I follow "from question bank"
|
|
|
48 |
When I click on "Switch bank" "button"
|
|
|
49 |
And I open the autocomplete suggestions list
|
|
|
50 |
Then "Qbank 3" "autocomplete_suggestions" should exist
|
|
|
51 |
But "Qbank 4" "autocomplete_suggestions" should not exist
|
|
|
52 |
And I click on "C2 - Qbank 3" item in the autocomplete list
|
|
|
53 |
And I should see "Current bank: Qbank 3"
|
|
|
54 |
And I should see "Default for Qbank 3"
|
|
|
55 |
|
|
|
56 |
Scenario: Viewing question banks not in the current course show as recently accessed
|
|
|
57 |
Given "teacher" has recently viewed the "qbank1" "qbank" question bank
|
|
|
58 |
And "teacher" has recently viewed the "qbank2" "qbank" question bank
|
|
|
59 |
And "teacher" has recently viewed the "qbank3" "qbank" question bank
|
|
|
60 |
And "teacher" has recently viewed the "Quiz 1" "quiz" question bank
|
|
|
61 |
When I open the "last" add to quiz menu
|
|
|
62 |
And I follow "from question bank"
|
|
|
63 |
And I click on "Switch bank" "button"
|
|
|
64 |
Then I should see "Qbank 3"
|
|
|
65 |
But I should not see "Qbank 4"
|