Calculate SubjectAllocationStats from StudentSubjectEnrollment
Form for calculation
We need to choose semester and to have a button for calculation:
foreach $js in joined_subject with $semestar (2023-24-W):
create sas(sabject=$js)
foreach $c in $js.codes.split(";").trim():
count $first_time (num_enrolments==1), $re_enrollment (num_enrollments>1) from student_subject_enrollment where semester = $semester and subject.code = $c
set sas.ft, sas.ree
Table for display
paging table with the sas entitites with filter by semester and subject