improvements

This commit is contained in:
2026-02-19 14:32:42 +01:00
parent 78c51d55b5
commit f1824ff752
16 changed files with 1244 additions and 31 deletions

View File

@@ -4,7 +4,6 @@ import { Head, useForm, router } from '@inertiajs/vue3'
import AppLayout from '@/Layouts/AppLayout.vue'
import AppButton from '@/Components/AppButton.vue'
import QuestionCard from '@/Components/QuestionCard.vue'
import ScoreIndicator from '@/Components/ScoreIndicator.vue'
defineOptions({ layout: AppLayout })
@@ -21,10 +20,6 @@ const props = defineProps({
type: Object,
default: () => ({}),
},
score: {
type: Number,
default: 0,
},
})
// Answer management
@@ -61,7 +56,7 @@ const saveAnswer = (questionId) => {
}, {
preserveScroll: true,
preserveState: true,
only: ['answers', 'score'],
only: ['answers'],
})
}, 500)
}
@@ -168,10 +163,6 @@ const completeSession = async () => {
})
}
// Check if any scored answers have been given
const hasScoredAnswers = computed(() => {
return props.score > 0
})
</script>
<template>
@@ -180,10 +171,7 @@ const hasScoredAnswers = computed(() => {
<div class="max-w-3xl mx-auto px-4 py-10">
<!-- Title area -->
<div class="mb-10">
<div class="flex items-center justify-between">
<h1 class="text-2xl font-bold text-white">{{ session.category.name }} Questionnaire</h1>
<ScoreIndicator :score="score" :visible="hasScoredAnswers" />
</div>
<h1 class="text-2xl font-bold text-white">{{ session.category.name }} Questionnaire</h1>
<div class="h-px bg-gradient-to-r from-primary/40 via-primary/10 to-transparent mt-4"></div>
</div>