From 984c6bd358a50ffb3a487b0d3ece26ee72a699aa Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Sat, 30 Jul 2011 10:20:51 +1200 Subject: [PATCH] MDL-28410 Choice - allow single answer choice to be created --- mod/choice/lang/en/choice.php | 1 + mod/choice/mod_form.php | 6 +----- mod/choice/version.php | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/mod/choice/lang/en/choice.php b/mod/choice/lang/en/choice.php index 209adc62188..cef425def12 100644 --- a/mod/choice/lang/en/choice.php +++ b/mod/choice/lang/en/choice.php @@ -32,6 +32,7 @@ $string['displaymode'] = 'Display mode'; $string['displayvertical'] = 'Display vertically'; $string['expired'] = 'Sorry, this activity closed on {$a} and is no longer available'; $string['fillinatleastoneoption'] = 'You need to provide at least two possible answers.'; +$string['atleastoneoption'] = 'You need to provide at least one possible answer.'; $string['full'] = '(Full)'; $string['havetologin'] = 'You have to log in before you can submit your choice'; $string['choice'] = 'Choice'; diff --git a/mod/choice/mod_form.php b/mod/choice/mod_form.php index 1f65611f953..349d79b6c19 100644 --- a/mod/choice/mod_form.php +++ b/mod/choice/mod_form.php @@ -127,11 +127,7 @@ class mod_choice_mod_form extends moodleform_mod { } if ($choices < 1) { - $errors['option[0]'] = get_string('fillinatleastoneoption', 'choice'); - } - - if ($choices < 2) { - $errors['option[1]'] = get_string('fillinatleastoneoption', 'choice'); + $errors['option[0]'] = get_string('atleastoneoption', 'choice'); } return $errors; diff --git a/mod/choice/version.php b/mod/choice/version.php index 792bdcb670d..a31312fd41b 100644 --- a/mod/choice/version.php +++ b/mod/choice/version.php @@ -5,7 +5,7 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$module->version = 2010101300; +$module->version = 2010101301; $module->requires = 2010080300; // Requires this Moodle version $module->cron = 0;