From 021f2af90972538551e93e07cc722a5a2cea8d23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Mon, 25 Sep 2017 16:13:37 +0200 Subject: [PATCH] MOBILE-2234 quiz: Always show radio buttons on multiple choice --- www/addons/mod/quiz/templates/index.html | 2 +- www/core/components/question/scss/styles.scss | 6 ++- www/core/scss/styles.scss | 47 +++++++++++++++++++ 3 files changed, 52 insertions(+), 3 deletions(-) diff --git a/www/addons/mod/quiz/templates/index.html b/www/addons/mod/quiz/templates/index.html index beafeb30b6c..12dd5eaeccc 100644 --- a/www/addons/mod/quiz/templates/index.html +++ b/www/addons/mod/quiz/templates/index.html @@ -57,7 +57,7 @@

{{ 'mma.mod_quiz.summaryofattempts' | translate }}

-
+

{{ gradeResult }}

{{ 'mm.course.overriddennotice' | translate }}

diff --git a/www/core/components/question/scss/styles.scss b/www/core/components/question/scss/styles.scss index 47ee9dcb3cc..2a35455c6b4 100644 --- a/www/core/components/question/scss/styles.scss +++ b/www/core/components/question/scss/styles.scss @@ -39,7 +39,8 @@ li.mm-question-answer-correct, } .mm-question-answer-correct .checkbox input:disabled:checked:before, -.mm-question-answer-correct .checkbox input:disabled:checked + .checkbox-icon:before { +.mm-question-answer-correct .checkbox input:disabled:checked + .checkbox-icon:before, +.mm-question-answer-correct.item-radio input:checked + .radio-content .radio-icon:before { background-color: $mm-question-correct-color; border-color: $mm-question-correct-color; } @@ -65,7 +66,8 @@ li.mm-question-answer-incorrect, } .mm-question-answer-incorrect .checkbox input:disabled:checked:before, -.mm-question-answer-incorrect .checkbox input:disabled:checked + .checkbox-icon:before { +.mm-question-answer-incorrect .checkbox input:disabled:checked + .checkbox-icon:before, +.mm-question-answer-incorrect.item-radio input:checked + .radio-content .radio-icon:before { background-color: $mm-question-incorrect-color; border-color: $mm-question-incorrect-color; } diff --git a/www/core/scss/styles.scss b/www/core/scss/styles.scss index b9ceba30e8e..c2a4843c334 100644 --- a/www/core/scss/styles.scss +++ b/www/core/scss/styles.scss @@ -1036,6 +1036,53 @@ mm-multiple-select { border-radius: 0; } +.item-radio .radio-icon { + width: 28px; + height: 28px; + padding: 0; + display: block; + border: 0; + background: transparent; + cursor: pointer; + -webkit-appearance: none; + top: 14px; + right: 14px; + visibility: visible; + + &:before { + border: 1px solid #ddd; + display: table; + width: 100%; + height: 100%; + border-radius: 28px; + background: white; + -webkit-transition: background-color 20ms ease-in-out; + transition: background-color 20ms ease-in-out; + content: ' '; + } + + &:after { + @include transition(opacity .05s ease-in-out); + @include rotate(-45deg); + position: absolute; + top: 33%; + left: 25%; + display: table; + width: ($checkbox-width / 2); + height: ($checkbox-width / 4) - 1; + border: $checkbox-check-width solid $checkbox-check-color; + border-top: 0; + border-right: 0; + content: ' '; + } +} + +.item-radio input:checked + .radio-content .radio-icon:before { + background: $checkbox-on-bg-positive; + border-color: $checkbox-off-border-positive; +} + + input[type="radio"].mm-radio { position: relative; width: $checkbox-width;