MDL-70374 qtype_multichoice: improve alignment of choices
authorTim Hunt <T.J.Hunt@open.ac.uk>
Fri, 18 Dec 2020 12:58:15 +0000 (12:58 +0000)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Fri, 18 Dec 2020 13:10:13 +0000 (13:10 +0000)
question/type/multichoice/renderer.php
question/type/multichoice/styles.css

index 89563b2..93154f0 100644 (file)
@@ -104,7 +104,11 @@ abstract class qtype_multichoice_renderer_base extends qtype_with_combined_feedb
                 ));
             }
 
-            $questionnumber = html_writer::span($this->number_in_style($value, $question->answernumbering), 'answernumber');
+            $questionnumber = '';
+            if ($question->answernumbering !== 'none') {
+                $questionnumber = html_writer::span(
+                        $this->number_in_style($value, $question->answernumbering), 'answernumber');
+            }
             $answertext = $question->format_text($ans->answer, $ans->answerformat, $qa, 'question', 'answer', $ansid);
             $questionanswer = html_writer::div($answertext, 'flex-fill ml-1');
 
index df8ed86..546ad39 100644 (file)
     width: 14px;
 }
 
+.que.multichoice .answer .answernumber {
+    min-width: 1.5em;
+}
+
 /* Editing form. */
 body#page-question-type-multichoice div[id^=fitem_id_][id*=answer_] {
     background: #eee;