Skip to content

Commit

Permalink
Merge branch 'MDL-70374' of https://github.com/timhunt/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Jan 7, 2021
2 parents c59c8e7 + add7eba commit 50fdadf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
12 changes: 8 additions & 4 deletions question/type/multichoice/renderer.php
Expand Up @@ -104,12 +104,16 @@ public function formulation_and_controls(question_attempt $qa,
));
}

$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');
$choicenumber = '';
if ($question->answernumbering !== 'none') {
$choicenumber = html_writer::span(
$this->number_in_style($value, $question->answernumbering), 'answernumber');
}
$choicetext = $question->format_text($ans->answer, $ans->answerformat, $qa, 'question', 'answer', $ansid);
$choice = html_writer::div($choicetext, 'flex-fill ml-1');

$radiobuttons[] = $hidden . html_writer::empty_tag('input', $inputattributes) .
html_writer::div($questionnumber . $questionanswer, 'd-flex w-100', [
html_writer::div($choicenumber . $choice, 'd-flex w-100', [
'id' => $inputattributes['id'] . '_label',
'data-region' => 'answer-label',
]);
Expand Down
25 changes: 10 additions & 15 deletions question/type/multichoice/styles.css
@@ -1,31 +1,26 @@
.que.multichoice .answer .specificfeedback {
display: inline;
padding: 0 0.7em;
background: #fff3bf;
}

.que.multichoice .answer div.r0,
.que.multichoice .answer div.r1 {
display: flex;
margin: 0.25rem 0;
align-items: flex-start;
}

.que.multichoice .answer div.r0 label,
.que.multichoice .answer div.r1 label,
.que.multichoice .answer div.r0 div.specificfeedback,
.que.multichoice .answer div.r1 div.specificfeedback {
/* In Chrome and IE, the text-indent above is applied to any embedded table
cells or <li>s, which screws up the intended layout. This fixes it again. */
text-indent: 0;
}

.que.multichoice .answer div.r0 input,
.que.multichoice .answer div.r1 input {
margin: 0.3rem 0.5rem;
width: 14px;
}

.que.multichoice .answer .answernumber {
min-width: 1.5em;
}

.que.multichoice .answer .specificfeedback {
display: inline;
padding: 0 0.7em;
background: #fff3bf;
}

/* Editing form. */
body#page-question-type-multichoice div[id^=fitem_id_][id*=answer_] {
background: #eee;
Expand Down

0 comments on commit 50fdadf

Please sign in to comment.