Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-42505 - Feedback plugin: Inappropriate use of fieldset tags aroun…

…d form and cancel button

Changes:
* Removed the fieldset HTML tags around the Cancel button at the bottom of the form.
* Removed the fieldset HTML tags around the whole form.
* Added missing fieldset tags around groups of radio buttons and checkboxes.
* Removed unordered list wrapping dropdown lists.
* Removed duplicate label for dropdown lists.

Modified Files:
* mod/feedback/complete.php
* mod/feedback/complete_guest.php
* mod/feedback/item/multichoice/lib.php
* mod/feedback/item/multichoicerated/lib.php

Signed-off-by: Michael Milette <michael.milette@instruxmedia.com>
  • Loading branch information...
commit 761a10f8d56a2f6c2dbe63aa88ec44d3ae833624 1 parent 58ce512
@michael-milette michael-milette authored marinaglancy committed
View
4 mod/feedback/complete.php
@@ -418,7 +418,6 @@
if (is_array($feedbackitems)) {
echo $OUTPUT->box_start('feedback_form');
echo '<form action="complete.php" method="post" onsubmit=" ">';
- echo '<fieldset>';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo $OUTPUT->box_start('feedback_anonymousinfo');
switch ($feedback->anonymous) {
@@ -547,7 +546,6 @@
echo '<input name="savevalues" type="submit" '.$inputvalue.' />';
}
- echo '</fieldset>';
echo '</form>';
echo $OUTPUT->box_end();
@@ -562,11 +560,9 @@
}
}
echo '<form '.$action.' method="post" onsubmit=" ">';
- echo '<fieldset>';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="hidden" name="courseid" value="'. $courseid . '" />';
echo '<button type="submit">'.get_string('cancel').'</button>';
- echo '</fieldset>';
echo '</form>';
echo $OUTPUT->box_end();
$SESSION->feedback->is_started = true;
View
4 mod/feedback/complete_guest.php
@@ -378,7 +378,6 @@
if (is_array($feedbackitems)) {
echo $OUTPUT->box_start('feedback_form');
echo '<form action="complete_guest.php" method="post" onsubmit=" ">';
- echo '<fieldset>';
echo '<input type="hidden" name="anonymous" value="0" />';
$inputvalue = 'value="'.FEEDBACK_ANONYMOUS_YES.'"';
echo '<input type="hidden" name="anonymous_response" '.$inputvalue.' />';
@@ -493,7 +492,6 @@
echo '<input name="savevalues" type="submit" '.$inputvalue.' />';
}
- echo '</fieldset>';
echo '</form>';
echo $OUTPUT->box_end();
@@ -508,11 +506,9 @@
}
}
echo '<form '.$action.' method="post" onsubmit=" ">';
- echo '<fieldset>';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="hidden" name="courseid" value="'. $courseid . '" />';
echo '<button type="submit">'.get_string('cancel').'</button>';
- echo '</fieldset>';
echo '</form>';
echo $OUTPUT->box_end();
$SESSION->feedback->is_started = true;
View
30 mod/feedback/item/multichoice/lib.php
@@ -337,7 +337,12 @@ public function print_item_preview($item) {
echo '<div class="feedback_item_presentation_'.$align.'">';
$index = 1;
$checked = '';
- echo '<ul>';
+ if ($info->subtype == 'r' || $info->subtype == 'c') {
+ // if (r)adio buttons or (c)heckboxes
+ echo '<fieldset>';
+ echo '<ul>';
+ }
+
if ($info->horizontal) {
$hv = 'h';
} else {
@@ -376,7 +381,11 @@ public function print_item_preview($item) {
$this->print_item_dropdown($presentation, $item, false, $info, $align);
break;
}
- echo '</ul>';
+ if ($info->subtype == 'r' || $info->subtype == 'c') {
+ // if (r)adio buttons or (c)heckboxes
+ echo '</ul>';
+ echo '</fieldset>';
+ }
echo '</div>';
}
@@ -438,7 +447,11 @@ public function print_item_complete($item, $value = null, $highlightrequire = fa
//print the presentation
echo '<div class="feedback_item_presentation_'.$align.$highlight.'">';
- echo '<ul>';
+ if ($info->subtype == 'r' || $info->subtype == 'c') {
+ // if (r)adio buttons or (c)heckboxes
+ echo '<fieldset>';
+ echo '<ul>';
+ }
if ($info->horizontal) {
$hv = 'h';
} else {
@@ -483,7 +496,11 @@ public function print_item_complete($item, $value = null, $highlightrequire = fa
$this->print_item_dropdown($presentation, $item, $value, $info, $align);
break;
}
- echo '</ul>';
+ if ($info->subtype == 'r' || $info->subtype == 'c') {
+ // if (r)adio buttons or (c)heckboxes
+ echo '</ul>';
+ echo '</fieldset>';
+ }
echo '</div>';
}
@@ -774,8 +791,7 @@ private function print_item_dropdown($presentation, $item, $value, $info, $align
}
?>
- <li class="feedback_item_select_<?php echo $hv.'_'.$align;?>">
- <label class="accesshide" for="<?php echo $item->typ .'_' . $item->id;?>"><?php echo $item->name; ?></label>
+ <div class="feedback_item_select_<?php echo $hv.'_'.$align;?>">
<select id="<?php echo $item->typ .'_' . $item->id;?>" name="<?php echo $item->typ .'_' . $item->id;?>[]" size="1">
<option value="0">&nbsp;</option>
<?php
@@ -799,7 +815,7 @@ private function print_item_dropdown($presentation, $item, $value, $info, $align
}
?>
</select>
- </li>
+ </div>
<?php
}
View
9 mod/feedback/item/multichoicerated/lib.php
@@ -520,6 +520,7 @@ private function print_item_radio($item, $value, $info, $align, $showrating, $li
} else {
$hv = 'v';
}
+ echo '<fieldset>';
echo '<ul>';
if (!$this->hidenoselect($item)) {
?>
@@ -576,6 +577,7 @@ private function print_item_radio($item, $value, $info, $align, $showrating, $li
$index++;
}
echo '</ul>';
+ echo '</fieldset>';
}
private function print_item_dropdown($item, $value, $info, $align, $showrating, $lines) {
@@ -584,10 +586,8 @@ private function print_item_dropdown($item, $value, $info, $align, $showrating,
} else {
$hv = 'v';
}
- echo '<ul>';
?>
- <li class="feedback_item_select_<?php echo $hv.'_'.$align;?>">
- <label class="accesshide" for="<?php echo $item->typ.'_'.$item->id;?>"><?php echo $item->name; ?></label>
+ <div class="feedback_item_select_<?php echo $hv.'_'.$align;?>">
<select id="<?php echo $item->typ.'_'.$item->id;?>" name="<?php echo $item->typ.'_'.$item->id;?>">
<option value="0">&nbsp;</option>
<?php
@@ -613,9 +613,8 @@ private function print_item_dropdown($item, $value, $info, $align, $showrating,
}
?>
</select>
- </li>
+ </div>
<?php
- echo '</ul>';
}
public function prepare_presentation_values($linesep1,
View
18 mod/feedback/styles.css
@@ -47,24 +47,30 @@ div.feedback_item_commands_right {
li.feedback_item_check_h_left,
li.feedback_item_check_h_right,
-li.feedback_item_select_h_left,
-li.feedback_item_select_h_right,
li.feedback_item_radio_h_left,
-li.feedback_item_radio_h_right{
+li.feedback_item_radio_h_right {
list-style-type:none;
display:inline;
}
+div.feedback_item_select_h_left,
+div.feedback_item_select_h_right {
+ display:block;
+}
+
li.feedback_item_check_v_left,
li.feedback_item_check_v_right,
-li.feedback_item_select_v_left,
-li.feedback_item_select_v_right,
li.feedback_item_radio_v_left,
-li.feedback_item_radio_v_right{
+li.feedback_item_radio_v_right {
list-style-type:none;
display:block;
}
+div.feedback_item_select_v_left,
+div.feedback_item_select_v_right {
+ display:block;
+}
+
div.feedback_items label{
display: inline;
}
Please sign in to comment.
Something went wrong with that request. Please try again.