From ae59f5808c9749d46fce7e63415eecea833554d1 Mon Sep 17 00:00:00 2001 From: Mykhailo Date: Thu, 27 Jun 2024 22:49:09 +0200 Subject: [PATCH] Fix scheinstatus not passed for students with a schein from previous semesters #1050 --- .../src/module/scheincriteria/scheincriteria.service.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/src/module/scheincriteria/scheincriteria.service.ts b/server/src/module/scheincriteria/scheincriteria.service.ts index 422f15b16..acb62a1fa 100644 --- a/server/src/module/scheincriteria/scheincriteria.service.ts +++ b/server/src/module/scheincriteria/scheincriteria.service.ts @@ -1,4 +1,5 @@ import { EntityRepository } from '@mikro-orm/core'; +import { InjectRepository } from '@mikro-orm/nestjs'; import { Injectable, NotFoundException } from '@nestjs/common'; import { FormDataResponse } from 'shared/model/FormTypes'; import { @@ -8,6 +9,7 @@ import { ScheincriteriaSummaryByStudents, SingleScheincriteriaSummaryByStudents, } from 'shared/model/ScheinCriteria'; +import { StudentStatus } from 'shared/model/Student'; import { ScheincriteriaEntity } from '../../database/entities/scheincriteria.entity'; import { Scheinexam } from '../../database/entities/scheinexam.entity'; import { Sheet } from '../../database/entities/sheet.entity'; @@ -17,13 +19,12 @@ import { CRUDService } from '../../helpers/CRUDService'; import { ScheinexamService } from '../scheinexam/scheinexam.service'; import { SheetService } from '../sheet/sheet.service'; import { ShortTestService } from '../short-test/short-test.service'; +import { GradingService, StudentAndGradings } from '../student/grading.service'; import { StudentService } from '../student/student.service'; import { TutorialService } from '../tutorial/tutorial.service'; import { Scheincriteria } from './container/Scheincriteria'; import { ScheincriteriaContainer } from './container/scheincriteria.container'; import { ScheinCriteriaDTO } from './scheincriteria.dto'; -import { GradingService, StudentAndGradings } from '../student/grading.service'; -import { InjectRepository } from '@mikro-orm/nestjs'; interface CalculationParams { criterias: ScheincriteriaEntity[]; @@ -260,7 +261,8 @@ export class ScheincriteriaService return { student: params.studentInfo.student.toDTO(), - passed, + passed: + passed || params.studentInfo.student.status === StudentStatus.NO_SCHEIN_REQUIRED, scheinCriteriaSummary: summaries, }; }