fix: Vragen stellen

This commit is contained in:
Gerald Schmittinger 2025-05-20 13:44:45 +02:00
parent 85221b4cfe
commit 762131ed34
4 changed files with 6 additions and 11 deletions

View file

@ -18,8 +18,8 @@ export class QuestionRepository extends DwengoEntityRepository<Question> {
content: question.content,
timestamp: new Date(),
});
console.log(questionEntity)
await this.save(questionEntity, { preventOverwrite: true });
// Don't check for overwrite since this is impossible anyway due to autoincrement.
await this.save(questionEntity, { preventOverwrite: false });
return questionEntity;
}
public async findAllQuestionsAboutLearningObject(loId: LearningObjectIdentifier): Promise<Question[]> {

View file

@ -54,7 +54,6 @@
<template>
<h3 v-if="props.withTitle && showQuestionBox">{{ t("askAQuestion") }}:</h3>
{{ props.forGroup }}
<div
class="question-box"
v-if="showQuestionBox"

View file

@ -9,6 +9,7 @@ import {
useQueryClient,
type UseQueryReturnType,
} from "@tanstack/vue-query";
import type { Language } from "@dwengo-1/common/util/language";
export function questionsQueryKey(
loId: LearningObjectIdentifierDTO,
@ -23,7 +24,7 @@ export function questionsGroupQueryKey(
assignmentId: string,
student: string,
full: boolean,
): [string, string, number, string, boolean] {
): [string, string, number, Language, boolean, string, string, string] {
return ["questions", loId.hruid, loId.version!, loId.language, full, classId, assignmentId, student];
}
@ -54,10 +55,10 @@ export function useQuestionsGroupQuery(
queryKey: computed(() =>
questionsGroupQueryKey(
toValue(loId),
toValue(full),
toValue(classId),
toValue(assignmentId),
toValue(student),
toValue(full),
),
),
queryFn: async () =>

View file

@ -105,10 +105,6 @@
);
}
function refetchQuestions() {
getQuestionsQuery.refetch();
}
const navigationDrawerShown = ref(true);
function isLearningObjectCompleted(learningObject: LearningObject): boolean {
@ -292,7 +288,7 @@
</v-list-item>
<v-list-item>
<div
v-if="authService.authState.activeRole === AccountType.Student && pathIsAssignment"
v-if="authService.authState.activeRole === AccountType.Student && forGroup"
class="assignment-indicator"
>
{{ t("assignmentIndicator") }}
@ -358,7 +354,6 @@
:learningObjectLanguage="currentNode.language"
:learningObjectVersion="currentNode.version"
:forGroup="{assignment: forGroup.assignmentNo, class: forGroup.classId, groupNumber: forGroup.forGroup}"
@updated="refetchQuestions"
/>
<QandA :questions="(questionsResponse.data.questions as QuestionDTO[]) ?? []" />
</using-query-result>