feat: melding bij leerobjecten met vragen

This commit is contained in:
laurejablonski 2025-04-24 20:43:12 +02:00
parent 103742db31
commit 3f26353d79
2 changed files with 26 additions and 28 deletions

View file

@ -0,0 +1,24 @@
<script setup lang="ts">
import type { LearningObject } from '@/data-objects/learning-objects/learning-object';
import { useQuestionsQuery } from '@/queries/questions';
import type { LearningObjectIdentifierDTO } from '@dwengo-1/common/interfaces/learning-content';
import { languageMap } from '@dwengo-1/common/util/language';
import { computed, ref } from 'vue';
const props = defineProps<{
node: LearningObject
}>();
const loid = { hruid: props.node.key, version: props.node.version, language: props.node.language} as LearningObjectIdentifierDTO;
const { data, isLoading, error} = useQuestionsQuery(loid);
const hasQuestions = computed(() => {
return (data.value?.questions.length ?? 0) > 0;
});
</script>
<template v-if="!isLoading & !error">
<v-icon v-if="hasQuestions" icon="mdi-help-circle-outline" color="red" size="small" />
<div>{{ node.estimatedTime }}'</div>
</template>
<style scoped></style>