Skip to content

Commit

Permalink
MDL-29621 - XHTML not welformed when creating Feedback questions
Browse files Browse the repository at this point in the history
  • Loading branch information
grabs committed Oct 3, 2011
1 parent 228d24f commit af26e34
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 19 deletions.
10 changes: 8 additions & 2 deletions mod/feedback/item/captcha/captcha_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@ function definition() {

$mform->addElement('header', 'general', get_string($this->type, 'feedback'));
$mform->addElement('checkbox', 'required', get_string('required', 'feedback'));
$mform->addElement('text', 'name', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
$mform->addElement('text', 'label', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
$mform->addElement('text',
'name',
get_string('item_name', 'feedback'),
array('size'=>FEEDBACK_ITEM_NAME_TEXTBOX_SIZE, 'maxlength'=>255));
$mform->addElement('text',
'label',
get_string('item_label', 'feedback'),
array('size'=>FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE, 'maxlength'=>255));

$mform->addElement('select',
'presentation',
Expand Down
5 changes: 4 additions & 1 deletion mod/feedback/item/feedback_item_form_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ function definition() {
$common['items']
);
$mform->addHelpButton('dependitem', 'depending', 'feedback');
$mform->addElement('text', 'dependvalue', get_string('dependvalue', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
$mform->addElement('text',
'dependvalue',
get_string('dependvalue', 'feedback'),
array('size'=>FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE, 'maxlength'=>255));
}else {
$mform->addElement('hidden', 'dependitem', 0);
$mform->setType('dependitem', PARAM_INT);
Expand Down
10 changes: 8 additions & 2 deletions mod/feedback/item/info/info_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ function definition() {
$mform->addElement('hidden', 'required', 0);
$mform->setType('required', PARAM_INT);

$mform->addElement('text', 'name', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
$mform->addElement('text', 'label', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
$mform->addElement('text',
'name',
get_string('item_name', 'feedback'),
array('size'=>FEEDBACK_ITEM_NAME_TEXTBOX_SIZE, 'maxlength'=>255));
$mform->addElement('text',
'label',
get_string('item_label', 'feedback'),
array('size'=>FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE, 'maxlength'=>255));

$options=array();
$options[1] = get_string('responsetime', 'feedback');
Expand Down
10 changes: 8 additions & 2 deletions mod/feedback/item/multichoice/multichoice_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ function definition() {

$mform->addElement('checkbox', 'required', get_string('required', 'feedback'));

$mform->addElement('text', 'name', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
$mform->addElement('text', 'label', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
$mform->addElement('text',
'name',
get_string('item_name', 'feedback'),
array('size'=>FEEDBACK_ITEM_NAME_TEXTBOX_SIZE, 'maxlength'=>255));
$mform->addElement('text',
'label',
get_string('item_label', 'feedback'),
array('size'=>FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE, 'maxlength'=>255));

$mform->addElement('select',
'horizontal',
Expand Down
10 changes: 8 additions & 2 deletions mod/feedback/item/multichoicerated/multichoicerated_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ function definition() {

$mform->addElement('checkbox', 'required', get_string('required', 'feedback'));

$mform->addElement('text', 'name', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
$mform->addElement('text', 'label', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
$mform->addElement('text',
'name',
get_string('item_name', 'feedback'),
array('size'=>FEEDBACK_ITEM_NAME_TEXTBOX_SIZE, 'maxlength'=>255));
$mform->addElement('text',
'label',
get_string('item_label', 'feedback'),
array('size'=>FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE, 'maxlength'=>255));

$mform->addElement('select',
'horizontal',
Expand Down
24 changes: 18 additions & 6 deletions mod/feedback/item/numeric/numeric_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,24 @@ function definition() {
$mform->addElement('header', 'general', get_string($this->type, 'feedback'));
$mform->addElement('checkbox', 'required', get_string('required', 'feedback'));

$mform->addElement('text', 'name', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
$mform->addElement('text', 'label', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));

$mform->addElement('text', 'rangefrom', get_string('numeric_range_from', 'feedback'), array('size="10"','maxlength="10"'));

$mform->addElement('text', 'rangeto', get_string('numeric_range_to', 'feedback'), array('size="10"','maxlength="10"'));
$mform->addElement('text',
'name',
get_string('item_name', 'feedback'),
array('size'=>FEEDBACK_ITEM_NAME_TEXTBOX_SIZE, 'maxlength'=>255));
$mform->addElement('text',
'label',
get_string('item_label', 'feedback'),
array('size'=>FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE, 'maxlength'=>255));

$mform->addElement('text',
'rangefrom',
get_string('numeric_range_from', 'feedback'),
array('size'=>10, 'maxlength'=>10));

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

parent::definition();
$this->set_data($item);
Expand Down
10 changes: 8 additions & 2 deletions mod/feedback/item/textarea/textarea_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@ function definition() {
$mform->addElement('header', 'general', get_string($this->type, 'feedback'));
$mform->addElement('checkbox', 'required', get_string('required', 'feedback'));

$mform->addElement('text', 'name', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
$mform->addElement('text', 'label', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
$mform->addElement('text',
'name',
get_string('item_name', 'feedback'),
array('size'=>FEEDBACK_ITEM_NAME_TEXTBOX_SIZE, 'maxlength'=>255));
$mform->addElement('text',
'label',
get_string('item_label', 'feedback'),
array('size'=>FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE, 'maxlength'=>255));

$mform->addElement('select',
'itemwidth',
Expand Down
10 changes: 8 additions & 2 deletions mod/feedback/item/textfield/textfield_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@ function definition() {
$mform->addElement('header', 'general', get_string($this->type, 'feedback'));
$mform->addElement('checkbox', 'required', get_string('required', 'feedback'));

$mform->addElement('text', 'name', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
$mform->addElement('text', 'label', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
$mform->addElement('text',
'name',
get_string('item_name', 'feedback'),
array('size'=>FEEDBACK_ITEM_NAME_TEXTBOX_SIZE, 'maxlength'=>255));
$mform->addElement('text',
'label',
get_string('item_label', 'feedback'),
array('size'=>FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE, 'maxlength'=>255));

$mform->addElement('select',
'itemsize',
Expand Down

0 comments on commit af26e34

Please sign in to comment.