Skip to content

Commit

Permalink
MDL-70374 qtype_multichoice: improve alignment of choices
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Dec 18, 2020
1 parent c25f008 commit 591107c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion question/type/multichoice/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ public function formulation_and_controls(question_attempt $qa,
));
}

$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');

Expand Down
4 changes: 4 additions & 0 deletions question/type/multichoice/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
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;
Expand Down

0 comments on commit 591107c

Please sign in to comment.