2024-07-03 13:55:34 +00:00
|
|
|
<script lang="ts" setup>
|
|
|
|
|
|
|
|
import {type Quiz, useQuizStore} from "~/store/quiz";
|
|
|
|
|
|
|
|
const scores = ref<number[]>();
|
|
|
|
const loading = ref(true);
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
loading.value = true;
|
|
|
|
useQuizStore().findById(useRoute().query.quiz).then((quiz: Quiz) => {
|
|
|
|
scores.value = quiz.axes.map(value => value.average);
|
|
|
|
})
|
|
|
|
.finally(() => loading.value = false);
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2022-10-07 14:15:53 +00:00
|
|
|
<template>
|
2024-07-03 13:55:34 +00:00
|
|
|
<section>
|
|
|
|
<h1>Bravo !</h1>
|
|
|
|
<p class="text-center">Merci pour votre contribution à la production locale et bravo pour votre implication.</p>
|
|
|
|
<div v-if="!loading" class="chart-area">
|
|
|
|
<polar-area-chart :data="scores"/>
|
|
|
|
<Legend/>
|
|
|
|
</div>
|
|
|
|
<loader v-else class="center"/>
|
|
|
|
<nuxt-link class="button orange" to="/dashboard">Retour à l'accueil</nuxt-link>
|
|
|
|
</section>
|
2022-10-07 14:15:53 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
|
|
@import "assets/css/spacing";
|
|
|
|
|
|
|
|
.chart-area {
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
justify-content: space-around;
|
2024-07-03 13:55:34 +00:00
|
|
|
margin: $small 0;
|
2022-10-07 14:15:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|