From 65c7713115538695a0337e1a89a1bbd5406b19ad Mon Sep 17 00:00:00 2001 From: Ruslan Kabalin Date: Wed, 30 Nov 2011 17:17:12 +0000 Subject: [PATCH] MDL-30526 Choice: add form validation rule for numeric field --- mod/choice/mod_form.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/choice/mod_form.php b/mod/choice/mod_form.php index 349d79b6c19..1a7ef127ba4 100644 --- a/mod/choice/mod_form.php +++ b/mod/choice/mod_form.php @@ -49,10 +49,11 @@ class mod_choice_mod_form extends moodleform_mod { $repeateloptions = array(); $repeateloptions['limit']['default'] = 0; $repeateloptions['limit']['disabledif'] = array('limitanswers', 'eq', 0); + $repeateloptions['limit']['rule'] = 'numeric'; $mform->setType('limit', PARAM_INT); $repeateloptions['option']['helpbutton'] = array('choiceoptions', 'choice'); - $mform->setType('option', PARAM_CLEAN); + $mform->setType('option', PARAM_CLEANHTML); $mform->setType('optionid', PARAM_INT);