1 |
efrain |
1 |
@qbank @qbank_viewquestiontext
|
|
|
2 |
Feature: Use the qbank plugin manager page for viewquestiontext
|
|
|
3 |
In order to check the plugin behaviour with enable and disable
|
|
|
4 |
|
|
|
5 |
Background:
|
|
|
6 |
Given the following "courses" exist:
|
|
|
7 |
| fullname | shortname | category |
|
|
|
8 |
| Course 1 | C1 | 0 |
|
|
|
9 |
And the following "activities" exist:
|
|
|
10 |
| activity | name | course | idnumber |
|
|
|
11 |
| quiz | Test quiz | C1 | quiz1 |
|
|
|
12 |
And the following "question categories" exist:
|
|
|
13 |
| contextlevel | reference | name |
|
|
|
14 |
| Course | C1 | Test questions |
|
|
|
15 |
And the following "questions" exist:
|
|
|
16 |
| questioncategory | qtype | name | questiontext |
|
|
|
17 |
| Test questions | truefalse | First question | Answer the <span class="totestforhtml">first</span> <question> |
|
|
|
18 |
|
|
|
19 |
@javascript
|
|
|
20 |
Scenario: Display of plain question text can be turned on and off
|
|
|
21 |
When I am on the "Test quiz" "mod_quiz > question bank" page logged in as admin
|
|
|
22 |
And I set the field "Show question text in the question list?" to "text only"
|
|
|
23 |
Then I should see "Answer the first <question>"
|
|
|
24 |
And ".totestforhtml" "css_element" should not exist in the "Answer the first <question>" "table_row"
|
|
|
25 |
And I set the field "Show question text in the question list?" to "No"
|
|
|
26 |
And I should not see "Answer the first <question>"
|
|
|
27 |
|
|
|
28 |
@javascript
|
|
|
29 |
Scenario: Display of full question text can be turned on and off
|
|
|
30 |
When I am on the "Test quiz" "mod_quiz > question bank" page logged in as admin
|
|
|
31 |
And I set the field "Show question text in the question list?" to "with images"
|
|
|
32 |
Then I should see "Answer the first <question>"
|
|
|
33 |
And ".totestforhtml" "css_element" should exist in the "Answer the first <question>" "table_row"
|
|
|
34 |
And I set the field "Show question text in the question list?" to "No"
|
|
|
35 |
And I should not see "Answer the first <question>"
|
|
|
36 |
|
|
|
37 |
@javascript
|
|
|
38 |
Scenario: Option does not show if the plugin is disabled
|
|
|
39 |
Given the following config values are set as admin:
|
|
|
40 |
| disabled | 1 | qbank_viewquestiontext |
|
|
|
41 |
When I am on the "Test quiz" "mod_quiz > question bank" page logged in as admin
|
|
|
42 |
Then I should not see "Show question text in the question list"
|
|
|
43 |
|
|
|
44 |
@javascript
|
|
|
45 |
Scenario: Enable/disable viewquestiontext column from the base view
|
|
|
46 |
Given I log in as "admin"
|
|
|
47 |
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
|
|
48 |
And I should see "View question text"
|
|
|
49 |
When I click on "Disable" "link" in the "View question text" "table_row"
|
|
|
50 |
And I am on the "Test quiz" "mod_quiz > question bank" page
|
|
|
51 |
And I should not see "Show question text in the question list"
|
|
|
52 |
Then "#categoryquestions .questiontext" "css_element" should not be visible
|
|
|
53 |
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
|
|
54 |
And I click on "Enable" "link" in the "View question text" "table_row"
|
|
|
55 |
And I am on the "Test quiz" "mod_quiz > question bank" page
|
|
|
56 |
When I set the field "Show question text in the question list?" to "text only"
|
|
|
57 |
And I should see "Answer the first <question>"
|