1 |
efrain |
1 |
@mod @mod_quiz @javascript
|
|
|
2 |
Feature: Editing random questions already in a quiz based on category and tags
|
|
|
3 |
In order to have better assessment
|
|
|
4 |
As a teacher
|
|
|
5 |
I want to be able to update how questions are randomly picked from the question bank
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | t1@example.com |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname |
|
|
|
13 |
| Course 1 | C1 |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| teacher1 | C1 | editingteacher |
|
|
|
17 |
And the following "activities" exist:
|
|
|
18 |
| activity | name | intro | course | idnumber |
|
|
|
19 |
| quiz | Quiz 1 | Quiz 1 for testing the Add random question form | C1 | quiz1 |
|
|
|
20 |
And the following "question categories" exist:
|
|
|
21 |
| contextlevel | reference | name |
|
|
|
22 |
| Course | C1 | Questions Category 1|
|
|
|
23 |
| Course | C1 | Questions Category 2|
|
|
|
24 |
And the following "questions" exist:
|
|
|
25 |
| questioncategory | qtype | name | user | questiontext |
|
|
|
26 |
| Questions Category 1 | essay | question 1 name | admin | Question 1 text |
|
|
|
27 |
| Questions Category 1 | essay | question 2 name | teacher1 | Question 2 text |
|
|
|
28 |
And the following "core_question > Tags" exist:
|
|
|
29 |
| question | tag |
|
|
|
30 |
| question 1 name | easy |
|
|
|
31 |
| question 1 name | essay |
|
|
|
32 |
| question 2 name | hard |
|
|
|
33 |
| question 2 name | essay |
|
|
|
34 |
|
|
|
35 |
Scenario: Editing tags on one slot does not delete the rest
|
|
|
36 |
Given I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
|
|
|
37 |
And I open the "last" add to quiz menu
|
|
|
38 |
And I follow "a random question"
|
|
|
39 |
# To actually reproduce MDL-68733 it would be better to set tags easy,essay here, and then below just delete one tag.
|
|
|
40 |
# However, the state of Behat for autocomplete fields does not let us actually do that.
|
|
|
41 |
And I apply question bank filter "Tag" with value "easy"
|
|
|
42 |
And I press "Add random question"
|
|
|
43 |
And I open the "Page 1" add to quiz menu
|
|
|
44 |
And I follow "a random question"
|
|
|
45 |
And I apply question bank filter "Tag" with value "hard"
|
|
|
46 |
And I press "Add random question"
|
|
|
47 |
And I follow "Add page break"
|
|
|
48 |
When I click on "Configure question" "link" in the "Random question based on filter condition with tags: easy" "list_item"
|
|
|
49 |
And I apply question bank filter "Tag" with value "essay"
|
|
|
50 |
And I press "Update filter conditions"
|
|
|
51 |
Then I should see "Random question based on filter condition with tags: essay" on quiz page "1"
|
|
|
52 |
And I should see "Random question based on filter condition with tags: hard" on quiz page "2"
|
|
|
53 |
And I click on "Configure question" "link" in the "Random question based on filter condition with tags: hard" "list_item"
|
|
|
54 |
And "hard" "autocomplete_selection" should be visible
|