Merge branch 'MDL-64749' of https://github.com/mkassaei/moodle
This commit is contained in:
@@ -71,17 +71,9 @@ class qtype_gapselect_renderer extends qtype_elements_embedded_in_question_text_
|
||||
}
|
||||
}
|
||||
|
||||
// If the text is short use non-breaking space.
|
||||
$choose = ' ';
|
||||
foreach ($selectoptions as $key => $text) {
|
||||
if (strlen(get_string('choosedots')) / 2 <= strlen($text)) {
|
||||
$choose = get_string('choosedots');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Use non-breaking space instead of 'Choose...'.
|
||||
$selecthtml = html_writer::select($selectoptions, $qa->get_qt_field_name($fieldname),
|
||||
$value, $choose, $attributes) . ' ' . $feedbackimage;
|
||||
$value, ' ', $attributes) . ' ' . $feedbackimage;
|
||||
return html_writer::tag('span', $selecthtml, array('class' => 'control '.$groupclass));
|
||||
}
|
||||
|
||||
|
||||
@@ -60,9 +60,9 @@ class qtype_gapselect_walkthrough_test extends qbehaviour_walkthrough_test_base
|
||||
// Also note the ' ' in the p2 example below is a nbsp (used when names are short).
|
||||
$this->check_output_contains_selectoptions(
|
||||
$this->get_contains_select_expectation('p1',
|
||||
['' => get_string('choosedots'), '1' => 'quick', '2' => 'slow'], null, true),
|
||||
['0' => ' ', '1' => 'quick', '2' => 'slow'], null, true),
|
||||
$this->get_contains_select_expectation('p2',
|
||||
['' => ' ', '1' => 'fox', '2' => 'dog'], null, true),
|
||||
['0' => ' ', '1' => 'fox', '2' => 'dog'], null, true),
|
||||
$this->get_contains_select_expectation('p3',
|
||||
['1' => 'lazy', '2' => 'assiduous'], null, true));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user