Merge branch 'MDL-52838-33' of git://github.com/damyon/moodle into MOODLE_33_STABLE
This commit is contained in:
@@ -126,11 +126,13 @@ class workshop_edit_rubric_strategy_form extends workshop_edit_strategy_form {
|
||||
}
|
||||
|
||||
// Make sure the levels grades are unique within the criterion.
|
||||
$atleastonelevel = false;
|
||||
for ($j = 0; isset($data['levelid__idx_'.$i.'__idy_'.$j]); $j++) {
|
||||
if (0 == strlen(trim($data['definition__idx_'.$i.'__idy_'.$j]))) {
|
||||
// The level definition is empty and will not be saved.
|
||||
continue;
|
||||
}
|
||||
$atleastonelevel = true;
|
||||
|
||||
$levelgrade = $data['grade__idx_'.$i.'__idy_'.$j];
|
||||
|
||||
@@ -143,6 +145,9 @@ class workshop_edit_rubric_strategy_form extends workshop_edit_strategy_form {
|
||||
$dimgrades[$levelgrade] = $j;
|
||||
}
|
||||
}
|
||||
if (!$atleastonelevel) {
|
||||
$errors['level__idx_'.$i.'__idy_0'] = get_string('mustdefinelevel', 'workshopform_rubric');
|
||||
}
|
||||
}
|
||||
|
||||
return $errors;
|
||||
|
||||
@@ -34,5 +34,6 @@ $string['layoutlist'] = 'List';
|
||||
$string['levelgroup'] = 'Level grade and definition';
|
||||
$string['levels'] = 'Levels';
|
||||
$string['mustbeunique'] = 'Level grades must be unique within a criterion';
|
||||
$string['mustdefinelevel'] = 'At least one level is required';
|
||||
$string['mustchooseone'] = 'You have to select one of these items';
|
||||
$string['pluginname'] = 'Rubric';
|
||||
|
||||
Reference in New Issue
Block a user