Skip to content

Commit

Permalink
Correct fix for inactive students: ignoring academic leave, should no…
Browse files Browse the repository at this point in the history
…t pass and others
  • Loading branch information
disturm committed Jan 23, 2024
1 parent 1975267 commit 0deb8a0
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/managers/MarksManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,6 @@ export default class MarksManager {
student: MergedStudent,
controlActionConfigs: ControlActionConfig[]
) {
if (student.brs.failure === StudentFailure.AcademicLeave ||
student.brs.failure === StudentFailure.DroppedOut) {
const status = MarkUpdateStatus.Skipped;
const studentName = student.actual.fullName.substr(0, 30);
let infoString = `${studentName} имеет статус ${formatStudentFailure(student.brs.failure)}`;
return { status, infoString };
}

const autoControlActionConfig =
this.tryGetAutoControlActionConfig(controlActionConfigs);

Expand Down Expand Up @@ -649,7 +641,7 @@ export default class MarksManager {
}

mergeStudents(actualStudents: ActualStudent[], brsStudents: StudentMark[]) {
const activeBrsStudents = brsStudents.filter(isStudentActive);
const activeBrsStudents = brsStudents.filter(isStudentActiveAndShouldPass);

const mergedStudents: MergedStudent[] = [];
const skippedActualStudents: ActualStudent[] = [];
Expand Down Expand Up @@ -699,10 +691,13 @@ export default class MarksManager {
}
}

function isStudentActive(brsStudent: StudentMark) {
function isStudentActiveAndShouldPass(brsStudent: StudentMark) {
return (
brsStudent.studentStatus !== "Переведен" &&
brsStudent.studentStatus !== "Отчислен"
brsStudent.studentStatus !== "Отчислен" &&
brsStudent.studentStatus !== "Переведен" &&
brsStudent.studentStatus !== "Отп.акад." &&
brsStudent.failure !== StudentFailure.ShouldNotPass
);
}

Expand Down

0 comments on commit 0deb8a0

Please sign in to comment.