feat: group's questions route controller en service geimplementeerd

This commit is contained in:
Adriaan Jacquet 2025-04-22 17:09:01 +02:00
parent 9a7a193af7
commit 074c5e510a
3 changed files with 43 additions and 2 deletions

View file

@ -77,6 +77,13 @@ export class QuestionRepository extends DwengoEntityRepository<Question> {
});
}
public async findAllByGroup(inGroup: Group): Promise<Question[]> {
return this.findAll({
where: { inGroup },
orderBy: { timestamp: 'DESC' },
})
}
/**
* Looks up all questions for the given learning object which were asked as part of the given assignment.
* When forStudentUsername is set, only the questions within the given user's group are shown.