MDL-68761 question_multichoice: show question content inline
authorBas Brands <bas@moodle.com>
Tue, 2 Jun 2020 15:01:41 +0000 (17:01 +0200)
committerBas Brands <bas@moodle.com>
Wed, 3 Jun 2020 09:02:59 +0000 (11:02 +0200)
question/type/multichoice/renderer.php
question/type/multichoice/styles.css

index 33e45e7..7412d7a 100644 (file)
@@ -105,10 +105,12 @@ abstract class qtype_multichoice_renderer_base extends qtype_with_combined_feedb
             $radiobuttons[] = $hidden . html_writer::empty_tag('input', $inputattributes) .
                     html_writer::tag('label',
                         html_writer::span($this->number_in_style($value, $question->answernumbering), 'answernumber') .
-                        $question->make_html_inline($question->format_text(
-                                $ans->answer, $ans->answerformat,
-                                $qa, 'question', 'answer', $ansid)),
-                        array('for' => $inputattributes['id'], 'class' => 'ml-1'));
+                        html_writer::tag('div',
+                        $question->format_text(
+                                    $ans->answer, $ans->answerformat,
+                                    $qa, 'question', 'answer', $ansid),
+                        array('class' => 'flex-fill ml-1')),
+                        array('for' => $inputattributes['id'], 'class' => 'd-flex w-100'));
 
             // Param $options->suppresschoicefeedback is a hack specific to the
             // oumultiresponse question type. It would be good to refactor to
index 5707361..cef8048 100644 (file)
@@ -6,8 +6,9 @@
 
 .que.multichoice .answer div.r0,
 .que.multichoice .answer div.r1 {
-    padding: 0.3em 0 0.3em 25px;
-    text-indent: -25px;
+    display: flex;
+    margin: 0.25rem 0;
+    align-items: flex-start;
 }
 
 .que.multichoice .answer div.r0 label,
@@ -21,9 +22,7 @@
 
 .que.multichoice .answer div.r0 input,
 .que.multichoice .answer div.r1 input {
-    margin: 0 5px;
-    padding: 0;
-    width: 15px;
+    margin: 0.4rem 0.5rem;
 }
 
 /* Editing form. */