Skip to content
Browse files

MDL-42310 feedback mod - Enable filtering of multichoice and multicho…

…ice rated controls

Conflicts:
	mod/feedback/item/multichoice/lib.php
	mod/feedback/item/multichoicerated/lib.php

Signed-off-by: Michael Milette <michael.milette@instruxmedia.com>
  • Loading branch information...
1 parent e71a533 commit 025000a221aa535c9248a8e34401cd2a1936b839 @michael-milette michael-milette committed with abgreeve Dec 24, 2013
Showing with 18 additions and 18 deletions.
  1. +9 −9 mod/feedback/item/multichoice/lib.php
  2. +9 −9 mod/feedback/item/multichoicerated/lib.php
View
18 mod/feedback/item/multichoice/lib.php
@@ -320,7 +320,7 @@ public function print_item_preview($item) {
echo '<label for="'. $item->typ . '_' . $item->id .'">';
}
echo '('.$item->label.') ';
- echo format_text($item->name.$requiredmark, true, false, false);
+ echo format_text($item->name . $requiredmark, FORMAT_HTML, array('noclean' => true, 'para' => false));
if ($item->dependitem) {
if ($dependitem = $DB->get_record('feedback_item', array('id'=>$item->dependitem))) {
echo ' <span class="feedback_depend">';
@@ -428,10 +428,10 @@ public function print_item_complete($item, $value = null, $highlightrequire = fa
echo '<div class="feedback_item_label_'.$align.$highlight.'">';
if ($info->subtype == 'd') {
echo '<label for="'. $item->typ . '_' . $item->id .'">';
- echo format_text($item->name.$requiredmark, true, false, false);
+ echo format_text($item->name . $requiredmark, FORMAT_HTML, array('noclean' => true, 'para' => false));
echo '</label>';
} else {
- echo format_text($item->name.$requiredmark, true, false, false);
+ echo format_text($item->name . $requiredmark, FORMAT_HTML, array('noclean' => true, 'para' => false));
}
echo '</div>';
@@ -523,7 +523,7 @@ public function print_item_show_value($item, $value = null) {
//print the question and label
echo '<div class="feedback_item_label_'.$align.'">';
echo '('.$item->label.') ';
- echo format_text($item->name . $requiredmark, true, false, false);
+ echo format_text($item->name . $requiredmark, FORMAT_HTML, array('noclean' => true, 'para' => false));
echo '</div>';
//print the presentation
@@ -535,7 +535,7 @@ public function print_item_show_value($item, $value = null) {
foreach ($values as $val) {
if ($val == $index) {
echo '<div class="feedback_item_multianswer">';
- echo text_to_html($pres, true, false, false);
+ echo format_text($pres, FORMAT_HTML, array('noclean' => true, 'para' => false));
echo '</div>';
break;
}
@@ -547,7 +547,7 @@ public function print_item_show_value($item, $value = null) {
foreach ($presentation as $pres) {
if ($value == $index) {
echo $OUTPUT->box_start('generalbox boxalign'.$align);
- echo text_to_html($pres, true, false, false);
+ echo format_text($pres, FORMAT_HTML, array('noclean' => true, 'para' => false));
echo $OUTPUT->box_end();
break;
}
@@ -703,7 +703,7 @@ private function print_item_radio($presentation, $item, $value, $info, $align) {
</span>
<span class="feedback_item_radiolabel_<?php echo $hv.'_'.$align;?>">
<label for="<?php echo $inputid;?>">
- <?php echo text_to_html($radio, true, false, false);?>&nbsp;
+ <?php echo format_text($radio, FORMAT_HTML, array('noclean' => true, 'para' => false));?>&nbsp;
</label>
</span>
</li>
@@ -751,7 +751,7 @@ private function print_item_check($presentation, $item, $value, $info, $align) {
</span>
<span class="feedback_item_radiolabel_<?php echo $hv.'_'.$align;?>">
<label for="<?php echo $inputid;?>">
- <?php echo text_to_html($check, true, false, false);?>&nbsp;
+ <?php echo format_text($check, FORMAT_HTML, array('noclean' => true, 'para' => false));?>&nbsp;
</label>
</span>
</li>
@@ -792,7 +792,7 @@ private function print_item_dropdown($presentation, $item, $value, $info, $align
}
?>
<option value="<?php echo $index;?>" <?php echo $selected;?>>
- <?php echo text_to_html($dropdown, true, false, false);?>
+ <?php echo format_text($dropdown, FORMAT_HTML, array('noclean' => true, 'para' => false));?>
</option>
<?php
$index++;
View
18 mod/feedback/item/multichoicerated/lib.php
@@ -305,7 +305,7 @@ public function print_item_preview($item) {
echo '<label for="'. $item->typ . '_' . $item->id .'">';
}
echo '('.$item->label.') ';
- echo format_text($item->name.$requiredmark, true, false, false);
+ echo format_text($item->name . $requiredmark, FORMAT_HTML, array('noclean' => true, 'para' => false));
if ($item->dependitem) {
if ($dependitem = $DB->get_record('feedback_item', array('id'=>$item->dependitem))) {
echo ' <span class="feedback_depend">';
@@ -358,10 +358,10 @@ public function print_item_complete($item, $value = '', $highlightrequire = fals
echo '<div class="feedback_item_label_'.$align.$highlight.'">';
if ($info->subtype == 'd') {
echo '<label for="'. $item->typ . '_' . $item->id .'">';
- echo format_text($item->name.$requiredmark, true, false, false);
+ echo format_text($item->name . $requiredmark, FORMAT_HTML, array('noclean' => true, 'para' => false));
echo '</label>';
} else {
- echo format_text($item->name.$requiredmark, true, false, false);
+ echo format_text($item->name . $requiredmark, FORMAT_HTML, array('noclean' => true, 'para' => false));
}
echo '</div>';
@@ -397,7 +397,7 @@ public function print_item_show_value($item, $value = '') {
//print the question and label
echo '<div class="feedback_item_label_'.$align.'">';
echo '('.$item->label.') ';
- echo format_text($item->name . $requiredmark, true, false, false);
+ echo format_text($item->name . $requiredmark, FORMAT_HTML, array('noclean' => true, 'para' => false));
echo '</div>';
//print the presentation
@@ -407,7 +407,7 @@ public function print_item_show_value($item, $value = '') {
if ($value == $index) {
$item_value = explode(FEEDBACK_MULTICHOICERATED_VALUE_SEP, $line);
echo $OUTPUT->box_start('generalbox boxalign'.$align);
- echo text_to_html($item_value[1], true, false, false);
+ echo format_text($item_value[1], FORMAT_HTML, array('noclean' => true, 'para' => false));
echo $OUTPUT->box_end();
break;
}
@@ -564,9 +564,9 @@ private function print_item_radio($item, $value, $info, $align, $showrating, $li
<?php
if ($showrating) {
$str_rating_value = '('.$radio_value[0].') '.$radio_value[1];
- echo text_to_html($str_rating_value, true, false, false);
+ echo format_text($str_rating_value, FORMAT_HTML, array('noclean' => true, 'para' => false));
} else {
- echo text_to_html($radio_value[1], true, false, false);
+ echo format_text($radio_value[1], FORMAT_HTML, array('noclean' => true, 'para' => false));
}
?>
</label>
@@ -602,11 +602,11 @@ private function print_item_dropdown($item, $value, $info, $align, $showrating,
$dropdown_value = explode(FEEDBACK_MULTICHOICERATED_VALUE_SEP, $line);
if ($showrating) {
echo '<option value="'.$index.'" '.$selected.'>';
- echo clean_text('('.$dropdown_value[0].') '.$dropdown_value[1]);
+ echo format_text('(' . $dropdown_value[0] . ') ' . $dropdown_value[1], FORMAT_HTML, array('para' => false));
echo '</option>';
} else {
echo '<option value="'.$index.'" '.$selected.'>';
- echo clean_text($dropdown_value[1]);
+ echo format_text($dropdown_value[1], FORMAT_HTML, array('para' => false));
echo '</option>';
}
$index++;

0 comments on commit 025000a

Please sign in to comment.
Something went wrong with that request. Please try again.