Merge branch 'fix/questions-toon-enkel-groep' of https://github.com/SELab-2/Dwengo-1 into fix/questions-toon-enkel-groep
This commit is contained in:
		
						commit
						85221b4cfe
					
				
					 3 changed files with 14 additions and 9 deletions
				
			
		|  | @ -34,15 +34,15 @@ export const onlyAllowIfHasAccessToSubmission = authorize(async (auth: Authentic | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| export const onlyAllowIfHasAccessToSubmissionFromParams = authorize(async (auth: AuthenticationInfo, req: AuthenticatedRequest) => { | export const onlyAllowIfHasAccessToSubmissionFromParams = authorize(async (auth: AuthenticationInfo, req: AuthenticatedRequest) => { | ||||||
|     const { classId, assignmentId, groupId } = req.query; |     const { classId, assignmentId, forGroup } = req.query; | ||||||
| 
 | 
 | ||||||
|     requireFields({ classId, assignmentId, groupId }); |     requireFields({ classId, assignmentId, forGroup }); | ||||||
| 
 | 
 | ||||||
|     if (auth.accountType === AccountType.Teacher) { |     if (auth.accountType === AccountType.Teacher) { | ||||||
|         const cls = await fetchClass(classId as string); |         const cls = await fetchClass(classId as string); | ||||||
|         return cls.teachers.map(mapToUsername).includes(auth.username); |         return cls.teachers.map(mapToUsername).includes(auth.username); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     const group = await fetchGroup(classId as string, Number(assignmentId as string), Number(groupId as string)); |     const group = await fetchGroup(classId as string, Number(assignmentId as string), Number(forGroup as string)); | ||||||
|     return group.members.map(mapToUsername).includes(auth.username); |     return group.members.map(mapToUsername).includes(auth.username); | ||||||
| }); | }); | ||||||
|  |  | ||||||
|  | @ -29,9 +29,7 @@ | ||||||
|     })); |     })); | ||||||
|     const createQuestionMutation = useCreateQuestionMutation(loID); |     const createQuestionMutation = useCreateQuestionMutation(loID); | ||||||
| 
 | 
 | ||||||
|     const showQuestionBox = computed( |     const showQuestionBox = computed(() => authService.authState.activeRole === AccountType.Student && props.forGroup); | ||||||
|         () => authService.authState.activeRole === AccountType.Student && props.forGroup, |  | ||||||
|     ); |  | ||||||
| 
 | 
 | ||||||
|     function submitQuestion(): void { |     function submitQuestion(): void { | ||||||
|         if (props.forGroup && questionInput.value !== "") { |         if (props.forGroup && questionInput.value !== "") { | ||||||
|  |  | ||||||
|  | @ -23,7 +23,14 @@ export class SubmissionController extends BaseController { | ||||||
|         groupId?: number, |         groupId?: number, | ||||||
|         full = true, |         full = true, | ||||||
|     ): Promise<SubmissionsResponse> { |     ): Promise<SubmissionsResponse> { | ||||||
|         return this.get<SubmissionsResponse>(`/`, { language, version, classId, assignmentId, groupId, full }); |         return this.get<SubmissionsResponse>(`/`, { | ||||||
|  |             language, | ||||||
|  |             version, | ||||||
|  |             classId, | ||||||
|  |             assignmentId, | ||||||
|  |             forGroup: groupId, | ||||||
|  |             full, | ||||||
|  |         }); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     async getByNumber( |     async getByNumber( | ||||||
|  | @ -39,7 +46,7 @@ export class SubmissionController extends BaseController { | ||||||
|             version, |             version, | ||||||
|             classId, |             classId, | ||||||
|             assignmentId, |             assignmentId, | ||||||
|             groupId, |             forGroup: groupId, | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Gerald Schmittinger
						Gerald Schmittinger