1 |
efrain |
1 |
@qbank @qbank_viewquestionname @javascript
|
|
|
2 |
Feature: Use the qbank view page to edit question title using in place edit feature
|
|
|
3 |
|
|
|
4 |
Background:
|
|
|
5 |
Given the following "users" exist:
|
|
|
6 |
| username | firstname | lastname | email |
|
|
|
7 |
| teacher1 | T1 | Teacher1 | teacher1@example.com |
|
|
|
8 |
And the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category |
|
|
|
10 |
| Course 1 | C1 | 0 |
|
|
|
11 |
And the following "course enrolments" exist:
|
|
|
12 |
| user | course | role |
|
|
|
13 |
| teacher1 | C1 | editingteacher |
|
|
|
14 |
And the following "activities" exist:
|
|
|
15 |
| activity | name | course | idnumber |
|
|
|
16 |
| quiz | Test quiz | C1 | quiz1 |
|
|
|
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 |
|
|
|
22 |
| Test questions | truefalse | First question | Answer the first question |
|
|
|
23 |
|
|
|
24 |
Scenario: Question title can be changed from the question bank view
|
|
|
25 |
Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
|
|
|
26 |
And I set the field "Filter type" to "Category"
|
|
|
27 |
And I set the field "Category" to "Test questions"
|
|
|
28 |
And I press "Apply filters"
|
|
|
29 |
When I set the field "Edit question name" in the "First question" "table_row" to "Edited question"
|
|
|
30 |
Then I should not see "First question"
|
|
|
31 |
And I should see "Edited question"
|
|
|
32 |
|
|
|
33 |
Scenario: Teacher without permission can not change the title from question bank view
|
|
|
34 |
Given the following "role capability" exists:
|
|
|
35 |
| role | editingteacher |
|
|
|
36 |
| moodle/question:editall | prevent |
|
|
|
37 |
And I am on the "Test quiz" "mod_quiz > question bank" page logged in as "teacher1"
|
|
|
38 |
And I set the field "Filter type" to "Category"
|
|
|
39 |
And I set the field "Category" to "Test questions"
|
|
|
40 |
And I press "Apply filters"
|
|
|
41 |
And I should see "First question"
|
|
|
42 |
And "Edit question name" "field" should not exist
|