| 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:
 | 
        
           | 1441 | ariadna | 13 |       | contextlevel    | reference | name           |
 | 
        
           |  |  | 14 |       | Activity module | quiz1     | Test questions |
 | 
        
           | 1 | efrain | 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
 | 
        
           | 1441 | ariadna | 22 |     And I apply question bank filter "Category" with value "Test questions"
 | 
        
           | 1 | efrain | 23 |     And I set the field "Show question text in the question list?" to "text only"
 | 
        
           |  |  | 24 |     Then I should see "Answer the first <question>"
 | 
        
           |  |  | 25 |     And ".totestforhtml" "css_element" should not exist in the "Answer the first <question>" "table_row"
 | 
        
           |  |  | 26 |     And I set the field "Show question text in the question list?" to "No"
 | 
        
           |  |  | 27 |     And I should not see "Answer the first <question>"
 | 
        
           |  |  | 28 |   | 
        
           |  |  | 29 |   @javascript
 | 
        
           |  |  | 30 |   Scenario: Display of full question text can be turned on and off
 | 
        
           |  |  | 31 |     When I am on the "Test quiz" "mod_quiz > question bank" page logged in as admin
 | 
        
           | 1441 | ariadna | 32 |     And I apply question bank filter "Category" with value "Test questions"
 | 
        
           | 1 | efrain | 33 |     And I set the field "Show question text in the question list?" to "with images"
 | 
        
           |  |  | 34 |     Then I should see "Answer the first <question>"
 | 
        
           |  |  | 35 |     And ".totestforhtml" "css_element" should exist in the "Answer the first <question>" "table_row"
 | 
        
           |  |  | 36 |     And I set the field "Show question text in the question list?" to "No"
 | 
        
           |  |  | 37 |     And I should not see "Answer the first <question>"
 | 
        
           |  |  | 38 |   | 
        
           |  |  | 39 |   @javascript
 | 
        
           |  |  | 40 |   Scenario: Option does not show if the plugin is disabled
 | 
        
           |  |  | 41 |     Given the following config values are set as admin:
 | 
        
           |  |  | 42 |       | disabled | 1 | qbank_viewquestiontext |
 | 
        
           |  |  | 43 |     When I am on the "Test quiz" "mod_quiz > question bank" page logged in as admin
 | 
        
           |  |  | 44 |     Then I should not see "Show question text in the question list"
 | 
        
           |  |  | 45 |   | 
        
           |  |  | 46 |   @javascript
 | 
        
           |  |  | 47 |   Scenario: Enable/disable viewquestiontext column from the base view
 | 
        
           |  |  | 48 |     Given I log in as "admin"
 | 
        
           |  |  | 49 |     And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
 | 
        
           |  |  | 50 |     And I should see "View question text"
 | 
        
           |  |  | 51 |     When I click on "Disable" "link" in the "View question text" "table_row"
 | 
        
           |  |  | 52 |     And I am on the "Test quiz" "mod_quiz > question bank" page
 | 
        
           |  |  | 53 |     And I should not see "Show question text in the question list"
 | 
        
           |  |  | 54 |     Then "#categoryquestions .questiontext" "css_element" should not be visible
 | 
        
           |  |  | 55 |     And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
 | 
        
           |  |  | 56 |     And I click on "Enable" "link" in the "View question text" "table_row"
 | 
        
           |  |  | 57 |     And I am on the "Test quiz" "mod_quiz > question bank" page
 | 
        
           | 1441 | ariadna | 58 |     And I apply question bank filter "Category" with value "Test questions"
 | 
        
           | 1 | efrain | 59 |     When I set the field "Show question text in the question list?" to "text only"
 | 
        
           |  |  | 60 |     And I should see "Answer the first <question>"
 |