mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merge branch 'MDL-30843_b' of git://github.com/rwijaya/moodle
This commit is contained in:
commit
5bfeb5ffd3
108 changed files with 390 additions and 216 deletions
|
@ -94,6 +94,7 @@ abstract class qbehaviour_renderer extends plugin_renderer_base {
|
|||
'name' => $inputname . 'format', 'value' => key($formats)));
|
||||
|
||||
} else {
|
||||
$commenteditor .= html_writer::label($commentformat, 'menu' . $inputname, false, array('class' => 'accesshide'));
|
||||
$commenteditor .= html_writer::select(
|
||||
$formats, $inputname . 'format', $commentformat, '');
|
||||
}
|
||||
|
|
|
@ -114,7 +114,8 @@ class qformat_xhtml extends qformat_default {
|
|||
shuffle( $ans_list ); // random display order
|
||||
|
||||
// build drop down for answers
|
||||
$dropdown = "<select name=\"quest_$id\">\n";
|
||||
$dropdown = '<label class="accesshide" for="quest_' . $id . '">' . get_string('options', 'question') . '</label>';
|
||||
$dropdown .= "<select name=\"quest_$id\">\n";
|
||||
foreach($ans_list as $ans) {
|
||||
$dropdown .= "<option value=\"" . s($ans) . "\">" . s($ans) . "</option>\n";
|
||||
}
|
||||
|
|
|
@ -749,11 +749,13 @@ class qtype_calculated extends question_type {
|
|||
? 'decimals'
|
||||
: 'significantfigures'), 'qtype_calculated', $i);
|
||||
}
|
||||
$menu1 = html_writer::select($lengthoptions, 'calclength[]', $regs[4], null);
|
||||
$menu1 = html_writer::label($regs[4], 'menucalclength', false, array('class' => 'accesshide'));
|
||||
$menu1 .= html_writer::select($lengthoptions, 'calclength[]', $regs[4], null);
|
||||
|
||||
$options = array('uniform' => get_string('uniformbit', 'qtype_calculated'),
|
||||
'loguniform' => get_string('loguniformbit', 'qtype_calculated'));
|
||||
$menu2 = html_writer::select($options, 'calcdistribution[]', $regs[1], null);
|
||||
$menu2 = html_writer::label($regs[1], 'menucalcdistribution', false, array('class' => 'accesshide'));
|
||||
$menu2 .= html_writer::select($options, 'calcdistribution[]', $regs[1], null);
|
||||
return '<input type="submit" onclick="'
|
||||
. "getElementById('addform').regenerateddefid.value='$defid'; return true;"
|
||||
.'" value="'. get_string('generatevalue', 'qtype_calculated') . '"/><br/>'
|
||||
|
@ -1193,7 +1195,8 @@ class qtype_calculated extends question_type {
|
|||
list($options, $selected) =
|
||||
$this->dataset_options($form, $datasetname);
|
||||
unset($options['0']); // Mandatory...
|
||||
$datasetmenus[$datasetname] = html_writer::select(
|
||||
$datasetmenus[$datasetname] = html_writer::label($selected, 'menudataset', false , array('class' => 'accesshide'));
|
||||
$datasetmenus[$datasetname] .= html_writer::select(
|
||||
$options, 'dataset[]', $selected, null);
|
||||
}
|
||||
}
|
||||
|
@ -1201,7 +1204,8 @@ class qtype_calculated extends question_type {
|
|||
if (!isset($datasetmenus[$datasetname])) {
|
||||
list($options, $selected) =
|
||||
$this->dataset_options($form, $datasetname);
|
||||
$datasetmenus[$datasetname] = html_writer::select(
|
||||
$datasetmenus[$datasetname] = html_writer::label($selected, 'menudataset', false , array('class' => 'accesshide'));
|
||||
$datasetmenus[$datasetname] .= html_writer::select(
|
||||
$options, 'dataset[]', $selected, null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -223,6 +223,7 @@ class qtype_essay_format_editor_renderer extends plugin_renderer_base {
|
|||
'name' => $inputname . 'format', 'value' => key($formats)));
|
||||
|
||||
} else {
|
||||
$output .= html_writer::label($responseformat, 'menu' . $inputname . 'format');
|
||||
$output .= html_writer::select($formats, $inputname . 'format', $responseformat, '');
|
||||
}
|
||||
$output .= html_writer::end_tag('div');
|
||||
|
|
|
@ -80,6 +80,7 @@ class qtype_match_renderer extends qtype_with_combined_feedback_renderer {
|
|||
}
|
||||
|
||||
$result .= html_writer::tag('td',
|
||||
html_writer::label($selected, 'menu' . $qa->get_qt_field_name('sub' . $key), false, array('class' => 'accesshide')) .
|
||||
html_writer::select($choices, $qa->get_qt_field_name('sub' . $key), $selected,
|
||||
array('0' => 'choose'), array('disabled' => $options->readonly)) .
|
||||
' ' . $feedbackimage, array('class' => $classes));
|
||||
|
|
|
@ -223,7 +223,7 @@ class qtype_multianswer_textfield_renderer extends qtype_multianswer_subq_render
|
|||
s($correctanswer->answer), $options);
|
||||
|
||||
$output = '';
|
||||
$output .= html_writer::start_tag('label', array('class' => 'subq'));
|
||||
$output .= html_writer::start_tag('label', array('class' => 'subq', 'for' => $inputattributes['id']));
|
||||
$output .= html_writer::empty_tag('input', $inputattributes);
|
||||
$output .= $feedbackimg;
|
||||
$output .= $feedbackpopup;
|
||||
|
@ -274,8 +274,8 @@ class qtype_multianswer_multichoice_inline_renderer
|
|||
$inputattributes['class'] = $this->feedback_class($matchinganswer->fraction);
|
||||
$feedbackimg = $this->feedback_image($matchinganswer->fraction);
|
||||
}
|
||||
|
||||
$select = html_writer::select($choices, $qa->get_qt_field_name($fieldname),
|
||||
$selecg = html_writer::label($response, $inputattributes['id']);
|
||||
$select .= html_writer::select($choices, $qa->get_qt_field_name($fieldname),
|
||||
$response, array('' => ''), $inputattributes);
|
||||
|
||||
$order = $subq->get_order($qa);
|
||||
|
|
|
@ -76,7 +76,8 @@ class qtype_numerical_renderer extends qtype_renderer {
|
|||
$inputattributes['size'] = round(strlen($placeholder) * 1.1);
|
||||
}
|
||||
|
||||
$input = html_writer::empty_tag('input', $inputattributes) . $feedbackimg;
|
||||
$input = html_writer::label($inputattributes['name'], $inputattributes['id']);
|
||||
$input .= html_writer::empty_tag('input', $inputattributes) . $feedbackimg;
|
||||
|
||||
if ($question->has_separate_unit_field()) {
|
||||
if ($question->unitdisplay == qtype_numerical::UNITRADIO) {
|
||||
|
@ -98,7 +99,8 @@ class qtype_numerical_renderer extends qtype_renderer {
|
|||
array('class' => 'unitchoices'));
|
||||
|
||||
} else if ($question->unitdisplay == qtype_numerical::UNITSELECT) {
|
||||
$unitchoice = html_writer::select($question->ap->get_unit_options(),
|
||||
$unitchoice = html_writer::label($selectedunit, 'menu' . $qa->get_qt_field_name('unit'));
|
||||
$unitchoice .= html_writer::select($question->ap->get_unit_options(),
|
||||
$qa->get_qt_field_name('unit'), $selectedunit, array(''=>'choosedots'),
|
||||
array('disabled' => $options->readonly));
|
||||
}
|
||||
|
|
|
@ -71,8 +71,8 @@ class qtype_shortanswer_renderer extends qtype_renderer {
|
|||
$placeholder = $matches[0];
|
||||
$inputattributes['size'] = round(strlen($placeholder) * 1.1);
|
||||
}
|
||||
|
||||
$input = html_writer::empty_tag('input', $inputattributes) . $feedbackimg;
|
||||
$input = html_writer::label($inputattributes['name'], $inputattributes['id']);
|
||||
$input .= html_writer::empty_tag('input', $inputattributes) . $feedbackimg;
|
||||
|
||||
if ($placeholder) {
|
||||
$questiontext = substr_replace($questiontext, $input,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue