Skip to content

Commit

Permalink
MDL-11955 required scale selection when grade type is scale
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Oct 29, 2007
1 parent 8f2ddad commit 6e75c7f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions grade/edit/tree/item_form.php
Expand Up @@ -282,6 +282,12 @@ function validation($data){
}
*/

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');
Expand Down
1 change: 1 addition & 0 deletions lang/en_utf8/grades.php
Expand Up @@ -276,6 +276,7 @@
$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';
Expand Down

0 comments on commit 6e75c7f

Please sign in to comment.