diff --git a/index.html b/index.html index 2718b63..1256087 100644 --- a/index.html +++ b/index.html @@ -23,7 +23,7 @@ DICOMIOPSY QCM - Score : {{ score }} + Score : {{ good }} ✔ | {{ bad }} ✘ {{ data[question].name }} {{ data[answer.id].description }} diff --git a/main.js b/main.js index 01fead9..03b67db 100644 --- a/main.js +++ b/main.js @@ -21,7 +21,8 @@ let app = { data() { return { data: [{ name: 'loading', description: 'loading' }], - score: 0, + good: 0, + bad: 0, question: 0, answers: [ { id: 0, clicked: false }, @@ -47,9 +48,9 @@ let app = { if (!this.show_results) { this.answers[i].clicked = true; if (this.answers[i].id == this.question) { - this.score += 1; + this.good += 1; } else { - this.score = 0; + this.bad += 1; } } else { this.newQuestion(); diff --git a/style.css b/style.css index 3c9d916..6cb9ed1 100644 --- a/style.css +++ b/style.css @@ -207,6 +207,10 @@ ol { background-color: #558B2F; } +.good { + color: #558B2F; +} + .answer.wrong { background-color: #F44336; color: #eeeeee; @@ -217,6 +221,10 @@ ol { background-color: #c62828; } +.bad { + color: #C62828; +} + @media (hover: hover) { .answer.wrong:hover { background-color: #E53935;