-<?PHP // $Id$
+<?PHP // $Id$
// choice.php - created with Moodle 1.7 beta + (2006101003)
$string['displayhorizontal'] = 'Display horizontally';
$string['displaymode'] = 'Display Mode';
$string['displayvertical'] = 'Display vertically';
+$string['fillinatleastoneoption'] = 'You need to provide at least two possible answers.';
$string['full'] = '(Full)';
$string['havetologin'] = 'You have to log in before you can submit your choice';
$string['limit'] = 'Limit';
}
+ function validation($data){
+ $choices=0;
+ foreach ($data['option'] as $option){
+ if (trim($option)!=''){
+ $choices++;
+ }
+ }
+ if ($choices>1){
+ return true;
+ } elseif ($choices==0) {
+ return array('option[0]'=>get_string('fillinatleastoneoption', 'choice'));
+ } else {
+ return array('option[1]'=>get_string('fillinatleastoneoption', 'choice'));
+ }
+
+
+ }
+
}
?>
\ No newline at end of file