diff --git a/backend/src/services/assignments.ts b/backend/src/services/assignments.ts index f0389dd8..71250b62 100644 --- a/backend/src/services/assignments.ts +++ b/backend/src/services/assignments.ts @@ -14,14 +14,14 @@ import { mapToSubmissionDTO, mapToSubmissionDTOId } from '../interfaces/submissi import { fetchClass } from './classes.js'; import { QuestionDTO, QuestionId } from '@dwengo-1/common/interfaces/question'; import { SubmissionDTO, SubmissionDTOId } from '@dwengo-1/common/interfaces/submission'; -import {EntityDTO, ForeignKeyConstraintViolationException} from '@mikro-orm/core'; +import { EntityDTO, ForeignKeyConstraintViolationException } from '@mikro-orm/core'; import { putObject } from './service-helper.js'; import { fetchStudents } from './students.js'; import { ServerErrorException } from '../exceptions/server-error-exception.js'; import { BadRequestException } from '../exceptions/bad-request-exception.js'; -import {getQuestionsAboutLearningObjectInAssignment} from "./questions"; -import {LearningObjectIdentifier} from "../entities/content/learning-object-identifier"; -import {ConflictException} from "../exceptions/conflict-exception"; +import { getQuestionsAboutLearningObjectInAssignment } from './questions'; +import { LearningObjectIdentifier } from '../entities/content/learning-object-identifier'; +import { ConflictException } from '../exceptions/conflict-exception'; export async function fetchAssignment(classid: string, assignmentNumber: number): Promise { const classRepository = getClassRepository(); @@ -140,10 +140,9 @@ export async function deleteAssignment(classid: string, id: number): Promise { const studentRepository = getStudentRepository(); @@ -105,7 +105,7 @@ export async function getStudentAssignments(username: string, full: boolean): Pr const groupRepository = getGroupRepository(); const groups = await groupRepository.findAllGroupsWithStudent(student); - const assignments = await Promise.all(groups.map( async group => await fetchAssignment(group.assignment.within.classId, group.assignment.id))); + const assignments = await Promise.all(groups.map(async (group) => await fetchAssignment(group.assignment.within.classId, group.assignment.id))); if (full) { return assignments.map(mapToAssignmentDTO); diff --git a/backend/tests/controllers/students.test.ts b/backend/tests/controllers/students.test.ts index de863351..c3d84fd8 100644 --- a/backend/tests/controllers/students.test.ts +++ b/backend/tests/controllers/students.test.ts @@ -13,7 +13,8 @@ import { createStudentRequestHandler, getStudentRequestsHandler, deleteClassJoinRequestHandler, - getStudentRequestHandler, getStudentAssignmentsHandler, + getStudentRequestHandler, + getStudentAssignmentsHandler, } from '../../src/controllers/students.js'; import { getDireStraits, getNoordkaap, getTheDoors, TEST_STUDENTS } from '../test_assets/users/students.testdata.js'; import { NotFoundException } from '../../src/exceptions/not-found-exception.js'; @@ -163,7 +164,6 @@ describe('Student controllers', () => { expect(result.assignments).to.have.length.greaterThan(0); }); - it('Student submissions', async () => { const submission = getSubmission01(); req = { params: { username: submission.submitter.username }, query: { full: 'true' } }; diff --git a/frontend/src/views/assignments/TeacherAssignment.vue b/frontend/src/views/assignments/TeacherAssignment.vue index a4322c5b..631692bc 100644 --- a/frontend/src/views/assignments/TeacherAssignment.vue +++ b/frontend/src/views/assignments/TeacherAssignment.vue @@ -109,7 +109,7 @@ }, onError: (e) => { showSnackbar(t("failed") + ": " + e.response.data.error || e.message, "error"); - } + }, }, ); }