mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
MDL-70134 essay qtype: Provide options for smaller response boxes
And make the default box size 10
This commit is contained in:
parent
f0934f6db9
commit
f6a665a84a
@ -52,7 +52,7 @@ class qtype_essay_edit_form extends question_edit_form {
|
||||
|
||||
$mform->addElement('select', 'responsefieldlines',
|
||||
get_string('responsefieldlines', 'qtype_essay'), $qtype->response_sizes());
|
||||
$mform->setDefault('responsefieldlines', 15);
|
||||
$mform->setDefault('responsefieldlines', 10);
|
||||
$mform->hideIf('responsefieldlines', 'responseformat', 'eq', 'noinline');
|
||||
|
||||
// Create a text box that can be enabled/disabled for max/min word limits options.
|
||||
|
@ -136,7 +136,10 @@ class qtype_essay extends question_type {
|
||||
* @return array the choices that should be offered for the input box size.
|
||||
*/
|
||||
public function response_sizes() {
|
||||
$choices = array();
|
||||
$choices = [
|
||||
2 => get_string('nlines', 'qtype_essay', 2),
|
||||
3 => get_string('nlines', 'qtype_essay', 3),
|
||||
];
|
||||
for ($lines = 5; $lines <= 40; $lines += 5) {
|
||||
$choices[$lines] = get_string('nlines', 'qtype_essay', $lines);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user