feat(KUI-1876): use ladok instead of kopps for memo statistics form#437
feat(KUI-1876): use ladok instead of kopps for memo statistics form#437amirhossein-haerian wants to merge 5 commits into
Conversation
allazis
left a comment
There was a problem hiding this comment.
Looks really good! Well done ⭐ Gone through and tested locally.
Would be nice to let Susanne or someone from the verksamhet to test this thoroughly, as we don't have the requirements clear. I see that the number of hits differ between the old and new implementation, which maybe is OK. But it shouldn't be up to us to decide 🙏
Thanks for the comment, I completely agree with you. Maybe we can wait until they come back from vacation for more clarification before we merge the changes. we can discuss this in our stand-up as well 🙌 |
|
We will come back to this PR after the changes regarding the fallback approach for creation of kthPeriods are done. |
This PR updates the memo statistics logic. Previously, course offerings for each semester were retrieved from KOPPS and then filtered using fields like first_yearsemester, first_period, and offered_semesters. These offerings were matched to memos using the course_round_application_code, and statistics were generated based on memo presence, publication timing, and course data. In the new implementation, offerings are retrieved from Ladok instead, using startperiod as the basis for selecting relevant data. While startperiod may not always reflect the exact teaching start date, it is assumed to be the most reliable and consistent way to retrieve all offerings for a given semester. Using förstaUndervisningsdatum and attempting to map it to a Ladok period is not feasible, particularly for summer courses that don't fit cleanly into VT or HT formats (I would be grateful to know your opinion about it, please let me know if you think startPeriod is not a good property to get all offerings for a semester 🙏). Memo matching now uses tillfälleskod. The result is a set of course offerings for the selected semesters and periods, matched with their respective memos, which is then aggregated into statistics per school; such as total number of offerings, how many had memos, and how many memos were published before course start or deadline.