Skip to content

Commit

Permalink
MDL-39435 feedback: Fix missing calls to setType
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart committed May 1, 2013
1 parent bee592a commit 4a02b43
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mod/feedback/edit_form.php
Expand Up @@ -34,7 +34,7 @@ public function definition() {
$mform = $this->_form;

//headline
$mform->addElement('header', 'general', get_string('add_items', 'feedback'));
$mform->addElement('header', 'general', get_string('content'));
// visible elements
$feedback_names_options = feedback_load_feedback_items_options();

Expand Down
5 changes: 3 additions & 2 deletions mod/feedback/item/feedback_item_form_class.php
Expand Up @@ -51,11 +51,12 @@ public function definition() {
array('size'=>FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE, 'maxlength'=>255));
} else {
$mform->addElement('hidden', 'dependitem', 0);
$mform->setType('dependitem', PARAM_INT);
$mform->addElement('hidden', 'dependvalue', '');
$mform->setType('dependitem', PARAM_ALPHA);
}

$mform->setType('dependitem', PARAM_INT);
$mform->setType('dependvalue', PARAM_RAW);

$position_select = $mform->addElement('select',
'position',
get_string('position', 'feedback').' ',
Expand Down
2 changes: 2 additions & 0 deletions mod/feedback/item/numeric/numeric_form.php
Expand Up @@ -44,11 +44,13 @@ public function definition() {
'rangefrom',
get_string('numeric_range_from', 'feedback'),
array('size'=>10, 'maxlength'=>10));
$mform->setType('rangefrom', PARAM_INT);

$mform->addElement('text',
'rangeto',
get_string('numeric_range_to', 'feedback'),
array('size'=>10, 'maxlength'=>10));
$mform->setType('rangeto', PARAM_INT);

parent::definition();
$this->set_data($item);
Expand Down
1 change: 0 additions & 1 deletion mod/feedback/lang/en/feedback.php
Expand Up @@ -23,7 +23,6 @@
*/

$string['add_item'] = 'Add question to activity';
$string['add_items'] = 'Add question to activity';
$string['add_pagebreak'] = 'Add a page break';
$string['adjustment'] = 'Adjustment';
$string['after_submit'] = 'After submission';
Expand Down
3 changes: 2 additions & 1 deletion mod/feedback/mod_form.php
Expand Up @@ -108,9 +108,10 @@ public function definition() {
array('size'=>'4',
'disabled'=>'disabled',
'value'=>$multiple_submit_value));
$mform->setType('multiple_submit_static', PARAM_RAW);

$mform->addElement('hidden', 'multiple_submit', '');
$mform->setType('', PARAM_INT);
$mform->setType('multiple_submit', PARAM_INT);
$mform->addHelpButton('multiple_submit_static', 'multiplesubmit', 'feedback');
} else {
$mform->addElement('selectyesno',
Expand Down

0 comments on commit 4a02b43

Please sign in to comment.