This commit is contained in:
Adriaan J. 2025-04-24 10:29:30 +02:00 committed by GitHub
commit 6edb5f144d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
46 changed files with 10216 additions and 1054 deletions

View file

@ -62,9 +62,7 @@ export class QuestionRepository extends DwengoEntityRepository<Question> {
public async findAllByAssignment(assignment: Assignment): Promise<Question[]> {
return this.find({
inGroup: {
$contained: assignment.groups,
},
inGroup: assignment.groups.getItems(),
learningObjectHruid: assignment.learningPathHruid,
learningObjectLanguage: assignment.learningPathLanguage,
});
@ -77,6 +75,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.