fix(frontend): Teacher only leerobjecten niet meer getoond aan studenten
This commit is contained in:
		
							parent
							
								
									da0137e0a7
								
							
						
					
					
						commit
						d1e9303d3a
					
				
					 1 changed files with 9 additions and 2 deletions
				
			
		|  | @ -56,7 +56,9 @@ | ||||||
|     const learningObjectListQueryResult = useLearningObjectListForPathQuery(learningPathQueryResult.data); |     const learningObjectListQueryResult = useLearningObjectListForPathQuery(learningPathQueryResult.data); | ||||||
| 
 | 
 | ||||||
|     const nodesList: ComputedRef<LearningPathNode[] | null> = computed( |     const nodesList: ComputedRef<LearningPathNode[] | null> = computed( | ||||||
|         () => learningPathQueryResult.data.value?.nodesAsList ?? null, |         () => learningPathQueryResult.data.value?.nodesAsList.filter(node => | ||||||
|  |             authService.authState.activeRole === AccountType.Teacher || !getLearningObjectForNode(node)?.teacherExclusive | ||||||
|  |         ) ?? null, | ||||||
|     ); |     ); | ||||||
| 
 | 
 | ||||||
|     const currentNode = computed(() => { |     const currentNode = computed(() => { | ||||||
|  | @ -107,6 +109,12 @@ | ||||||
| 
 | 
 | ||||||
|     const navigationDrawerShown = ref(true); |     const navigationDrawerShown = ref(true); | ||||||
| 
 | 
 | ||||||
|  |     function getLearningObjectForNode(node: LearningPathNode): LearningObject | undefined { | ||||||
|  |         return learningObjectListQueryResult.data.value?.find(obj => | ||||||
|  |             obj.key === node.learningobjectHruid && obj.language === node.language && obj.version === node.version | ||||||
|  |         ); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     function isLearningObjectCompleted(learningObject: LearningObject): boolean { |     function isLearningObjectCompleted(learningObject: LearningObject): boolean { | ||||||
|         if (learningObjectListQueryResult.isSuccess) { |         if (learningObjectListQueryResult.isSuccess) { | ||||||
|             return ( |             return ( | ||||||
|  | @ -353,7 +361,6 @@ | ||||||
|                     class: forGroup.classId, |                     class: forGroup.classId, | ||||||
|                     groupNumber: forGroup.forGroup, |                     groupNumber: forGroup.forGroup, | ||||||
|                 }" |                 }" | ||||||
|                 @updated="refetchQuestions" |  | ||||||
|             /> |             /> | ||||||
|             <QandA :questions="(questionsResponse.data.questions as QuestionDTO[]) ?? []" /> |             <QandA :questions="(questionsResponse.data.questions as QuestionDTO[]) ?? []" /> | ||||||
|         </using-query-result> |         </using-query-result> | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Gerald Schmittinger
						Gerald Schmittinger