From 1a8ccde9f364b5b7deeba165dc81a24b86b2f7e7 Mon Sep 17 00:00:00 2001 From: arttu Date: Thu, 7 Mar 2024 19:07:57 +0200 Subject: [PATCH] [Open uni] Fix code that checks if student has degreestudyright --- services/backend/src/services/openUni/openUniSearches.js | 3 +++ services/backend/src/services/openUni/openUniStats.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/services/backend/src/services/openUni/openUniSearches.js b/services/backend/src/services/openUni/openUniSearches.js index 1c6ea09f15..3c165c9235 100644 --- a/services/backend/src/services/openUni/openUniSearches.js +++ b/services/backend/src/services/openUni/openUniSearches.js @@ -80,6 +80,9 @@ const getStudyRights = async students => student_studentnumber: { [Op.in]: students.length > 0 ? students : { [Op.not]: null }, }, + extentcode: { + [Op.in]: [1, 2, 3, 4], + }, }, }) ).map(mapStudyRights) diff --git a/services/backend/src/services/openUni/openUniStats.js b/services/backend/src/services/openUni/openUniStats.js index 049cad62da..0cca4409b7 100644 --- a/services/backend/src/services/openUni/openUniStats.js +++ b/services/backend/src/services/openUni/openUniStats.js @@ -3,7 +3,7 @@ const { getCredits, getStudyRights, getEnrollments, getStudentInfo, getCourseNam const uniq = objects => [...new Set(objects)] -const calulateTotalsForStudent = async (studentStats, studentnumber) => { +const calculateTotalsForStudent = async (studentStats, studentnumber) => { Object.keys(studentStats[studentnumber].courseInfo).forEach(course => { if (studentStats[studentnumber].courseInfo[course].status.passed) { studentStats[studentnumber].totals.passed += 1 @@ -100,7 +100,7 @@ const getCustomOpenUniCourses = async (courseCodes, startdate, enddate) => { } } } - await calulateTotalsForStudent(studentStats, studentnumber) + await calculateTotalsForStudent(studentStats, studentnumber) } } const openUniStats = { students: studentStats, courses: courses }