Merge branch 'MDL-48215_master' of git://github.com/markn86/moodle

This commit is contained in:
David Monllao 2015-02-17 13:23:30 +08:00
commit a50840db34
3 changed files with 8 additions and 1 deletions

View File

@ -51,9 +51,11 @@ class gradingform_guide_editguide extends moodleform {
$form->setType('returnurl', PARAM_LOCALURL);
// Name.
$form->addElement('text', 'name', get_string('name', 'gradingform_guide'), array('size'=>52));
$form->addElement('text', 'name', get_string('name', 'gradingform_guide'),
array('size' => 52, 'maxlength' => 255));
$form->addRule('name', get_string('required'), 'required');
$form->setType('name', PARAM_TEXT);
$form->addRule('name', null, 'maxlength', 255, 'client');
// Description.
$options = gradingform_guide_controller::description_form_field_options($this->_customdata['context']);

View File

@ -197,6 +197,10 @@ class moodlequickform_guideeditor extends HTML_QuickForm_input {
$errors['err_noshortname'] = 1;
$criterion['error_description'] = true;
}
if (strlen(trim($criterion['shortname'])) > 255) {
$errors['err_shortnametoolong'] = 1;
$criterion['error_description'] = true;
}
if (!strlen(trim($criterion['maxscore']))) {
$errors['err_nomaxscore'] = 1;
$criterion['error_description'] = true;

View File

@ -54,6 +54,7 @@ $string['err_nodescription'] = 'Student description can not be empty';
$string['err_nodescriptionmarkers'] = 'Marker description can not be empty';
$string['err_nomaxscore'] = 'Criterion max score can not be empty';
$string['err_noshortname'] = 'Criterion name can not be empty';
$string['err_shortnametoolong'] = 'Criterion name must be less than 256 characters';
$string['err_scoreinvalid'] = 'The score given to {$a->criterianame} is not valid, the max score is: {$a->maxscore}';
$string['gradingof'] = '{$a} grading';
$string['guidemappingexplained'] = 'WARNING: Your marking guide has a maximum grade of <b>{$a->maxscore} points</b> but the maximum grade set in your activity is {$a->modulegrade} The maximum score set in your marking guide will be scaled to the maximum grade in the module.<br />