style: fix linting issues met Prettier

This commit is contained in:
Lint Action 2025-05-19 21:44:54 +00:00
parent f85abea6f3
commit 84b2cb1749
3 changed files with 40 additions and 19 deletions

View file

@ -18,7 +18,12 @@ export class QuestionController extends BaseController {
this.loId = loId;
}
async getAllGroup(classId: string, assignmentId: string, forStudent: string, full = true): Promise<QuestionsResponse> {
async getAllGroup(
classId: string,
assignmentId: string,
forStudent: string,
full = true,
): Promise<QuestionsResponse> {
return this.get<QuestionsResponse>("/", { lang: this.loId.language, full, classId, assignmentId, forStudent });
}

View file

@ -51,8 +51,22 @@ export function useQuestionsGroupQuery(
full: MaybeRefOrGetter<boolean> = true,
): UseQueryReturnType<QuestionsResponse, Error> {
return useQuery({
queryKey: computed(() => questionsGroupQueryKey(toValue(loId), toValue(full), toValue(classId), toValue(assignmentId), toValue(student))),
queryFn: async () => new QuestionController(toValue(loId)).getAllGroup( toValue(classId), toValue(assignmentId), toValue(student),toValue(full)),
queryKey: computed(() =>
questionsGroupQueryKey(
toValue(loId),
toValue(full),
toValue(classId),
toValue(assignmentId),
toValue(student),
),
),
queryFn: async () =>
new QuestionController(toValue(loId)).getAllGroup(
toValue(classId),
toValue(assignmentId),
toValue(student),
toValue(full),
),
enabled: () => Boolean(toValue(loId)),
});
}

View file

@ -76,30 +76,32 @@
return currentIndex < nodesList.value?.length ? nodesList.value?.[currentIndex - 1] : undefined;
});
let getQuestionsQuery;
if (authService.authState.activeRole === AccountType.Student) {
getQuestionsQuery = useQuestionsGroupQuery(
computed(() => ({
computed(
() =>
({
language: currentNode.value?.language,
hruid: currentNode.value?.learningobjectHruid,
version: currentNode.value?.version,
}) as LearningObjectIdentifierDTO),
}) as LearningObjectIdentifierDTO,
),
computed(() => query.value.classId ?? ""),
computed(() => query.value.assignmentNo ?? ""),
computed(() => authService.authState.user?.profile.preferred_username ?? "")
computed(() => authService.authState.user?.profile.preferred_username ?? ""),
);
} else {
getQuestionsQuery = useQuestionsQuery(
computed(() => ({
computed(
() =>
({
language: currentNode.value?.language,
hruid: currentNode.value?.learningobjectHruid,
version: currentNode.value?.version,
}) as LearningObjectIdentifierDTO)
}) as LearningObjectIdentifierDTO,
),
);
}