mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-23566 mod_lesson: Float answers so paragraphs line up correctly next to the inputs
This commit is contained in:
parent
f8fa440649
commit
c3af87ac64
2 changed files with 44 additions and 0 deletions
|
@ -495,6 +495,7 @@ class lesson_display_answer_form_multichoice_singleanswer extends moodleform {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($answers as $answer) {
|
foreach ($answers as $answer) {
|
||||||
$mform->addElement('html', '<div class="answeroption">');
|
$mform->addElement('html', '<div class="answeroption">');
|
||||||
|
$answer->answer = preg_replace('#>$#', '> ', $answer->answer);
|
||||||
$mform->addElement('radio','answerid',null,format_text($answer->answer, $answer->answerformat, $options),$answer->id, $disabled);
|
$mform->addElement('radio','answerid',null,format_text($answer->answer, $answer->answerformat, $options),$answer->id, $disabled);
|
||||||
$mform->setType('answer'.$i, PARAM_INT);
|
$mform->setType('answer'.$i, PARAM_INT);
|
||||||
if ($hasattempt && $answer->id == $USER->modattempts[$lessonid]->answerid) {
|
if ($hasattempt && $answer->id == $USER->modattempts[$lessonid]->answerid) {
|
||||||
|
@ -557,6 +558,7 @@ class lesson_display_answer_form_multichoice_multianswer extends moodleform {
|
||||||
$mform->setDefault('answer['.$answer->id.']', true);
|
$mform->setDefault('answer['.$answer->id.']', true);
|
||||||
}
|
}
|
||||||
// NOTE: our silly checkbox supports only value '1' - we can not use it like the radiobox above!!!!!!
|
// NOTE: our silly checkbox supports only value '1' - we can not use it like the radiobox above!!!!!!
|
||||||
|
$answer->answer = preg_replace('#>$#', '> ', $answer->answer);
|
||||||
$mform->addElement('checkbox', $answerid, null, format_text($answer->answer, $answer->answerformat, $options), $disabled);
|
$mform->addElement('checkbox', $answerid, null, format_text($answer->answer, $answer->answerformat, $options), $disabled);
|
||||||
$mform->setType($answerid, PARAM_INT);
|
$mform->setType($answerid, PARAM_INT);
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,48 @@
|
||||||
|
|
||||||
.path-mod-lesson .resourcecontent {text-align: center;}
|
.path-mod-lesson .resourcecontent {text-align: center;}
|
||||||
|
|
||||||
|
.path-mod-lesson .answeroption .fcheckbox > span,
|
||||||
|
.path-mod-lesson .answeroption .fradio > span {
|
||||||
|
position: relative;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.path-mod-lesson .answeroption .fcheckbox input,
|
||||||
|
.path-mod-lesson .answeroption .fradio input {
|
||||||
|
position: absolute;
|
||||||
|
top: 2px;
|
||||||
|
margin-top: 0px;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.path-mod-lesson .answeroption .fcheckbox label,
|
||||||
|
.path-mod-lesson .answeroption .fradio label {
|
||||||
|
padding-left: 20px;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.path-mod-lesson .answeroption .felement label p:last-child {
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.path-mod-lesson.dir-rtl .answeroption .fcheckbox > span,
|
||||||
|
.path-mod-lesson.dir-rtl .answeroption .fradio > span {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.path-mod-lesson.dir-rtl .answeroption .fcheckbox input,
|
||||||
|
.path-mod-lesson.dir-rtl .answeroption .fradio input {
|
||||||
|
left: inherit;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.path-mod-lesson.dir-rtl .answeroption .fcheckbox label,
|
||||||
|
.path-mod-lesson.dir-rtl .answeroption .fradio label {
|
||||||
|
padding-left: 0;
|
||||||
|
padding-right: 20px;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Style for view.php
|
* Style for view.php
|
||||||
**/
|
**/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue