1 |
efrain |
1 |
@core @core_question
|
|
|
2 |
Feature: A teacher can duplicate questions in the question bank
|
|
|
3 |
In order to efficiently expand my question bank
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to be able to duplicate existing questions and make small changes
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher | Teacher | One | teacher@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 |
| teacher | C1 | editingteacher |
|
|
|
17 |
And the following "question categories" exist:
|
|
|
18 |
| contextlevel | reference | name |
|
|
|
19 |
| Course | C1 | Test questions |
|
|
|
20 |
And the following "questions" exist:
|
|
|
21 |
| questioncategory | qtype | name | questiontext | idnumber |
|
|
|
22 |
| Test questions | essay | Test question to be copied | Write about whatever you want | qid |
|
|
|
23 |
And I am on the "Course 1" "core_question > course question bank" page logged in as "teacher"
|
|
|
24 |
|
|
|
25 |
Scenario: Duplicating a previously created question
|
|
|
26 |
When I choose "Duplicate" action for "Test question to be copied" in the question bank
|
|
|
27 |
And I set the following fields to these values:
|
|
|
28 |
| Question name | Duplicated question name |
|
|
|
29 |
| Question text | Write a lot about duplicating questions |
|
|
|
30 |
And I press "id_submitbutton"
|
|
|
31 |
Then I should see "Duplicated question name"
|
|
|
32 |
And I should see "Test question to be copied"
|
|
|
33 |
And I should see "ID number" in the "Test question to be copied" "table_row"
|
|
|
34 |
And I should see "qid" in the "Test question to be copied" "table_row"
|
|
|
35 |
|
|
|
36 |
Scenario: Duplicated questions automatically get a new name suggested
|
|
|
37 |
When I choose "Duplicate" action for "Test question to be copied" in the question bank
|
|
|
38 |
Then the field "Question name" matches value "Test question to be copied (copy)"
|
|
|
39 |
|
|
|
40 |
@javascript
|
|
|
41 |
Scenario: The duplicate operation can be cancelled
|
|
|
42 |
When I choose "Duplicate" action for "Test question to be copied" in the question bank
|
|
|
43 |
And I press "Cancel"
|
|
|
44 |
Then I should see "Test question to be copied"
|
|
|
45 |
And I should see "Test questions (1)" in the "Filter 1" "fieldset"
|
|
|
46 |
|
|
|
47 |
Scenario: Duplicating a question with an idnumber increments it
|
|
|
48 |
Given the following "questions" exist:
|
|
|
49 |
| questioncategory | qtype | name | questiontext | idnumber |
|
|
|
50 |
| Test questions | essay | Question with idnumber | Write about whatever you want | id101 |
|
|
|
51 |
And I reload the page
|
|
|
52 |
When I choose "Duplicate" action for "Question with idnumber" in the question bank
|
|
|
53 |
And I press "id_submitbutton"
|
|
|
54 |
Then I should see "Question with idnumber (copy)"
|
|
|
55 |
Then I should see "id102" in the "Question with idnumber (copy)" "table_row"
|