-
-
-
+
+
+
-
+
+
diff --git a/src/app/app.scss b/src/app/app.scss
index 23f901078..c3e07cbfd 100644
--- a/src/app/app.scss
+++ b/src/app/app.scss
@@ -356,6 +356,84 @@ ion-select {
}
}
+// Question.
+// -------------------------
+
+.core-question-answer-correct,
+.core-question-comment {
+ color: $core-question-correct-color;
+ background-color: $core-question-correct-color-bg;
+
+ .label, ion-label.label {
+ color: $core-question-correct-color;
+ }
+}
+
+.core-question-answer-incorrect,
+.core-question-incorrect {
+ color: $core-question-incorrect-color;
+ background-color: $core-question-incorrect-color-bg;
+
+ .label, ion-label.label {
+ color: $core-question-incorrect-color;
+ }
+}
+
+.core-question-feedback-container {
+ background-color: $core-question-feedback-color-bg;
+ color: $core-question-feedback-color;
+
+ .specificfeedback, .rightanswer, .im-feedback, .feedback, .generalfeedback {
+ margin: 0 0 .5em;
+ }
+
+ .correctness {
+ display: inline-block;
+ padding: 2px 4px;
+ font-weight: bold;
+ line-height: 14px;
+ color: $white;
+ text-shadow: 0 -1px 0 rgba(0,0,0,0.25);
+ background-color: $gray-dark;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+
+ &.incorrect {
+ background-color: $red;
+ }
+ &.correct {
+ background-color: $green;
+ }
+ }
+}
+
+.core-question-feedback-inline {
+ display: inline-block;
+}
+
+.core-question-feedback-padding {
+ padding: 8px 35px 8px 14px;
+}
+
+.core-question-correct {
+ background-color: $core-question-state-correct-color;
+}
+.core-question-partiallycorrect {
+ background-color: $core-question-state-partial-color;
+}
+.core-question-notanswered,
+.core-question-incorrect {
+ background-color: $core-question-state-incorrect-color;
+}
+
+.core-question-warning {
+ color: $core-question-warning-color;
+}
+
+.questioncorrectnessicon {
+ font-size: 20px;
+}
+
// Atto styles
// -------------------------
.atto_image_preview {
diff --git a/src/core/question/providers/helper.ts b/src/core/question/providers/helper.ts
index 4d3ca91e4..fac0992b8 100644
--- a/src/core/question/providers/helper.ts
+++ b/src/core/question/providers/helper.ts
@@ -396,6 +396,18 @@ export class CoreQuestionHelperProvider {
}
}
+ /**
+ * Get the CSS class for a question based on its state.
+ *
+ * @param {string} name Question's state name.
+ * @return {string} State class.
+ */
+ getQuestionStateClass(name: string): string {
+ const state = this.questionProvider.getState(name);
+
+ return state ? state.class : '';
+ }
+
/**
* Get the validation error message from a question HTML if it's there.
*
diff --git a/src/theme/variables.scss b/src/theme/variables.scss
index d80964743..59f3f2ff1 100644
--- a/src/theme/variables.scss
+++ b/src/theme/variables.scss
@@ -213,6 +213,19 @@ $core-timer-warn-color: $red !default;
$core-timer-color: $white !default;
$core-timer-iterations: 15 !default;
+// Question variables.
+$core-question-correct-color: $green-dark !default;
+$core-question-correct-color-bg: $green-light !default;
+$core-question-incorrect-color: $red !default;
+$core-question-incorrect-color-bg: $red-light !default;
+$core-question-feedback-color: $yellow-dark !default;
+$core-question-feedback-color-bg: $yellow-light !default;
+$core-question-warning-color: $red !default;
+
+$core-question-state-correct-color: $green-light !default;
+$core-question-state-partial-color: $yellow-light !default;
+$core-question-state-incorrect-color: $red-light !default;
+
// Mixins
// -------------------------
@mixin core-transition($where: all, $time: 500ms) {