Permalink
Browse files

better validation of null answers MDL-8475 merged from HEAD

  • Loading branch information...
1 parent 224ac0b commit a53b72f516cc79e35611aef767a4109fc8d024e7 pichetp committed Aug 14, 2008
Showing with 5 additions and 0 deletions.
  1. +5 −0 question/type/numerical/edit_numerical_form.php
@@ -126,6 +126,11 @@ function validation($data){
if ($data['fraction'][$key] == 1) {
$maxgrade = true;
}
+ } else {
+ if ($data['fraction'][$key] !=0 || trim($data['feedback'][$key]) != ''){
+ $errors["answer[$key]"] = get_string('answermustbenumberorstar', 'qtype_numerical');
+ $answercount++;
+ }
}
}
if ($answercount==0){

0 comments on commit a53b72f

Please sign in to comment.