Skip to content

Commit

Permalink
Merge branch 'MDL-42210_24' of git://github.com/grabs/moodle into MOO…
Browse files Browse the repository at this point in the history
…DLE_24_STABLE
  • Loading branch information
Damyon Wiese committed Oct 23, 2013
2 parents 9de894d + 4ae00d7 commit b807cc6
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 11 deletions.
12 changes: 12 additions & 0 deletions mod/feedback/item/multichoice/lib.php
Expand Up @@ -316,6 +316,9 @@ public function print_item_preview($item) {

//print the question and label
echo '<div class="feedback_item_label_'.$align.'">';
if ($info->subtype == 'd') {
echo '<label for="'. $item->typ . '_' . $item->id .'">';
}
echo '('.$item->label.') ';
echo format_text($item->name.$requiredmark, true, false, false);
if ($item->dependitem) {
Expand All @@ -325,6 +328,9 @@ public function print_item_preview($item) {
echo '</span>';
}
}
if ($info->subtype == 'd') {
echo '</label>';
}
echo '</div>';

//print the presentation
Expand Down Expand Up @@ -420,7 +426,13 @@ public function print_item_complete($item, $value = null, $highlightrequire = fa

//print the question and label
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 '</label>';
} else {
echo format_text($item->name.$requiredmark, true, false, false);
}
echo '</div>';

//print the presentation
Expand Down
12 changes: 12 additions & 0 deletions mod/feedback/item/multichoicerated/lib.php
Expand Up @@ -301,6 +301,9 @@ public function print_item_preview($item) {
$requiredmark = ($item->required == 1) ? $str_required_mark : '';
//print the question and label
echo '<div class="feedback_item_label_'.$align.'">';
if ($info->subtype == 'd') {
echo '<label for="'. $item->typ . '_' . $item->id .'">';
}
echo '('.$item->label.') ';
echo format_text($item->name.$requiredmark, true, false, false);
if ($item->dependitem) {
Expand All @@ -310,6 +313,9 @@ public function print_item_preview($item) {
echo '</span>';
}
}
if ($info->subtype == 'd') {
echo '</label>';
}
echo '</div>';

//print the presentation
Expand Down Expand Up @@ -350,7 +356,13 @@ public function print_item_complete($item, $value = '', $highlightrequire = fals

//print the question and label
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 '</label>';
} else {
echo format_text($item->name.$requiredmark, true, false, false);
}
echo '</div>';

//print the presentation
Expand Down
10 changes: 9 additions & 1 deletion mod/feedback/item/numeric/lib.php
Expand Up @@ -252,7 +252,9 @@ public function print_item_preview($item) {

$requiredmark = ($item->required == 1) ? $str_required_mark : '';
//print the question and label
$inputname = $item->typ . '_' . $item->id;
echo '<div class="feedback_item_label_'.$align.'">';
echo '<label for="'. $inputname .'">';
echo '('.$item->label.') ';
echo format_text($item->name . $requiredmark, true, false, false);
if ($item->dependitem) {
Expand Down Expand Up @@ -281,13 +283,15 @@ public function print_item_preview($item) {
break;
}
echo '</span>';
echo '</label>';
echo '</div>';

//print the presentation
echo '<div class="feedback_item_presentation_'.$align.'">';
echo '<span class="feedback_item_textfield">';
echo '<input type="text" '.
'name="'.$item->typ.'_'.$item->id.'" '.
'id="'.$inputname.'" '.
'name="'.$inputname.'" '.
'size="10" '.
'maxlength="10" '.
'value="" />';
Expand Down Expand Up @@ -335,7 +339,9 @@ public function print_item_complete($item, $value = '', $highlightrequire = fals
$requiredmark = ($item->required == 1) ? $str_required_mark : '';

//print the question and label
$inputname = $item->typ . '_' . $item->id;
echo '<div class="feedback_item_label_'.$align.$highlight.'">';
echo '<label for="'. $inputname .'">';
echo format_text($item->name . $requiredmark, true, false, false);
echo '<span class="feedback_item_numinfo">';
switch(true) {
Expand All @@ -355,12 +361,14 @@ public function print_item_complete($item, $value = '', $highlightrequire = fals
break;
}
echo '</span>';
echo '</label>';
echo '</div>';

//print the presentation
echo '<div class="feedback_item_presentation_'.$align.$highlight.'">';
echo '<span class="feedback_item_textfield">';
echo '<input type="text" '.
'id="'.$inputname.'" '.
'name="'.$item->typ.'_'.$item->id.'" '.
'size="10" '.
'maxlength="10" '.
Expand Down
18 changes: 13 additions & 5 deletions mod/feedback/item/textarea/lib.php
Expand Up @@ -190,7 +190,7 @@ public function excelprint_item(&$worksheet, $row_offset,
return $row_offset;
}

/**
/**
* print the item at the edit-page of feedback
*
* @global object
Expand All @@ -206,7 +206,9 @@ public function print_item_preview($item) {
$presentation = explode ("|", $item->presentation);
$requiredmark = ($item->required == 1) ? $str_required_mark : '';
//print the question and label
$inputname = $item->typ . '_' . $item->id;
echo '<div class="feedback_item_label_'.$align.'">';
echo '<label for="'. $inputname .'">';
echo '('.$item->label.') ';
echo format_text($item->name.$requiredmark, true, false, false);
if ($item->dependitem) {
Expand All @@ -216,20 +218,22 @@ public function print_item_preview($item) {
echo '</span>';
}
}
echo '</label>';
echo '</div>';

//print the presentation
echo '<div class="feedback_item_presentation_'.$align.'">';
echo '<span class="feedback_item_textarea">';
echo '<textarea name="'.$item->typ.'_'.$item->id.'" '.
echo '<textarea id="'.$inputname.'" '.
'name="'.$inputname.'" '.
'cols="'.$presentation[0].'" '.
'rows="'.$presentation[1].'">';
echo '</textarea>';
echo '</span>';
echo '</div>';
}

/**
/**
* print the item at the complete-page of feedback
*
* @global object
Expand All @@ -252,14 +256,18 @@ public function print_item_complete($item, $value = '', $highlightrequire = fals
$requiredmark = ($item->required == 1) ? $str_required_mark :'';

//print the question and label
$inputname = $item->typ . '_' . $item->id;
echo '<div class="feedback_item_label_'.$align.$highlight.'">';
echo '<label for="'. $inputname .'">';
echo format_text($item->name . $requiredmark, true, false, false);
echo '</label>';
echo '</div>';

//print the presentation
echo '<div class="feedback_item_presentation_'.$align.$highlight.'">';
echo '<span class="feedback_item_textarea">';
echo '<textarea name="'.$item->typ.'_'.$item->id.'" '.
echo '<textarea id="'.$inputname.'" '.
'name="'.$inputname.'" '.
'cols="'.$presentation[0].'" '.
'rows="'.$presentation[1].'">';
echo $value;
Expand All @@ -268,7 +276,7 @@ public function print_item_complete($item, $value = '', $highlightrequire = fals
echo '</div>';
}

/**
/**
* print the item at the complete-page of feedback
*
* @global object
Expand Down
18 changes: 13 additions & 5 deletions mod/feedback/item/textfield/lib.php
Expand Up @@ -179,7 +179,7 @@ public function excelprint_item(&$worksheet, $row_offset,
return $row_offset;
}

/**
/**
* print the item at the edit-page of feedback
*
* @global object
Expand All @@ -194,7 +194,9 @@ public function print_item_preview($item) {
$presentation = explode ("|", $item->presentation);
$requiredmark = ($item->required == 1) ? $str_required_mark : '';
//print the question and label
$inputname = $item->typ . '_' . $item->id;
echo '<div class="feedback_item_label_'.$align.'">';
echo '<label for="'. $inputname .'">';
echo '('.$item->label.') ';
echo format_text($item->name.$requiredmark, true, false, false);
if ($item->dependitem) {
Expand All @@ -204,21 +206,23 @@ public function print_item_preview($item) {
echo '</span>';
}
}
echo '</label>';
echo '</div>';

//print the presentation
echo '<div class="feedback_item_presentation_'.$align.'">';
echo '<span class="feedback_item_textfield">';
echo '<input type="text" '.
'name="'.$item->typ.'_'.$item->id.'" '.
'id="'.$inputname.'" '.
'name="'.$inputname.'" '.
'size="'.$presentation[0].'" '.
'maxlength="'.$presentation[1].'" '.
'value="" />';
echo '</span>';
echo '</div>';
}

/**
/**
* print the item at the complete-page of feedback
*
* @global object
Expand All @@ -241,23 +245,27 @@ public function print_item_complete($item, $value = '', $highlightrequire = fals
$requiredmark = ($item->required == 1) ? $str_required_mark : '';

//print the question and label
$inputname = $item->typ . '_' . $item->id;
echo '<div class="feedback_item_label_'.$align.$highlight.'">';
echo '<label for="'. $inputname .'">';
echo format_text($item->name.$requiredmark, true, false, false);
echo '</label>';
echo '</div>';

//print the presentation
echo '<div class="feedback_item_presentation_'.$align.$highlight.'">';
echo '<span class="feedback_item_textfield">';
echo '<input type="text" '.
'name="'.$item->typ.'_'.$item->id.'" '.
'id="'.$inputname.'" '.
'name="'.$inputname.'" '.
'size="'.$presentation[0].'" '.
'maxlength="'.$presentation[1].'" '.
'value="'.$value.'" />';
echo '</span>';
echo '</div>';
}

/**
/**
* print the item at the complete-page of feedback
*
* @global object
Expand Down

0 comments on commit b807cc6

Please sign in to comment.