/// perform extra validation before submission
function validation($data){
+
+ global $CFG;
+
$errors= array();
+
+ // we can not allow 2 scales with the same exact scale as this creates
+ // problems for backup/restore
+ $courseid = empty($data['courseid'])?0:$data['courseid'];
+ if (count_records('scale', 'courseid', $courseid, 'scale', $data['scale'])) {
+ $errors['scale'] = get_string('duplicatescale', 'grades');
+ }
$options = explode(',', $data['scale']);
if (count($options) < 2) {
return $errors;
}
}
-
-
}
?>
$string['dropped'] = 'Dropped';
$string['dropxlowest'] = 'Drop X Lowest';
$string['dropxlowestwarning'] = 'Note: If you use drop x lowest the grading assumes that all items in the category have the same point value. If point values differ results will be unpredictable';
+$string['duplicatescale'] = 'Duplicate scale';
$string['edit'] = 'Edit';
$string['editcalculation'] = 'Edit Calculation';
$string['editfeedback'] = 'Edit Feedback';