Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@block @block_glossary_random
2
Feature: Random glossary entry block linking to global glossary
3
  In order to show the entries from glossary
4
  As a teacher
5
  I can add the random glossary entry to a course page
6
 
7
  Background:
8
    Given the following "courses" exist:
9
      | fullname | shortname |
10
      | Course 1 | C1        |
11
      | Course 2 | C2        |
12
    And the following "activity" exists:
13
      | activity        | glossary                       |
14
      | name            | Tips and Tricks                |
15
      | intro           | Frontpage glossary description |
16
      | course          | C2                             |
17
      | idnumber        | glossary0                      |
18
      | globalglossary  | 1                              |
19
      | defaultapproval | 1                              |
20
    And the following "users" exist:
21
      | username | firstname | lastname | email             |
22
      | student1 | Sam1      | Student1 | student1@example.com |
23
      | teacher1 | Terry1    | Teacher1 | teacher1@example.com |
24
    And the following "course enrolments" exist:
25
      | user     | course | role           |
26
      | student1 | C1     | student        |
27
      | teacher1 | C1     | editingteacher |
28
 
29
  Scenario: View random (last) entry in the global glossary
30
    When I log in as "admin"
31
    And I am on "Course 2" course homepage
32
    And I follow "Tips and Tricks"
33
    And I press "Add entry"
34
    And I set the following fields to these values:
35
      | Concept    | Never come late               |
36
      | Definition | Come in time for your classes |
37
    And I press "Save changes"
38
    And I log out
39
    # As a teacher add a block to the course page linking to the global glossary.
40
    And I log in as "teacher1"
41
    And I am on "Course 1" course homepage with editing mode on
42
    And I add the "Random glossary entry" block
43
    And I configure the "block_glossary_random" block
44
    And I set the following fields to these values:
45
      | Title                           | Tip of the day      |
46
      | Take entries from this glossary | Tips and Tricks     |
47
      | How a new entry is chosen       | Last modified entry |
48
    And I press "Save changes"
49
    Then I should see "Never come late" in the "Tip of the day" "block"
50
    And I should not see "Add a new entry" in the "Tip of the day" "block"
51
    And I should see "View all entries" in the "Tip of the day" "block"
52
    And I log out
53
    # Student who can't see the module is still able to view entries in this block (because the glossary was marked as global)
54
    And I log in as "student1"
55
    And I am on "Course 1" course homepage
56
    And I should see "Never come late" in the "Tip of the day" "block"
57
    And I should not see "Add a new entry" in the "Tip of the day" "block"
58
    And I should see "View all entries" in the "Tip of the day" "block"
59
    And I log out
60
 
61
  Scenario: Removing the global glossary that is used in random glossary block
62
    And I log in as "teacher1"
63
    And I am on "Course 1" course homepage with editing mode on
64
    And I add the "Random glossary entry" block
65
    And I configure the "block_glossary_random" block
66
    And I set the following fields to these values:
67
      | Title                           | Tip of the day      |
68
      | Take entries from this glossary | Tips and Tricks     |
69
      | How a new entry is chosen       | Last modified entry |
70
    And I press "Save changes"
71
    And I log out
72
    And I log in as "admin"
73
    And I am on "Course 2" course homepage
74
    And I follow "Tips and Tricks"
75
    And I follow "Settings"
76
    And I set the field "globalglossary" to "0"
77
    And I press "Save and return to course"
78
    And I am on "Course 1" course homepage
79
    Then I should see "Please configure this block using the edit icon." in the "Tip of the day" "block"
80
    And I log out
81
    And I log in as "student1"
82
    And I am on "Course 1" course homepage
83
    And "Tip of the day" "block" should not exist
84
    And I log out