MDL-79863 qtype_ordering: Show a dotted border around the entire list if the question is active

This commit is contained in:
Tim Hunt 2019-01-18 13:36:48 +00:00 committed by Mathew May
parent d876a38973
commit 393de4b871
2 changed files with 13 additions and 4 deletions

View file

@ -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.

View file

@ -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;