style: fix linting issues met Prettier
This commit is contained in:
parent
ba725f67b2
commit
8a55c0f003
22 changed files with 137 additions and 157 deletions
|
@ -15,11 +15,11 @@ export class AssignmentRepository extends DwengoEntityRepository<Assignment> {
|
|||
within: {
|
||||
teachers: {
|
||||
$some: {
|
||||
username: teacherUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
username: teacherUsername,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
public async findAllAssignmentsInClass(within: Class): Promise<Assignment[]> {
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Group } from '../../entities/assignments/group.entity.js';
|
|||
import { Submission } from '../../entities/assignments/submission.entity.js';
|
||||
import { LearningObjectIdentifier } from '../../entities/content/learning-object-identifier.js';
|
||||
import { Student } from '../../entities/users/student.entity.js';
|
||||
import {Assignment} from "../../entities/assignments/assignment.entity";
|
||||
import { Assignment } from '../../entities/assignments/assignment.entity';
|
||||
|
||||
export class SubmissionRepository extends DwengoEntityRepository<Submission> {
|
||||
public async findSubmissionByLearningObjectAndSubmissionNumber(
|
||||
|
@ -46,7 +46,7 @@ export class SubmissionRepository extends DwengoEntityRepository<Submission> {
|
|||
return this.find(
|
||||
{ onBehalfOf: group },
|
||||
{
|
||||
populate: ["onBehalfOf.members"]
|
||||
populate: ['onBehalfOf.members'],
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -60,24 +60,26 @@ export class SubmissionRepository extends DwengoEntityRepository<Submission> {
|
|||
assignment: Assignment,
|
||||
forStudentUsername?: string
|
||||
): Promise<Submission[]> {
|
||||
const onBehalfOf = forStudentUsername ? {
|
||||
assignment,
|
||||
members: {
|
||||
$some: {
|
||||
username: forStudentUsername
|
||||
}
|
||||
}
|
||||
} : {
|
||||
assignment
|
||||
};
|
||||
const onBehalfOf = forStudentUsername
|
||||
? {
|
||||
assignment,
|
||||
members: {
|
||||
$some: {
|
||||
username: forStudentUsername,
|
||||
},
|
||||
},
|
||||
}
|
||||
: {
|
||||
assignment,
|
||||
};
|
||||
|
||||
return this.findAll({
|
||||
where: {
|
||||
learningObjectHruid: loId.hruid,
|
||||
learningObjectLanguage: loId.language,
|
||||
learningObjectVersion: loId.version,
|
||||
onBehalfOf
|
||||
}
|
||||
onBehalfOf,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -85,9 +87,7 @@ export class SubmissionRepository extends DwengoEntityRepository<Submission> {
|
|||
const result = await this.find(
|
||||
{ submitter: student },
|
||||
{
|
||||
populate: [
|
||||
"onBehalfOf.members"
|
||||
]
|
||||
populate: ['onBehalfOf.members'],
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -3,11 +3,11 @@ import { Question } from '../../entities/questions/question.entity.js';
|
|||
import { LearningObjectIdentifier } from '../../entities/content/learning-object-identifier.js';
|
||||
import { Student } from '../../entities/users/student.entity.js';
|
||||
import { LearningObject } from '../../entities/content/learning-object.entity.js';
|
||||
import {Group} from "../../entities/assignments/group.entity";
|
||||
import {Assignment} from "../../entities/assignments/assignment.entity";
|
||||
import { Group } from '../../entities/assignments/group.entity';
|
||||
import { Assignment } from '../../entities/assignments/assignment.entity';
|
||||
|
||||
export class QuestionRepository extends DwengoEntityRepository<Question> {
|
||||
public async createQuestion(question: { loId: LearningObjectIdentifier; author: Student; inGroup: Group, content: string }): Promise<Question> {
|
||||
public async createQuestion(question: { loId: LearningObjectIdentifier; author: Student; inGroup: Group; content: string }): Promise<Question> {
|
||||
const questionEntity = this.create({
|
||||
learningObjectHruid: question.loId.hruid,
|
||||
learningObjectLanguage: question.loId.language,
|
||||
|
@ -75,24 +75,26 @@ export class QuestionRepository extends DwengoEntityRepository<Question> {
|
|||
assignment: Assignment,
|
||||
forStudentUsername?: string
|
||||
): Promise<Question[]> {
|
||||
const inGroup = forStudentUsername ? {
|
||||
assignment,
|
||||
members: {
|
||||
$some: {
|
||||
username: forStudentUsername
|
||||
}
|
||||
}
|
||||
} : {
|
||||
assignment
|
||||
};
|
||||
const inGroup = forStudentUsername
|
||||
? {
|
||||
assignment,
|
||||
members: {
|
||||
$some: {
|
||||
username: forStudentUsername,
|
||||
},
|
||||
},
|
||||
}
|
||||
: {
|
||||
assignment,
|
||||
};
|
||||
|
||||
return this.findAll({
|
||||
where: {
|
||||
learningObjectHruid: loId.hruid,
|
||||
learningObjectLanguage: loId.language,
|
||||
learningObjectVersion: loId.version,
|
||||
inGroup
|
||||
}
|
||||
inGroup,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue