Show progress scores from most recent available year
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 57s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 57s
Progress scores aren't available for 2023-24 and 2024-25 due to KS1 SATs being cancelled in 2020-2021. Now the modal finds and displays progress scores from the most recent year they're available, with the correct year shown in the header. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1375,6 +1375,13 @@ async function openSchoolModal(urn) {
|
||||
const previous = sortedData[latestIndex + 1] || null;
|
||||
const prevRwm = previous?.rwm_expected_pct;
|
||||
|
||||
// Find latest year with progress score data (not available for 2023-24, 2024-25)
|
||||
const latestWithProgress = sortedData.find(
|
||||
(d) => d.reading_progress !== null || d.writing_progress !== null || d.maths_progress !== null
|
||||
);
|
||||
const progressYear = latestWithProgress?.year || latest.year;
|
||||
const progressData = latestWithProgress || latest;
|
||||
|
||||
elements.modalStats.innerHTML = `
|
||||
<div class="modal-stats-section">
|
||||
<h4>KS2 Results (${latest.year})</h4>
|
||||
@@ -1398,18 +1405,18 @@ async function openSchoolModal(urn) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-stats-section">
|
||||
<h4>Progress Scores (${latest.year}) ${createWarningTrigger("progress_scores_unavailable")}</h4>
|
||||
<h4>Progress Scores (${progressYear}) ${createWarningTrigger("progress_scores_unavailable")}</h4>
|
||||
<div class="modal-stats-grid">
|
||||
<div class="modal-stat">
|
||||
<div class="modal-stat-value ${getProgressClass(latest.reading_progress)}">${formatMetricValue(latest.reading_progress, "reading_progress")}</div>
|
||||
<div class="modal-stat-value ${getProgressClass(progressData.reading_progress)}">${formatMetricValue(progressData.reading_progress, "reading_progress")}</div>
|
||||
<div class="modal-stat-label">Reading${createInfoTrigger("reading_progress")}</div>
|
||||
</div>
|
||||
<div class="modal-stat">
|
||||
<div class="modal-stat-value ${getProgressClass(latest.writing_progress)}">${formatMetricValue(latest.writing_progress, "writing_progress")}</div>
|
||||
<div class="modal-stat-value ${getProgressClass(progressData.writing_progress)}">${formatMetricValue(progressData.writing_progress, "writing_progress")}</div>
|
||||
<div class="modal-stat-label">Writing${createInfoTrigger("writing_progress")}</div>
|
||||
</div>
|
||||
<div class="modal-stat">
|
||||
<div class="modal-stat-value ${getProgressClass(latest.maths_progress)}">${formatMetricValue(latest.maths_progress, "maths_progress")}</div>
|
||||
<div class="modal-stat-value ${getProgressClass(progressData.maths_progress)}">${formatMetricValue(progressData.maths_progress, "maths_progress")}</div>
|
||||
<div class="modal-stat-label">Maths${createInfoTrigger("maths_progress")}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user