Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@block @block_activity_results @javascript
2
Feature: The activity results block displays student scores
3
  In order to be display student scores
4
  As a user
5
  I need to see the activity results block
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email | idnumber |
10
      | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
11
      | student1 | Student | 1 | student1@example.com | S1 |
12
      | student2 | Student | 2 | student2@example.com | S2 |
13
      | student3 | Student | 3 | student3@example.com | S3 |
14
      | student4 | Student | 4 | student4@example.com | S4 |
15
      | student5 | Student | 5 | student5@example.com | S5 |
16
    And the following "courses" exist:
17
      | fullname | shortname | category |
18
      | Course 1 | C1 | 0 |
19
    And the following "course enrolments" exist:
20
      | user | course | role |
21
      | teacher1 | C1 | editingteacher |
22
      | student1 | C1 | student |
23
      | student2 | C1 | student |
24
      | student3 | C1 | student |
25
      | student4 | C1 | student |
26
      | student5 | C1 | student |
27
    And the following "activities" exist:
28
      | activity   | name                | intro          | course | section | idnumber | assignsubmission_file_enabled |
29
      | assign     | Test assignment 1   | Offline text   | C1     | 1       | assign1  | 0                             |
30
      | assign     | Test assignment 2   | Offline text   | C1     | 1       | assign2  | 0                             |
31
      | assign     | Test assignment 3   | Offline text   | C1     | 1       | assign3  | 0                             |
32
    And the following "activities" exist:
33
      | activity   | name                | content          | course | section | idnumber |
34
      | page       |  Test page name     | This is a page   | C1     | 1       | page1    |
35
    And the following "grade grades" exist:
36
      | gradeitem         | user     | grade |
37
      | Test assignment 1 | student1 | 90.00 |
38
      | Test assignment 1 | student2 | 80.00 |
39
      | Test assignment 1 | student3 | 70.00 |
40
      | Test assignment 1 | student4 | 60.00 |
41
      | Test assignment 1 | student5 | 50.00 |
42
    And I log in as "teacher1"
43
    And I am on "Course 1" course homepage with editing mode on
44
 
45
  Scenario: Configure the block on a non-graded activity to show 3 high scores
46
    Given I am on the "Test page name" "page activity" page
47
    And I add the "Activity results" block to the default region with:
48
      | config_activitygradeitemid | Test assignment 1 |
49
      | config_showbest | 3 |
50
      | config_showworst | 0 |
51
      | config_gradeformat | Absolute numbers |
52
      | config_nameformat | Display full names |
53
    Then I should see "Student 1" in the "Activity results" "block"
54
    And I should see "90.00" in the "Activity results" "block"
55
    And I should see "Student 2" in the "Activity results" "block"
56
    And I should see "80.00" in the "Activity results" "block"
57
    And I should see "Student 3" in the "Activity results" "block"
58
    And I should see "70.00" in the "Activity results" "block"
59
 
60
  @javascript @addablocklink
61
  Scenario: Block should select current activity by default
62
    Given I click on "Test assignment 1" "link" in the "region-main" "region"
63
    When I add the "Activity results..." block
64
    Then the field "config_activitygradeitemid" in the "Add Activity results block" "dialogue" matches value "Test assignment 1"
65
    And I click on "Save changes" "button" in the "Add Activity results block" "dialogue"
66
    And I am on "Course 1" course homepage
67
    And I click on "Test assignment 2" "link" in the "region-main" "region"
68
    And I add the "Activity results..." block
69
    And the field "config_activitygradeitemid" in the "Add Activity results block" "dialogue" matches value "Test assignment 2"
70
    And I click on "Save changes" "button" in the "Add Activity results block" "dialogue"
71
    And I am on "Course 1" course homepage
72
    And I click on "Test assignment 3" "link" in the "region-main" "region"
73
    And I add the "Activity results..." block
74
    And the field "config_activitygradeitemid" in the "Add Activity results block" "dialogue" matches value "Test assignment 3"
75
    And I click on "Save changes" "button" in the "Add Activity results block" "dialogue"
76
    And I am on "Course 1" course homepage
77
    And I click on "Test page name" "link" in the "region-main" "region"
78
    And I add the "Activity results..." block
79
    And the field "config_activitygradeitemid" in the "Add Activity results block" "dialogue" does not match value "Test page name"
80
    And I click on "Save changes" "button" in the "Add Activity results block" "dialogue"