Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@qbank @qbank_usage
2
Feature: Use the qbank plugin manager page for question usage
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 first question |
18
 
19
  Scenario: Enable/disable question usage column from the base view
20
    Given I log in as "admin"
21
    And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
22
    And I should see "Question usage"
23
    When I click on "Disable" "link" in the "Question usage" "table_row"
24
    And I am on the "Test quiz" "mod_quiz > question bank" page
25
    Then I should not see "Usage"
26
    And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
27
    And I click on "Enable" "link" in the "Question usage" "table_row"
28
    And I am on the "Test quiz" "mod_quiz > question bank" page
29
    And I should see "Usage"
30
 
31
  @javascript
32
  Scenario: Question usage modal should work without any usage data
33
    And I am on the "Test quiz" "mod_quiz > question bank" page logged in as "admin"
34
    And I apply question bank filter "Category" with value "Test questions"
35
    And I should see "Test questions"
36
    And I should see "0" on the usage column
37
    When I click "0" on the usage column
38
    Then I should see "Version 1"
39
    And I should see "v1 (latest)" in the "Question 1" "question"
40
    And I click on "Close" "button" in the ".modal-dialog" "css_element"
41
    And I should see "0" on the usage column
42
 
43
  @javascript
44
  Scenario: Question usage modal should work with usage data
45
    Given quiz "Test quiz" contains the following questions:
46
      | question       | page |
47
      | First question | 1    |
48
    And I am on the "Test quiz" "mod_quiz > question bank" page logged in as "admin"
49
    And I apply question bank filter "Category" with value "Test questions"
50
    And I should see "Test questions"
51
    And I should see "1" on the usage column
52
    When I click "1" on the usage column
53
    Then "Test quiz" "table_row" should exist in the "question-usage_table" "region"