MDL-68277 qtype_essay: answer area in reviews should be right size

The answer box size is set by teachers and provides a useful
visual cue how long a response was expected. Therefore, it is
useful to keep the space at least that size in quiz reviews, etc.
This commit is contained in:
Tim Hunt 2020-03-27 13:29:40 +00:00
parent d939d6e769
commit dbf72bb40f

View File

@ -225,7 +225,10 @@ class qtype_essay_format_editor_renderer extends plugin_renderer_base {
public function response_area_read_only($name, $qa, $step, $lines, $context) {
return html_writer::tag('div', $this->prepare_response($name, $qa, $step, $context),
array('class' => $this->class_name() . ' qtype_essay_response readonly'));
['class' => $this->class_name() . ' qtype_essay_response readonly',
'style' => 'min-height: ' . ($lines * 1.5) . 'em;']);
// Height $lines * 1.5 because that is a typical line-height on web pages.
// That seems to give results that look OK.
}
public function response_area_input($name, $qa, $step, $lines, $context) {