1 |
efrain |
1 |
@core @core_question
|
|
|
2 |
Feature: An activity module instance with questions in its context can be deleted
|
|
|
3 |
In order to delete an activity module from the course
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to be able to delete the activity even if it has questions created in its context
|
|
|
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 |
|
|
|
18 |
Scenario: Synchronously deleting a quiz with existing questions in its context
|
|
|
19 |
Given the following config values are set as admin:
|
|
|
20 |
| coursebinenable | 0 | tool_recyclebin |
|
|
|
21 |
And the following "activity" exists:
|
|
|
22 |
| activity | quiz |
|
|
|
23 |
| course | C1 |
|
|
|
24 |
| name | Test quiz Q001 |
|
|
|
25 |
And the following "question categories" exist:
|
|
|
26 |
| contextlevel | reference | name |
|
|
|
27 |
| Activity module | Test quiz Q001 | Default for Test quiz Q001 |
|
|
|
28 |
And the following "questions" exist:
|
|
|
29 |
| questioncategory | qtype | name | questiontext |
|
|
|
30 |
| Default for Test quiz Q001 | truefalse | Test used question to be deleted | Write about whatever you want |
|
|
|
31 |
And quiz "Test quiz Q001" contains the following questions:
|
|
|
32 |
| question | page |
|
|
|
33 |
| Test used question to be deleted | 1 |
|
|
|
34 |
And I am on the "Course 1" course page logged in as teacher1
|
|
|
35 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
36 |
When I delete "Test quiz Q001" activity
|
|
|
37 |
Then I should not see "Test quiz Q001"
|