From: jamiesensei Date: Thu, 28 Dec 2006 16:44:47 +0000 (+0000) Subject: better code formatting X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ebff6e2c5e41fb478e22704484faab60ba949f4d;p=moodle.git better code formatting --- diff --git a/mod/choice/mod_form.php b/mod/choice/mod_form.php index 90f269ccca..013414f92f 100644 --- a/mod/choice/mod_form.php +++ b/mod/choice/mod_form.php @@ -35,15 +35,18 @@ class mod_choice_mod_form extends moodleform_mod { $repeatno = 5; } + $repeateloptions = array(); + $repeateloptions['limit'] = array( + 'default'=>0, + 'type'=>PARAM_INT, + 'disabledif'=>array('limitanswers', 'eq', 0)); + $repeateloptions['option'] = array( + 'type'=>PARAM_TEXT, + 'helpbutton'=>array('options', get_string('modulenameplural', 'choice'), 'choice')); + $repeateloptions['optionid'] = array('type'=>PARAM_INT); + $this->repeat_elements($repeatarray, $repeatno, - array('limit'=> array('default'=>0, - 'type'=>PARAM_INT, - 'disabledif'=>array('limitanswers', 'eq', 0)), - - 'option' => array('type'=>PARAM_TEXT, - 'helpbutton'=>array('options', get_string('modulenameplural', 'choice'), 'choice')), - 'optionid' => array('type'=>PARAM_INT)), - 'option_repeats', 'option_add_fields', 3); + $repeateloptions, 'option_repeats', 'option_add_fields', 3); diff --git a/mod/quiz/mod_form.php b/mod/quiz/mod_form.php index 172c8c7711..d75b074fcc 100644 --- a/mod/quiz/mod_form.php +++ b/mod/quiz/mod_form.php @@ -219,10 +219,13 @@ class mod_quiz_mod_form extends moodleform_mod { $this->_feedbacks = array(); } $numfeedbacks = max(count($this->_feedbacks) * 1.5, 5); + + $repeateloptions = array(); + $repeateloptions ['feedbacktext'] = array('type'=>PARAM_TEXT); + $repeateloptions ['feedbackboundaries'] = array('type'=>PARAM_TEXT); + $nextel=$this->repeat_elements($repeatarray, $numfeedbacks-1, - array('feedbacktext'=> array('type'=>PARAM_TEXT), - 'feedbackboundaries' => array('type'=>PARAM_TEXT)), - 'boundary_repeats', 'boundary_add_fields', 3); + $repeateloptions, 'boundary_repeats', 'boundary_add_fields', 3); //put some extra elements in before the button $insertEl = &MoodleQuickForm::createElement('text', "feedbacktext[$nextel]", get_string('feedback', 'quiz'));