From 39ed2eee2a84019dd32f9662a9ceff69f0229b3f Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Wed, 23 Nov 2011 17:04:35 +0000 Subject: [PATCH] MDL-47494 ddimageortext: Fix invalid HTML caused by empty_tag('div', ...). #2273 --- question/type/ddimageortext/rendererbase.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/question/type/ddimageortext/rendererbase.php b/question/type/ddimageortext/rendererbase.php index 13e899fc974..a6a2ab77c87 100644 --- a/question/type/ddimageortext/rendererbase.php +++ b/question/type/ddimageortext/rendererbase.php @@ -102,15 +102,17 @@ class qtype_ddtoimage_renderer_base extends qtype_with_combined_feedback_rendere $dragitemsclass .= ' readonly'; } $dragitems = html_writer::tag('div', $dragimagehomes, array('class'=> $dragitemsclass)); - $dropzones = html_writer::empty_tag('div', array('class'=>'dropzones')); - $output .= html_writer::tag('div', $droparea.$dragitems.$dropzones, - array('class'=>'ddarea')); + $dropzones = html_writer::tag('div', '', array('class'=>'dropzones')); + + $hiddens = ''; foreach ($question->places as $placeno => $place) { $varname = $question->field($placeno); list($fieldname, $html) = $this->hidden_field_for_qt_var($qa, $varname); - $output .= $html; + $hiddens .= $html; $question->places[$placeno]->fieldname = $fieldname; } + $output .= html_writer::tag('div', + $droparea . $dragitems . $dropzones . $hiddens, array('class'=>'ddarea')); $topnode = 'div#q'.$qa->get_slot().' div.ddarea'; $params = array('drops' => $question->places, 'topnode' => $topnode,