vbv/client/src/views/LearningUnitSelfEvaluationV...

51 lines
1.2 KiB
Vue

<script setup lang="ts">
import * as log from "loglevel";
import SelfEvaluation from "@/components/learningPath/SelfEvaluation.vue";
import { useAppStore } from "@/stores/app";
import { useCircleStore } from "@/stores/circle";
import type { LearningUnit } from "@/types";
import { onMounted, reactive } from "vue";
log.debug("LearningUnitSelfEvaluationView created");
const props = defineProps<{
learningPathSlug: string;
circleSlug: string;
learningUnitSlug: string;
}>();
const appStore = useAppStore();
appStore.showMainNavigationBar = false;
const circleStore = useCircleStore();
const state: { learningUnit?: LearningUnit } = reactive({});
onMounted(async () => {
log.debug(
"LearningUnitSelfEvaluationView mounted",
props.learningPathSlug,
props.circleSlug,
props.learningUnitSlug
);
try {
state.learningUnit = await circleStore.loadSelfEvaluation(
props.learningPathSlug,
props.circleSlug,
props.learningUnitSlug
);
} catch (error) {
log.error(error);
}
});
</script>
<template>
<SelfEvaluation v-if="state.learningUnit" :learning-unit="state.learningUnit" />
</template>
<style lang="postcss" scoped></style>