fix: Test- en linting-errors opgelost
This commit is contained in:
parent
ce5c0ea629
commit
ba912c3ef0
20 changed files with 103 additions and 116 deletions
|
@ -61,28 +61,36 @@ export class SubmissionRepository extends DwengoEntityRepository<Submission> {
|
|||
|
||||
/**
|
||||
* Looks up all submissions for the given learning object which were submitted as part of the given assignment.
|
||||
* When forGroup is set, only the submissions of the given group are shown.
|
||||
*/
|
||||
public async findAllSubmissionsForLearningObjectAndAssignment(
|
||||
loId: LearningObjectIdentifier,
|
||||
assignment: Assignment,
|
||||
forGroup?: number
|
||||
): Promise<Submission[]> {
|
||||
const onBehalfOf = forGroup
|
||||
? {
|
||||
assignment,
|
||||
groupNumber: forGroup
|
||||
}
|
||||
: {
|
||||
assignment,
|
||||
};
|
||||
|
||||
return this.findAll({
|
||||
where: {
|
||||
learningObjectHruid: loId.hruid,
|
||||
learningObjectLanguage: loId.language,
|
||||
learningObjectVersion: loId.version,
|
||||
onBehalfOf,
|
||||
onBehalfOf: {
|
||||
assignment
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Looks up all submissions for the given learning object which were submitted by the given group
|
||||
*/
|
||||
public async findAllSubmissionsForLearningObjectAndGroup(
|
||||
loId: LearningObjectIdentifier,
|
||||
group: Group,
|
||||
): Promise<Submission[]> {
|
||||
return this.findAll({
|
||||
where: {
|
||||
learningObjectHruid: loId.hruid,
|
||||
learningObjectLanguage: loId.language,
|
||||
learningObjectVersion: loId.version,
|
||||
onBehalfOf: group
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue