MFC: MDL-11955 required scale selection when grade type is scale
This commit is contained in:
@@ -282,6 +282,12 @@ class edit_item_form extends moodleform {
|
||||
}
|
||||
*/
|
||||
|
||||
if (array_key_exists('gradetype', $data) and $data['gradetype'] == GRADE_TYPE_SCALE) {
|
||||
if (empty($data['scaleid'])) {
|
||||
$errors['scaleid'] = get_String('missingscale', 'grades');
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists('grademin', $data) and array_key_exists('grademax', $data)) {
|
||||
if ($data['grademax'] == $data['grademin'] or $data['grademax'] < $data['grademin']) {
|
||||
$errors['grademin'] = get_String('incorrectminmax', 'grades');
|
||||
|
||||
@@ -276,6 +276,7 @@ $string['meangraded'] = 'Non-empty grades';
|
||||
$string['meanselection'] = 'Grades selected for column averages';
|
||||
$string['median'] = 'Median';
|
||||
$string['min'] = 'Lowest';
|
||||
$string['missingscale'] = 'Scale must be selected';
|
||||
$string['mode'] = 'Mode';
|
||||
$string['movingelement'] = 'Moving $a';
|
||||
$string['multfactor'] = 'Multiplicator';
|
||||
|
||||
Reference in New Issue
Block a user