mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
MDL-70374 qtype_multichoice: code cleanup
* Remove some obsoliete CSS. * Put the CSS in a more logical order. * Rename some variables in the renderer, for more clarity.
This commit is contained in:
parent
5426f8bc35
commit
7242488cc0
2 changed files with 11 additions and 20 deletions
|
@ -104,16 +104,16 @@ abstract class qtype_multichoice_renderer_base extends qtype_with_combined_feedb
|
|||
));
|
||||
}
|
||||
|
||||
$questionnumber = '';
|
||||
$choicenumber = '';
|
||||
if ($question->answernumbering !== 'none') {
|
||||
$questionnumber = html_writer::span(
|
||||
$choicenumber = 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');
|
||||
$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',
|
||||
]);
|
||||
|
|
|
@ -1,9 +1,3 @@
|
|||
.que.multichoice .answer .specificfeedback {
|
||||
display: inline;
|
||||
padding: 0 0.7em;
|
||||
background: #fff3bf;
|
||||
}
|
||||
|
||||
.que.multichoice .answer div.r0,
|
||||
.que.multichoice .answer div.r1 {
|
||||
display: flex;
|
||||
|
@ -11,15 +5,6 @@
|
|||
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;
|
||||
|
@ -30,6 +15,12 @@
|
|||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue