Skip to content

Commit

Permalink
MDL-38279 questions: must have default mark positive.
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Mar 1, 2013
1 parent 19075a2 commit a78c180
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lang/en/question.php
Expand Up @@ -90,6 +90,7 @@
$string['cwrqpfsnoprob'] = 'No question categories in your site are affected by the \'Random questions selecting questions from sub categories\' issue.';
$string['defaultfor'] = 'Default for {$a}';
$string['defaultinfofor'] = 'The default category for questions shared in context \'{$a}\'.';
$string['defaultmarkmustbepositive'] = 'The default mark must be positive.';
$string['deletebehaviourareyousure'] = 'Delete behaviour {$a}: are you sure?';
$string['deletebehaviourareyousuremessage'] = 'You are about to completely delete the question behaviour {$a}. This will completely delete everything in the database associated with this question behaviour. Are you SURE you want to continue?';
$string['deletecoursecategorywithquestions'] = 'There are questions in the question bank associated with this course category. If you proceed, they will be deleted. You may wish to move them first, using the question bank interface.';
Expand Down
6 changes: 6 additions & 0 deletions question/type/edit_question_form.php
Expand Up @@ -654,6 +654,12 @@ public function validation($fromform, $files) {
&& empty($fromform['usecurrentcat']) && !$this->question->formoptions->canmove) {
$errors['currentgrp'] = get_string('nopermissionmove', 'question');
}

// Default mark.
if ($fromform['defaultmark'] < 0) {
$errors['defaultmark'] = get_string('defaultmarkmustbepositive', 'question');
}

return $errors;
}

Expand Down

0 comments on commit a78c180

Please sign in to comment.