Commit e689d68b authored by David Monllaó's avatar David Monllaó
Browse files

Merge branch 'MDL-52954-master-behat-fixes' of git://github.com/damyon/moodle

parents 3dd89357 5267d632
@mod @mod_assign @bug
@mod @mod_assign @javascript
Feature: Check that the assignment grade can be rescaled when the max grade is changed
In order to ensure that the percentages are not affected by changes to the max grade
As a teacher
......@@ -27,17 +27,20 @@ Feature: Check that the assignment grade can be rescaled when the max grade is c
| Description | Test assignment description |
And I follow "Test assignment name"
And I follow "View all submissions"
And I click on "Grade Student 1" "link" in the "Student 1" "table_row"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade out of 100" to "40"
And I press "Save changes"
And I press "Continue"
And I press "Ok"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I follow "View all submissions"
And "Student 1" row "Grade" column of "generaltable" table should contain "40.00"
Scenario: Update the max grade for an assignment without rescaling existing grades
Given I follow "Edit settings"
And I expand all fieldsets
And I set the field "Maximum grade" to "80"
And I set the field "Rescale existing grades" to "No"
And I set the field "Maximum grade" to "80"
When I press "Save and display"
And I follow "View all submissions"
Then "Student 1" row "Grade" column of "generaltable" table should contain "40.00"
......@@ -45,22 +48,8 @@ Feature: Check that the assignment grade can be rescaled when the max grade is c
Scenario: Update the max grade for an assignment rescaling existing grades
Given I follow "Edit settings"
And I expand all fieldsets
And I set the field "Maximum grade" to "50"
And I set the field "Rescale existing grades" to "Yes"
And I set the field "Maximum grade" to "50"
When I press "Save and display"
And I follow "View all submissions"
Then "Student 1" row "Grade" column of "generaltable" table should contain "20.00"
Scenario: A rescale existing grades is not needed when keeping max grade unchanged
Given I follow "Edit settings"
And I expand all fieldsets
And I set the field "Maximum grade" to "100"
When I press "Save and display"
Then I should not see "You must choose whether to rescale existing grades or not."
Scenario: A rescale existing grades must be selected when max grade changes
Given I follow "Edit settings"
And I expand all fieldsets
And I set the field "Maximum grade" to "50"
When I press "Save and display"
Then I should see "You must choose whether to rescale existing grades or not."
......@@ -25,6 +25,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'mod_assign'; // Full name of the plugin (used for diagnostics).
$plugin->version = 2015111603; // The current module version (Date: YYYYMMDDXX).
$plugin->version = 2016041300; // The current module version (Date: YYYYMMDDXX).
$plugin->requires = 2015111000; // Requires this Moodle version.
$plugin->cron = 60;
......@@ -536,6 +536,9 @@ class core_user_external extends external_api {
// Retrieve the users.
$users = $DB->get_records_list('user', $field, $cleanedvalues, 'id');
$context = context_system::instance();
self::validate_context($context);
// Finally retrieve each users information.
$returnedusers = array();
foreach ($users as $user) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment