fix duplicate restored student

This commit is contained in:
root
2026-03-30 23:50:20 -04:00
parent b52475ff0b
commit d2abbc1458
8 changed files with 35 additions and 17 deletions
+2 -4
View File
@@ -482,6 +482,7 @@ class HomeworkController extends Controller
// Step 1: Get student IDs from student_class table
$studentClassRows = $this->studentClassModel
->select('student_id')
->distinct()
->where('class_section_id', $classSectionId)
->where('school_year', $schoolYear)
->findAll();
@@ -534,10 +535,7 @@ class HomeworkController extends Controller
private function getStudentsWithHomeworkScores($classSectionId, $homeworkHeaders, $semester, $schoolYear)
{
$semVariants = $this->getSemesterVariants($semester);
$studentClasses = $this->studentClassModel
->active()
->where('student_class.class_section_id', $classSectionId)
->findAll();
$studentClasses = $this->studentClassModel->getClassStudents($classSectionId, $schoolYear, null);
$students = [];
foreach ($studentClasses as $sc) {