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
+4 -3
View File
@@ -278,7 +278,7 @@ class GradingController extends Controller
$semEsc = $this->db->escape($semester);
$yrEsc = $this->db->escape($schoolYear);
$rows = $this->buildGradingRows($semEsc, $yrEsc, $schoolYear);
$rows = $this->buildGradingRows($semEsc, $yrEsc, $schoolYear, $semester);
// Preload quiz/homework/project/participation/midterm score counts to distinguish true zeros from empty scores
$quizCounts = [];
@@ -424,7 +424,7 @@ class GradingController extends Controller
}
}
// Reload rows after refresh
$rows = $this->buildGradingRows($semEsc, $yrEsc, $schoolYear);
$rows = $this->buildGradingRows($semEsc, $yrEsc, $schoolYear, $semester);
}
// Build structures keyed by BUSINESS section id
@@ -1577,7 +1577,7 @@ class GradingController extends Controller
* @param string $schoolYear Raw school year value for filtering student_class
* @return array
*/
private function buildGradingRows(string $semEsc, string $yrEsc, string $schoolYear): array
private function buildGradingRows(string $semEsc, string $yrEsc, string $schoolYear, string $semesterRaw): array
{
$builder = $this->db->table('student_class sc')
->select([
@@ -1605,6 +1605,7 @@ class GradingController extends Controller
'ss_b.class_section_id AS matched_biz_csid',
'ss_p.class_section_id AS matched_pk_csid'
])
->distinct()
->join('`classSection` cs', 'cs.class_section_id = sc.class_section_id', 'left')
->join('students s', 's.id = sc.student_id', 'inner')
->join(