From 393de4b8719d191fa7b2e1c838636698dbe3518c Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Fri, 18 Jan 2019 13:36:48 +0000 Subject: [PATCH] MDL-79863 qtype_ordering: Show a dotted border around the entire list if the question is active --- question/type/ordering/renderer.php | 10 +++++++--- question/type/ordering/styles.css | 7 ++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/question/type/ordering/renderer.php b/question/type/ordering/renderer.php index 4147bd61bc4..c123087d356 100644 --- a/question/type/ordering/renderer.php +++ b/question/type/ordering/renderer.php @@ -97,6 +97,10 @@ class qtype_ordering_renderer extends qtype_with_combined_feedback_renderer { // Set layout class. $layoutclass = $question->get_ordering_layoutclass(); + $activeclass = ''; + if ($qa->get_state()->is_active()) { + $activeclass = ' orderingactive'; + } // Generate ordering items. foreach ($currentresponse as $position => $answerid) { @@ -110,9 +114,9 @@ class qtype_ordering_renderer extends qtype_with_combined_feedback_renderer { if ($printeditems == false) { $printeditems = true; - $result .= html_writer::start_tag('div', array('class' => 'ablock', 'id' => $ablockid, 'contenteditable' => 'true')); - $result .= html_writer::start_tag('div', array('class' => 'answer ordering', 'contenteditable' => 'false')); - $result .= html_writer::start_tag('ul', array('class' => 'sortablelist', 'id' => $sortableid)); + $result .= html_writer::start_tag('div', array('class' => 'ablock', 'id' => $ablockid)); + $result .= html_writer::start_tag('div', array('class' => 'answer ordering')); + $result .= html_writer::start_tag('ul', array('class' => 'sortablelist' . $activeclass, 'id' => $sortableid)); } // Set the CSS class and correctness img for this response. diff --git a/question/type/ordering/styles.css b/question/type/ordering/styles.css index f56e180ed26..b213e6075b7 100644 --- a/question/type/ordering/styles.css +++ b/question/type/ordering/styles.css @@ -10,11 +10,16 @@ list-style-type : none; margin : 0; margin-left : 5px; - padding : 4px 4px 0 4px; + padding : 4px; +} +.que.ordering ul.sortablelist.orderingactive { + border : 1px dotted #333; + border-radius : 4px; } .que.ordering ul.sortablelist li { background-color : #ffffff; border : 1px solid #000; + border-radius : 4px; list-style-type : none; margin : 4px; padding : 6px 12px;