MDL-67653 questions: prevent the flag flickering as the page loads

This commit is contained in:
Tim Hunt 2020-01-09 20:19:43 +00:00
parent 77d1c41502
commit 76a49e4a1e
5 changed files with 18 additions and 10 deletions

View File

@ -39,10 +39,6 @@
border: 1px solid #dcdcdc;
}
body.jsenabled .questionflagcheckbox {
display: none;
}
#page-mod-quiz-attempt #connection-ok,
#page-mod-quiz-attempt #connection-error {
position: fixed;

View File

@ -323,21 +323,23 @@ class core_question_renderer extends plugin_renderer_base {
if ($flagged) {
$icon = 'i/flagged';
$alt = get_string('flagged', 'question');
$label = get_string('clickunflag', 'question');
} else {
$icon = 'i/unflagged';
$alt = get_string('notflagged', 'question');
$label = get_string('clickflag', 'question');
}
$attributes = array(
'src' => $this->image_url($icon),
'alt' => $alt,
'class' => 'questionflagimage',
);
if ($id) {
$attributes['id'] = $id;
}
$img = html_writer::empty_tag('img', $attributes);
if ($flagged) {
$img .= ' ' . get_string('flagged', 'question');
}
$img .= html_writer::span($label);
return $img;
}

View File

@ -409,7 +409,11 @@ body.path-question-type {
vertical-align: text-bottom;
}
.que input.questionflagimage {
body.jsenabled .questionflag input[type=checkbox] {
display: none;
}
.que .questionflagimage {
padding-right: 3px;
height: 16px;
width: 16px;

View File

@ -15014,7 +15014,10 @@ body.path-question-type {
.que .questioncorrectnessicon {
vertical-align: text-bottom; }
.que input.questionflagimage {
body.jsenabled .questionflag input[type=checkbox] {
display: none; }
.que .questionflagimage {
padding-right: 3px;
height: 16px;
width: 16px; }

View File

@ -15234,7 +15234,10 @@ body.path-question-type {
.que .questioncorrectnessicon {
vertical-align: text-bottom; }
.que input.questionflagimage {
body.jsenabled .questionflag input[type=checkbox] {
display: none; }
.que .questionflagimage {
padding-right: 3px;
height: 16px;
width: 16px; }