good/bad score
This commit is contained in:
+1
-1
@@ -23,7 +23,7 @@
|
|||||||
<main id="app" style="display:none">
|
<main id="app" style="display:none">
|
||||||
<h1>DICOMIOPSY QCM</h1>
|
<h1>DICOMIOPSY QCM</h1>
|
||||||
<div>
|
<div>
|
||||||
<div id='status'>Score : {{ score }}</div>
|
<div id='status'>Score : <span class="good">{{ good }} ✔</span> | <span class="bad">{{ bad }} ✘</span></div>
|
||||||
<h2 id="question">{{ data[question].name }}</div>
|
<h2 id="question">{{ data[question].name }}</div>
|
||||||
<template v-for="(answer, i) in answers">
|
<template v-for="(answer, i) in answers">
|
||||||
<div class="answer" :class="{right: show_results && answer.id === this.question, wrong: show_results && answer.clicked && answer.id !== this.question}" @click="click(i)">{{ data[answer.id].description }}</div>
|
<div class="answer" :class="{right: show_results && answer.id === this.question, wrong: show_results && answer.clicked && answer.id !== this.question}" @click="click(i)">{{ data[answer.id].description }}</div>
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ let app = {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
data: [{ name: 'loading', description: 'loading' }],
|
data: [{ name: 'loading', description: 'loading' }],
|
||||||
score: 0,
|
good: 0,
|
||||||
|
bad: 0,
|
||||||
question: 0,
|
question: 0,
|
||||||
answers: [
|
answers: [
|
||||||
{ id: 0, clicked: false },
|
{ id: 0, clicked: false },
|
||||||
@@ -47,9 +48,9 @@ let app = {
|
|||||||
if (!this.show_results) {
|
if (!this.show_results) {
|
||||||
this.answers[i].clicked = true;
|
this.answers[i].clicked = true;
|
||||||
if (this.answers[i].id == this.question) {
|
if (this.answers[i].id == this.question) {
|
||||||
this.score += 1;
|
this.good += 1;
|
||||||
} else {
|
} else {
|
||||||
this.score = 0;
|
this.bad += 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.newQuestion();
|
this.newQuestion();
|
||||||
|
|||||||
@@ -207,6 +207,10 @@ ol {
|
|||||||
background-color: #558B2F;
|
background-color: #558B2F;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.good {
|
||||||
|
color: #558B2F;
|
||||||
|
}
|
||||||
|
|
||||||
.answer.wrong {
|
.answer.wrong {
|
||||||
background-color: #F44336;
|
background-color: #F44336;
|
||||||
color: #eeeeee;
|
color: #eeeeee;
|
||||||
@@ -217,6 +221,10 @@ ol {
|
|||||||
background-color: #c62828;
|
background-color: #c62828;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bad {
|
||||||
|
color: #C62828;
|
||||||
|
}
|
||||||
|
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
.answer.wrong:hover {
|
.answer.wrong:hover {
|
||||||
background-color: #E53935;
|
background-color: #E53935;
|
||||||
|
|||||||
Reference in New Issue
Block a user