Merge pull request #245 from SELab-2/fix/taal-opdracht

fix: Opdracht wordt gefetched in originele taal
This commit is contained in:
Joyelle Ndagijimana 2025-05-06 09:15:07 +02:00 committed by GitHub
commit cafb9a936f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 13 deletions

View file

@ -22,8 +22,7 @@
) => { groupProgressMap: Map<number, number> }; ) => { groupProgressMap: Map<number, number> };
}>(); }>();
const { t, locale } = useI18n(); const { t } = useI18n();
const language = ref<Language>(locale.value as Language);
const learningPath = ref(); const learningPath = ref();
// Get the user's username/id // Get the user's username/id
const username = asyncComputed(async () => { const username = asyncComputed(async () => {
@ -38,7 +37,7 @@
const lpQueryResult = useGetLearningPathQuery( const lpQueryResult = useGetLearningPathQuery(
computed(() => assignmentQueryResult.data.value?.assignment?.learningPath ?? ""), computed(() => assignmentQueryResult.data.value?.assignment?.learningPath ?? ""),
computed(() => language.value), computed(() => assignmentQueryResult.data.value?.assignment.language as Language),
); );
const groupsQueryResult = useGroupsQuery(props.classId, props.assignmentId, true); const groupsQueryResult = useGroupsQuery(props.classId, props.assignmentId, true);
@ -100,7 +99,7 @@ language
> >
<v-btn <v-btn
v-if="lpData" v-if="lpData"
:to="`/learningPath/${lpData.hruid}/${language}/${lpData.startNode.learningobjectHruid}?forGroup=${group?.groupNumber}&assignmentNo=${assignmentId}&classId=${classId}`" :to="`/learningPath/${lpData.hruid}/${assignmentQueryResult.data.value?.assignment.language}/${lpData.startNode.learningobjectHruid}?forGroup=${group?.groupNumber}&assignmentNo=${assignmentId}&classId=${classId}`"
variant="tonal" variant="tonal"
color="primary" color="primary"
> >

View file

@ -19,8 +19,7 @@
) => { groupProgressMap: Map<number, number> }; ) => { groupProgressMap: Map<number, number> };
}>(); }>();
const { t, locale } = useI18n(); const { t } = useI18n();
const language = computed(() => locale.value);
const groups = ref(); const groups = ref();
const learningPath = ref(); const learningPath = ref();
@ -29,7 +28,7 @@
// Get learning path object // Get learning path object
const lpQueryResult = useGetLearningPathQuery( const lpQueryResult = useGetLearningPathQuery(
computed(() => assignmentQueryResult.data.value?.assignment?.learningPath ?? ""), computed(() => assignmentQueryResult.data.value?.assignment?.learningPath ?? ""),
computed(() => language.value as Language), computed(() => assignmentQueryResult.data.value?.assignment.language as Language),
); );
// Get all the groups withing the assignment // Get all the groups withing the assignment
@ -38,9 +37,9 @@
/* Crashes right now cause api data has inexistent hruid TODO: uncomment later and use it in progress bar /* Crashes right now cause api data has inexistent hruid TODO: uncomment later and use it in progress bar
Const {groupProgressMap} = props.useGroupsWithProgress( Const {groupProgressMap} = props.useGroupsWithProgress(
groups, groups,
learningPath, learningPath,
language language
); );
*/ */
@ -121,7 +120,7 @@ Const {groupProgressMap} = props.useGroupsWithProgress(
> >
<v-btn <v-btn
v-if="lpData" v-if="lpData"
:to="`/learningPath/${lpData.hruid}/${language}/${lpData.startNode.learningobjectHruid}?assignmentNo=${assignmentId}&classId=${classId}`" :to="`/learningPath/${lpData.hruid}/${assignmentQueryResult.data.value?.assignment.language}/${lpData.startNode.learningobjectHruid}?assignmentNo=${assignmentId}&classId=${classId}`"
variant="tonal" variant="tonal"
color="primary" color="primary"
> >
@ -203,8 +202,8 @@ Const {groupProgressMap} = props.useGroupsWithProgress(
<v-btn <v-btn
color="primary" color="primary"
@click="dialog = false" @click="dialog = false"
>Close</v-btn >Close
> </v-btn>
</v-card-actions> </v-card-actions>
</v-card> </v-card>
</v-dialog> </v-dialog>