Exercise store, mark exercise 0.2 as solved on ticket buy

This commit is contained in:
2024-10-23 13:57:37 +02:00
parent 3faa89a749
commit 8de3ca481a
5 changed files with 49 additions and 20 deletions

View File

@@ -1,14 +1,11 @@
<script setup lang="ts">
import { updateExercise } from '@/data/api/exerciseApi';
import { useExerciseStore } from '@/stores/exercise.store';
import { ref, watch } from 'vue';
import { useRoute } from 'vue-router';
const route = useRoute()
const routeItems = ref(route.path.split('/'))
function solveExerciseXssInUrl() {
updateExercise(3, 1, true)
}
const exerciseStore = useExerciseStore()
watch(() => route.path, () => {
routeItems.value = route.path.split("/")
@@ -41,9 +38,10 @@ watch(() => route.path, () => {
Filter:
<div v-for="query in route.query" v-html="query" />
<!-- Logic to check, if exercise 3.1 is solved -->
<div v-for="query in route.query">
<span v-if="String(query).startsWith('<iframe')">
{{ solveExerciseXssInUrl() }}
{{ exerciseStore.solveExercise(3, 1) }}
</span>
</div>
</v-col>