diff --git a/frontend/src/views/learning-paths/LearningPathPage.vue b/frontend/src/views/learning-paths/LearningPathPage.vue index cd81bb41..9e960ff6 100644 --- a/frontend/src/views/learning-paths/LearningPathPage.vue +++ b/frontend/src/views/learning-paths/LearningPathPage.vue @@ -181,6 +181,17 @@ "/" + currentNode.value?.learningobjectHruid, ); + + /** + * Filter the given list of questions such that only the questions for the assignment and group specified + * in the query parameters are shown. This is relevant for teachers since they can view questions of all groups. + */ + function filterQuestions(questions?: QuestionDTO[]): QuestionDTO[] { + return questions?.filter(q => + q.inGroup.groupNumber === forGroup.value?.forGroup + && q.inGroup.assignment === forGroup.value?.assignmentNo + ) ?? [] + }