fix: students assignments pagina bug gefixd
This commit is contained in:
		
							parent
							
								
									3d8c8302d6
								
							
						
					
					
						commit
						912111fce4
					
				
					 3 changed files with 7 additions and 13 deletions
				
			
		|  | @ -1,7 +1,7 @@ | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
|     import { useI18n } from "vue-i18n"; |     import { useI18n } from "vue-i18n"; | ||||||
|     import { computed, onMounted, ref, watch } from "vue"; |     import { computed, onMounted, ref, watch } from "vue"; | ||||||
|     import { assignmentTitleRules, classRules, learningPathRules } from "@/utils/assignment-rules.ts"; |     import { assignmentTitleRules, classRules } from "@/utils/assignment-rules.ts"; | ||||||
|     import auth from "@/services/auth/auth-service.ts"; |     import auth from "@/services/auth/auth-service.ts"; | ||||||
|     import { useTeacherClassesQuery } from "@/queries/teachers.ts"; |     import { useTeacherClassesQuery } from "@/queries/teachers.ts"; | ||||||
|     import { useRouter, useRoute } from "vue-router"; |     import { useRouter, useRoute } from "vue-router"; | ||||||
|  | @ -34,8 +34,7 @@ | ||||||
| 
 | 
 | ||||||
|     const selectedClass = ref(undefined); |     const selectedClass = ref(undefined); | ||||||
|     const assignmentTitle = ref(""); |     const assignmentTitle = ref(""); | ||||||
|     console.log(route.query); |     const selectedLearningPath = ref(route.query.hruid?.toString() || undefined); | ||||||
|     const selectedLearningPath = ref(route.query.hruid || undefined); |  | ||||||
| 
 | 
 | ||||||
|     const lpIsSelected = route.query.hruid !== undefined; |     const lpIsSelected = route.query.hruid !== undefined; | ||||||
| 
 | 
 | ||||||
|  | @ -125,7 +124,7 @@ | ||||||
|                             :rules="lpIsSelected ? [] : learningPathRules" |                             :rules="lpIsSelected ? [] : learningPathRules" | ||||||
|                             variant="solo-filled" |                             variant="solo-filled" | ||||||
|                             clearable |                             clearable | ||||||
|                             :model-value="lpIsSelected ? data.find(lp => lp.hruid === route.query.hruid) : selectedLearningPath" |                             :model-value="lpIsSelected ? data.find(lp => lp.hruid === route.query.hruid?.toString()) : selectedLearningPath" | ||||||
|                             item-title="title" |                             item-title="title" | ||||||
|                             item-value="hruid" |                             item-value="hruid" | ||||||
|                             :disabled="lpIsSelected" |                             :disabled="lpIsSelected" | ||||||
|  |  | ||||||
|  | @ -6,11 +6,11 @@ | ||||||
|     import UsingQueryResult from "@/components/UsingQueryResult.vue"; |     import UsingQueryResult from "@/components/UsingQueryResult.vue"; | ||||||
|     import type { AssignmentResponse } from "@/controllers/assignments.ts"; |     import type { AssignmentResponse } from "@/controllers/assignments.ts"; | ||||||
|     import { asyncComputed } from "@vueuse/core"; |     import { asyncComputed } from "@vueuse/core"; | ||||||
|     import { useStudentsByUsernamesQuery } from "@/queries/students.ts"; |     import {useStudentGroupsQuery, useStudentsByUsernamesQuery} from "@/queries/students.ts"; | ||||||
|     import { useGroupsQuery } from "@/queries/groups.ts"; |  | ||||||
|     import { useGetLearningPathQuery } from "@/queries/learning-paths.ts"; |     import { useGetLearningPathQuery } from "@/queries/learning-paths.ts"; | ||||||
|     import type { Language } from "@/data-objects/language.ts"; |     import type { Language } from "@/data-objects/language.ts"; | ||||||
|     import { calculateProgress } from "@/utils/assignment-utils.ts"; |     import { calculateProgress } from "@/utils/assignment-utils.ts"; | ||||||
|  |     import type {LearningPath} from "@/data-objects/learning-paths/learning-path.ts"; | ||||||
| 
 | 
 | ||||||
|     const props = defineProps<{ |     const props = defineProps<{ | ||||||
|         classId: string; |         classId: string; | ||||||
|  | @ -29,7 +29,7 @@ | ||||||
|     const assignmentQueryResult = useAssignmentQuery(() => props.classId, props.assignmentId); |     const assignmentQueryResult = useAssignmentQuery(() => props.classId, props.assignmentId); | ||||||
|     learningPath.value = assignmentQueryResult.data.value?.assignment?.learningPath; |     learningPath.value = assignmentQueryResult.data.value?.assignment?.learningPath; | ||||||
| 
 | 
 | ||||||
|     const groupsQueryResult = useGroupsQuery(props.classId, props.assignmentId, true); |     const groupsQueryResult = useStudentGroupsQuery(username, true); | ||||||
|     const group = computed(() => { |     const group = computed(() => { | ||||||
|         const groups = groupsQueryResult.data.value?.groups; |         const groups = groupsQueryResult.data.value?.groups; | ||||||
| 
 | 
 | ||||||
|  | @ -68,7 +68,7 @@ | ||||||
|     ); |     ); | ||||||
| 
 | 
 | ||||||
|     const progressColor = computed(() => { |     const progressColor = computed(() => { | ||||||
|         const progress = calculateProgress(lpQueryResult.data.value); |         const progress = calculateProgress(lpQueryResult.data.value as LearningPath); | ||||||
|         if (progress >= 100) return "success"; |         if (progress >= 100) return "success"; | ||||||
|         if (progress >= 50) return "warning"; |         if (progress >= 50) return "warning"; | ||||||
|         return "error"; |         return "error"; | ||||||
|  |  | ||||||
|  | @ -21,11 +21,6 @@ import GroupSelector from "@/components/assignments/GroupSelector.vue"; | ||||||
| const props = defineProps<{ | const props = defineProps<{ | ||||||
|     classId: string; |     classId: string; | ||||||
|     assignmentId: number; |     assignmentId: number; | ||||||
|     useGroupsWithProgress: ( |  | ||||||
|         groups: Ref<GroupDTO[]>, |  | ||||||
|         hruid: Ref<string>, |  | ||||||
|         language: Ref<Language>, |  | ||||||
|     ) => { groupProgressMap: Map<number, number> }; |  | ||||||
| }>(); | }>(); | ||||||
| 
 | 
 | ||||||
| const isEditing = ref(false); | const isEditing = ref(false); | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Joyelle Ndagijimana
						Joyelle Ndagijimana