better code formatting

This commit is contained in:
jamiesensei 2006-12-28 16:44:47 +00:00
parent b6d15ddef9
commit ebff6e2c5e
2 changed files with 17 additions and 11 deletions

View File

@ -35,15 +35,18 @@ class mod_choice_mod_form extends moodleform_mod {
$repeatno = 5; $repeatno = 5;
} }
$this->repeat_elements($repeatarray, $repeatno, $repeateloptions = array();
array('limit'=> array('default'=>0, $repeateloptions['limit'] = array(
'type'=>PARAM_INT, 'default'=>0,
'disabledif'=>array('limitanswers', 'eq', 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);
'option' => array('type'=>PARAM_TEXT, $this->repeat_elements($repeatarray, $repeatno,
'helpbutton'=>array('options', get_string('modulenameplural', 'choice'), 'choice')), $repeateloptions, 'option_repeats', 'option_add_fields', 3);
'optionid' => array('type'=>PARAM_INT)),
'option_repeats', 'option_add_fields', 3);

View File

@ -219,10 +219,13 @@ class mod_quiz_mod_form extends moodleform_mod {
$this->_feedbacks = array(); $this->_feedbacks = array();
} }
$numfeedbacks = max(count($this->_feedbacks) * 1.5, 5); $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, $nextel=$this->repeat_elements($repeatarray, $numfeedbacks-1,
array('feedbacktext'=> array('type'=>PARAM_TEXT), $repeateloptions, 'boundary_repeats', 'boundary_add_fields', 3);
'feedbackboundaries' => array('type'=>PARAM_TEXT)),
'boundary_repeats', 'boundary_add_fields', 3);
//put some extra elements in before the button //put some extra elements in before the button
$insertEl = &MoodleQuickForm::createElement('text', "feedbacktext[$nextel]", get_string('feedback', 'quiz')); $insertEl = &MoodleQuickForm::createElement('text', "feedbacktext[$nextel]", get_string('feedback', 'quiz'));