fix: Logica vragen stellen gecorrigeerd (WIP)
This commit is contained in:
		
							parent
							
								
									1d9141bab7
								
							
						
					
					
						commit
						8edd4f0225
					
				
					 5 changed files with 17 additions and 21 deletions
				
			
		|  | @ -1,6 +1,5 @@ | |||
| <script setup lang="ts"> | ||||
|     import authService from "@/services/auth/auth-service.ts"; | ||||
|     import { Language } from "@/data-objects/language.ts"; | ||||
|     import { computed, type ComputedRef, ref } from "vue"; | ||||
|     import type {  GroupDTOId } from "@dwengo-1/common/interfaces/group"; | ||||
|     import type { QuestionData } from "@dwengo-1/common/interfaces/question"; | ||||
|  | @ -10,9 +9,9 @@ | |||
|     import { AccountType } from "@dwengo-1/common/util/account-types.ts"; | ||||
| 
 | ||||
|     const props = defineProps<{ | ||||
|         hruid: string; | ||||
|         language: Language; | ||||
|         learningObjectHruid?: string; | ||||
|         learningObjectHruid: string; | ||||
|         learningObjectLanguage: string; | ||||
|         learningObjectVersion: number; | ||||
|         forGroup?: GroupDTOId | undefined; | ||||
|         withTitle?: boolean; | ||||
|     }>(); | ||||
|  | @ -25,7 +24,8 @@ | |||
| 
 | ||||
|     const loID: ComputedRef<LearningObjectIdentifierDTO> = computed(() => ({ | ||||
|         hruid: props.learningObjectHruid as string, | ||||
|         language: props.language, | ||||
|         language: props.learningObjectLanguage, | ||||
|         version: props.learningObjectVersion | ||||
|     })); | ||||
|     const createQuestionMutation = useCreateQuestionMutation(loID); | ||||
| 
 | ||||
|  | @ -56,6 +56,7 @@ | |||
| 
 | ||||
| <template> | ||||
|     <h3 v-if="props.withTitle && showQuestionBox">{{ t("askAQuestion") }}:</h3> | ||||
|     {{ props.forGroup }} | ||||
|     <div | ||||
|         class="question-box" | ||||
|         v-if="showQuestionBox" | ||||
|  |  | |||
|  | @ -14,7 +14,7 @@ export class QuestionController extends BaseController { | |||
|     loId: LearningObjectIdentifierDTO; | ||||
| 
 | ||||
|     constructor(loId: LearningObjectIdentifierDTO) { | ||||
|         super(`learningObject/${loId.hruid}/:${loId.version}/questions`); | ||||
|         super(`learningObject/${loId.hruid}/${loId.version}/questions`); | ||||
|         this.loId = loId; | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -339,7 +339,7 @@ | |||
|             </v-btn> | ||||
|         </div> | ||||
|         <using-query-result | ||||
|             v-if="forGroup" | ||||
|             v-if="currentNode && forGroup" | ||||
|             :query-result="getQuestionsQuery" | ||||
|             v-slot="questionsResponse: { data: QuestionsResponse }" | ||||
|         > | ||||
|  | @ -354,10 +354,10 @@ | |||
|                 </span> | ||||
|             </div> | ||||
|             <QuestionBox | ||||
|                 :hruid="props.hruid" | ||||
|                 :language="props.language" | ||||
|                 :learningObjectHruid="props.learningObjectHruid" | ||||
|                 :forGroup="forGroup" | ||||
|                 :learningObjectHruid="currentNode.learningobjectHruid" | ||||
|                 :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[]) ?? []" /> | ||||
|  |  | |||
		Reference in a new issue
	
	 Gerald Schmittinger
						Gerald Schmittinger