[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/grade/tests/behat/ -> grade_view.feature (source)

   1  @core @core_grades
   2  Feature: We can enter in grades and view reports from the gradebook
   3    In order to check the expected results are displayed
   4    As a teacher
   5    I need to assign grades and check that they display correctly in the gradebook.
   6    I need to enable grade weightings and check that they are displayed correctly.
   7  
   8    Background:
   9      Given the following "courses" exist:
  10        | fullname | shortname | format |
  11        | Course 1 | C1 | topics |
  12      And the following "users" exist:
  13        | username | firstname | lastname | email |
  14        | teacher1 | Teacher | 1 | [email protected] |
  15        | student1 | Student | 1 | [email protected] |
  16      And the following "course enrolments" exist:
  17        | user | course | role |
  18        | teacher1 | C1 | editingteacher |
  19        | student1 | C1 | student |
  20      And I log in as "admin"
  21      And I set the following administration settings values:
  22        | grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural |
  23      And I log out
  24      And I log in as "teacher1"
  25      And I follow "Course 1"
  26      And I turn editing mode on
  27      And I add a "Assignment" to section "1" and I fill the form with:
  28        | Assignment name | Test assignment name 1 |
  29        | Description | Submit your online text |
  30        | assignsubmission_onlinetext_enabled | 1 |
  31      And I add a "Assignment" to section "1" and I fill the form with:
  32        | Assignment name | Test assignment name 2 |
  33        | Description | Submit your online text |
  34        | assignsubmission_onlinetext_enabled | 1 |
  35      And I log out
  36      And I log in as "student1"
  37      And I follow "Course 1"
  38      And I follow "Test assignment name 1"
  39      When I press "Add submission"
  40      And I set the following fields to these values:
  41        | Online text | This is a submission for assignment 1 |
  42      And I press "Save changes"
  43      Then I should see "Submitted for grading"
  44      And I follow "Course 1"
  45      And I follow "Test assignment name 2"
  46      When I press "Add submission"
  47      And I set the following fields to these values:
  48        | Online text | This is a submission for assignment 2 |
  49      And I press "Save changes"
  50      Then I should see "Submitted for grading"
  51      And I log out
  52      And I log in as "teacher1"
  53      And I follow "Course 1"
  54      And I follow "Grades"
  55      And I turn editing mode on
  56      And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment name 1"
  57      And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment name 2"
  58      And I press "Save changes"
  59  
  60    @javascript
  61    Scenario: Grade a grade item and ensure the results display correctly in the gradebook
  62      When I set the field "Grade report" to "User report"
  63      And the "Grade report" select box should contain "Grader report"
  64      And the "Grade report" select box should contain "Outcomes report"
  65      And the "Grade report" select box should contain "User report"
  66      And the "Select all or one user" select box should contain "All users (1)"
  67      And I log out
  68      And I log in as "student1"
  69      And I follow "Course 1"
  70      And I follow "Grades"
  71      Then the following should exist in the "user-grade" table:
  72        | Grade item | Grade | Range | Percentage |
  73        | Test assignment name 1 | 80.00 | 0–100 | 80.00 % |
  74        | Test assignment name 2 | 90.00 | 0–100 | 90.00 % |
  75        | Course total | 170.00 | 0–200 | 85.00 % |
  76      And the following should not exist in the "user-grade" table:
  77        | Grade item | Grade | Range | Percentage |
  78        | Course total | 90.00 | 0–100 | 90.00 % |
  79      And I set the field "Grade report" to "Overview report"
  80      And "C1" row "Grade" column of "overview-grade" table should contain "170.00"
  81      And "C1" row "Grade" column of "overview-grade" table should not contain "90.00"
  82  
  83    @javascript
  84    Scenario: We can add a weighting to a grade item and it is displayed properly in the user report
  85      When I set the field "Grade report" to "Categories and items"
  86      And I set the following settings for grade item "Course 1":
  87        | Aggregation | Weighted mean of grades |
  88      And I set the field "Extra credit value for Test assignment name" to "0.72"
  89      And I press "Save changes"
  90      And I set the field "Grade report" to "User report"
  91      And I navigate to "Course grade settings" node in "Grade administration > Setup"
  92      And I set the following fields to these values:
  93        | Show weightings | Show |
  94      And I press "Save changes"
  95      And I log out
  96      And I log in as "student1"
  97      And I follow "Course 1"
  98      And I follow "Grades"
  99      Then the following should exist in the "user-grade" table:
 100        | Grade item | Calculated weight | Grade | Range | Percentage |
 101        | Test assignment name 1 | 41.86 % | 80.00 | 0–100 | 80.00 % |
 102        | Test assignment name 2 | 58.14 % | 90.00 | 0–100 | 90.00 % |
 103        | Course totalWeighted mean of grades. | - | 85.81 | 0–100 | 85.81 % |
 104      And the following should not exist in the "user-grade" table:
 105        | Grade item | Calculated weight | Percentage |
 106        | Test assignment name 1 | 0.72% | 0.72% |
 107        | Test assignment name 2 | 1.00% | 1.00% |
 108        | Course total | 1.00% | 1.00% |


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1