Browse Source

Add rule see BT#8177

jmontoyaa 8 years ago
parent
commit
81d50d2728
1 changed files with 3 additions and 0 deletions
  1. 3 0
      main/exercice/exercise.class.php

+ 3 - 0
main/exercice/exercise.class.php

@@ -2228,7 +2228,10 @@ class Exercise
                 array(get_lang('PassPercentage'), null, '%'),
                 array('id' => 'pass_percentage')
             );
+
             $form->addRule('pass_percentage', get_lang('Numeric'), 'numeric');
+            $form->addRule('pass_percentage', get_lang('ValueTooSmall'), 'min_numeric_length', 0);
+            $form->addRule('pass_percentage', get_lang('ValueTooBig'), 'max_numeric_length', 100);
 
             // add the text_when_finished textbox
             $form->addHtmlEditor(