From dbf72bb40fb6a44a66f5d6e35cb54473135b5517 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Fri, 27 Mar 2020 13:29:40 +0000 Subject: [PATCH] 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. --- question/type/essay/renderer.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/question/type/essay/renderer.php b/question/type/essay/renderer.php index 5f649f2a9f5..06116ea5801 100644 --- a/question/type/essay/renderer.php +++ b/question/type/essay/renderer.php @@ -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) {