Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
15da060e4a | ||
|
|
a5b2296240 | ||
|
|
af23fbf27e | ||
|
|
22e9eb2d48 | ||
|
|
13253116c2 | ||
|
|
1b8adb91ee | ||
|
|
ca4fc647a5 | ||
|
|
261403bcd2 | ||
|
|
e4c8b86fe7 | ||
|
|
993822d769 | ||
|
|
0b36eace9d | ||
|
|
de943ded19 | ||
|
|
ae6ef6860b | ||
|
|
4e316b4e38 | ||
|
|
733faefb98 |
@@ -175,8 +175,30 @@ test('an all-through school shows BOTH its KS2 SATs and its GCSE results, not ju
|
||||
// The combined results section carries both phases.
|
||||
const results = page.locator('#results');
|
||||
await expect(results.getByText(/SATs & GCSE Results/)).toBeVisible();
|
||||
await expect(results.getByText('Reading, Writing & Maths combined')).toBeVisible(); // KS2
|
||||
await expect(results.getByText('Attainment 8').first()).toBeVisible(); // KS4
|
||||
await expect(results.getByRole('heading', { name: /Primary.*KS2 SATs/ })).toBeVisible(); // KS2 block
|
||||
await expect(results.getByRole('heading', { name: /Secondary.*GCSEs/ })).toBeVisible(); // KS4 block
|
||||
});
|
||||
|
||||
test('a special school is not shown as failing against the mainstream England average', async ({ page }) => {
|
||||
// Special schools sit the same tests but very few pupils reach the mainstream
|
||||
// "expected standard", so a "0.0% · −62 pts below England average" rendering
|
||||
// portrays them as failing against a benchmark that doesn't fit. The results
|
||||
// section drops the England comparison and explains the context instead.
|
||||
const SP_URN = 101099; // Greenmead School — a community special school
|
||||
const res = await page.request.get(`/api/schools/${SP_URN}`);
|
||||
expect(res.ok()).toBeTruthy();
|
||||
const detail = await res.json();
|
||||
test.skip(
|
||||
!/special|pupil referral|alternative provision/i.test(detail.school_info?.school_type ?? ''),
|
||||
'precondition: chosen URN must currently be a special school',
|
||||
);
|
||||
|
||||
await page.goto(`/school/${SP_URN}`);
|
||||
const results = page.locator('#results');
|
||||
// The special-school context note is shown…
|
||||
await expect(results.getByText(/This is a special school/i)).toBeVisible({ timeout: 15_000 });
|
||||
// …and the mainstream England-average comparison is dropped entirely.
|
||||
await expect(results.getByText(/England avg/i)).toHaveCount(0);
|
||||
});
|
||||
|
||||
test('school with no performance data still gets a working detail page', async ({ page }) => {
|
||||
@@ -416,6 +438,18 @@ test('compare chart on mobile shows school chips with tap-to-focus', async ({ pa
|
||||
await expect(chips.first()).toHaveAttribute('aria-pressed', 'false');
|
||||
});
|
||||
|
||||
test('admissions guide renders its key milestones', async ({ page }) => {
|
||||
// Static content page — assert the guide loads and the load-bearing
|
||||
// milestones parents rely on are present (dates are statutory, so these
|
||||
// strings are stable invariants, not data-refresh-sensitive).
|
||||
await page.goto('/admissions');
|
||||
await expect(page.getByRole('heading', { name: /School Admissions Guide/i })).toBeVisible();
|
||||
await expect(page.getByRole('heading', { name: /Primary school admissions/i })).toBeVisible();
|
||||
await expect(page.getByRole('heading', { name: /Secondary school admissions/i })).toBeVisible();
|
||||
// National Offer Day is the milestone the whole guide builds toward.
|
||||
await expect(page.getByText(/National Offer Day/i).first()).toBeVisible();
|
||||
});
|
||||
|
||||
test('rankings page loads a populated table', async ({ page }) => {
|
||||
await page.goto('/rankings');
|
||||
await expect(page.getByRole('heading', { name: /rankings/i }).first()).toBeVisible();
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* SpecialSchoolNote Component Tests
|
||||
*/
|
||||
|
||||
import '@testing-library/jest-dom';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { SpecialSchoolNote } from '@/components/SpecialSchoolNote';
|
||||
|
||||
describe('SpecialSchoolNote', () => {
|
||||
it('renders nothing for a mainstream school', () => {
|
||||
const { container } = render(<SpecialSchoolNote school={{ school_type: 'Academy converter' }} />);
|
||||
expect(container).toBeEmptyDOMElement();
|
||||
});
|
||||
|
||||
it('describes a special school as teaching pupils with SEND', () => {
|
||||
render(<SpecialSchoolNote school={{ school_type: 'Community special school' }} />);
|
||||
expect(screen.getByText(/This is a special school/i)).toBeInTheDocument();
|
||||
expect(screen.getByText(/special educational needs/i)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('does NOT call PRU pupils SEND — they are educated outside a mainstream school', () => {
|
||||
render(<SpecialSchoolNote school={{ school_type: 'Pupil referral unit' }} />);
|
||||
expect(screen.getByText(/This is a pupil referral unit/i)).toBeInTheDocument();
|
||||
expect(screen.getByText(/educated outside a mainstream school/i)).toBeInTheDocument();
|
||||
expect(screen.queryByText(/special educational needs/i)).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('does NOT call alternative-provision pupils SEND', () => {
|
||||
render(<SpecialSchoolNote school={{ school_type: 'Academy alternative provision converter' }} />);
|
||||
expect(screen.getByText(/This is an alternative provision setting/i)).toBeInTheDocument();
|
||||
expect(screen.queryByText(/special educational needs/i)).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
@@ -269,6 +269,44 @@ describe('isProposedToClose', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('isSpecialSchool', () => {
|
||||
const { isSpecialSchool } = require('@/lib/utils');
|
||||
|
||||
it('matches every DfE special-school establishment type', () => {
|
||||
for (const t of [
|
||||
'Community special school',
|
||||
'Foundation special school',
|
||||
'Academy special converter',
|
||||
'Academy special sponsor led',
|
||||
'Non-maintained special school',
|
||||
'Free schools special',
|
||||
'Other independent special school',
|
||||
]) {
|
||||
expect(isSpecialSchool({ school_type: t })).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
it('matches pupil referral units and alternative provision', () => {
|
||||
expect(isSpecialSchool({ school_type: 'Pupil referral unit' })).toBe(true);
|
||||
expect(isSpecialSchool({ school_type: 'Academy alternative provision converter' })).toBe(true);
|
||||
});
|
||||
|
||||
it('does not match mainstream types (no false positives)', () => {
|
||||
for (const t of [
|
||||
'Academy converter',
|
||||
'Community school',
|
||||
'Voluntary aided school',
|
||||
'Free schools',
|
||||
'University technical college',
|
||||
'Other independent school',
|
||||
null,
|
||||
undefined,
|
||||
]) {
|
||||
expect(isSpecialSchool({ school_type: t })).toBe(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('shortName', () => {
|
||||
it('drops the trailing establishment-type words', () => {
|
||||
expect(shortName('Barclay Primary School')).toBe('Barclay');
|
||||
|
||||
@@ -442,6 +442,58 @@
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
/* ─── Easy-to-miss callouts ──────────────────────────── */
|
||||
|
||||
.calloutGroup {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
margin-top: 0.7rem;
|
||||
}
|
||||
|
||||
.callout {
|
||||
display: flex;
|
||||
gap: 0.55rem;
|
||||
padding: 0.6rem 0.75rem;
|
||||
background: var(--accent-gold-bg, rgba(201, 162, 39, 0.12));
|
||||
border: 1px solid rgba(201, 162, 39, 0.28);
|
||||
border-left: 3px solid var(--accent-gold, #c9a227);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.calloutIcon {
|
||||
flex-shrink: 0;
|
||||
width: 1.05rem;
|
||||
height: 1.05rem;
|
||||
margin-top: 0.1rem;
|
||||
border-radius: 50%;
|
||||
background: var(--accent-gold, #c9a227);
|
||||
color: #fff;
|
||||
font-size: 0.72rem;
|
||||
font-weight: 800;
|
||||
line-height: 1.05rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calloutText {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.calloutTitle {
|
||||
font-size: 0.82rem;
|
||||
font-weight: 700;
|
||||
color: var(--accent-gold-text, #7a6800);
|
||||
line-height: 1.3;
|
||||
margin-bottom: 0.15rem;
|
||||
}
|
||||
|
||||
.calloutBody {
|
||||
font-size: 0.82rem;
|
||||
color: var(--text-secondary, #5c564d);
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ─── Tips ───────────────────────────────────────────── */
|
||||
|
||||
.tips {
|
||||
|
||||
@@ -54,6 +54,9 @@ interface Step {
|
||||
title: string;
|
||||
body: string;
|
||||
highlight?: 'deadline' | 'offer';
|
||||
/* Easy-to-miss, deadline-sensitive warnings surfaced as callout boxes
|
||||
rather than buried in the body prose. */
|
||||
callouts?: { title: string; body: string }[];
|
||||
/* How SchoolCompare helps at this stage of the journey */
|
||||
tool?: { label: string; href: string };
|
||||
}
|
||||
@@ -62,6 +65,16 @@ const SECONDARY_STEPS: Step[] = [
|
||||
{
|
||||
title: 'Check entry criteria',
|
||||
body: 'Look at each school\'s admissions policy — catchment areas, faith criteria, sibling priority, and aptitude tests vary widely.',
|
||||
callouts: [
|
||||
{
|
||||
title: 'Selective schools register earlier',
|
||||
body: 'Grammar and other selective schools need separate entrance-test registration months earlier — often by September, well before the 31 October deadline.',
|
||||
},
|
||||
{
|
||||
title: 'Faith schools may need an extra form',
|
||||
body: 'Many faith schools require a supplementary information form (SIF) sent directly to the school, on top of the council application.',
|
||||
},
|
||||
],
|
||||
tool: { label: 'Find schools & view their admissions history', href: '/' },
|
||||
},
|
||||
{
|
||||
@@ -73,14 +86,14 @@ const SECONDARY_STEPS: Step[] = [
|
||||
{
|
||||
date: '31 October',
|
||||
title: 'Application deadline',
|
||||
body: 'Submit your ranked list of up to six schools. Councils treat all preferences equally — list schools in the genuine order you want them, not strategically.',
|
||||
body: 'Submit your ranked list of schools — most councils allow three to six preferences (London boroughs typically six). Councils treat all preferences equally, so list schools in the genuine order you want them, not strategically.',
|
||||
highlight: 'deadline',
|
||||
tool: { label: 'Compare performance to order your preferences', href: '/rankings' },
|
||||
},
|
||||
{
|
||||
date: '1 March',
|
||||
title: 'National Offer Day',
|
||||
body: 'Results are published online, usually from 12:01 am. You\'ll receive an email or letter with your allocated school.',
|
||||
body: 'Your allocated school appears on the council\'s online admissions portal and is sent by email. Release times are set by each council — often from late afternoon, though some publish overnight — so check your council\'s page rather than refreshing at midnight.',
|
||||
highlight: 'offer',
|
||||
tool: { label: 'Look up your allocated school', href: '/' },
|
||||
},
|
||||
@@ -101,6 +114,12 @@ const PRIMARY_STEPS: Step[] = [
|
||||
{
|
||||
title: 'Research entry criteria',
|
||||
body: 'Faith schools, language units, and distance-based catchments differ by school. Start by reading each school\'s admissions policy on their website or the council\'s website.',
|
||||
callouts: [
|
||||
{
|
||||
title: 'Faith schools may need an extra form',
|
||||
body: 'Many faith schools require a supplementary information form (SIF) sent directly to the school, in addition to the council application.',
|
||||
},
|
||||
],
|
||||
tool: { label: 'Find schools & view their admissions history', href: '/' },
|
||||
},
|
||||
{
|
||||
@@ -144,7 +163,7 @@ interface Tip {
|
||||
const TIPS: Tip[] = [
|
||||
{
|
||||
heading: 'Equal preference rule',
|
||||
body: 'Councils rank offers by your eligibility for each school, not by the order you listed them. You cannot game the system — put schools in the order you actually want them.',
|
||||
body: 'Councils consider every school you list before making any offer, then give you the highest-ranked one you qualify for. Your order only decides which qualifying school you get — you can\'t game it, so list schools in the order you genuinely want them.',
|
||||
},
|
||||
{
|
||||
heading: 'Late applications go to the back',
|
||||
@@ -307,6 +326,19 @@ export function AdmissionsView() {
|
||||
{step.date && <div className={styles.stepDate}>{step.date}</div>}
|
||||
<div className={styles.stepTitle}>{step.title}</div>
|
||||
<p className={styles.stepBody}>{step.body}</p>
|
||||
{step.callouts && step.callouts.length > 0 && (
|
||||
<div className={styles.calloutGroup}>
|
||||
{step.callouts.map((c) => (
|
||||
<div key={c.title} className={styles.callout}>
|
||||
<span className={styles.calloutIcon} aria-hidden="true">!</span>
|
||||
<div className={styles.calloutText}>
|
||||
<div className={styles.calloutTitle}>{c.title}</div>
|
||||
<p className={styles.calloutBody}>{c.body}</p>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
{step.tool && (
|
||||
<a
|
||||
href={step.tool.href}
|
||||
@@ -355,6 +387,19 @@ export function AdmissionsView() {
|
||||
{step.date && <div className={styles.stepDate}>{step.date}</div>}
|
||||
<div className={styles.stepTitle}>{step.title}</div>
|
||||
<p className={styles.stepBody}>{step.body}</p>
|
||||
{step.callouts && step.callouts.length > 0 && (
|
||||
<div className={styles.calloutGroup}>
|
||||
{step.callouts.map((c) => (
|
||||
<div key={c.title} className={styles.callout}>
|
||||
<span className={styles.calloutIcon} aria-hidden="true">!</span>
|
||||
<div className={styles.calloutText}>
|
||||
<div className={styles.calloutTitle}>{c.title}</div>
|
||||
<p className={styles.calloutBody}>{c.body}</p>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
{step.tool && (
|
||||
<a
|
||||
href={step.tool.href}
|
||||
|
||||
@@ -13,17 +13,17 @@ export function EditorialSection({ totalSchools, localAuthorityCount }: Editoria
|
||||
<div className={styles.editorialGrid}>
|
||||
<div className={styles.editorialText}>
|
||||
<div className={styles.editorialKicker}>About school data</div>
|
||||
<h2 className={styles.editorialHeading}>Making UK school performance data actually readable</h2>
|
||||
<h2 className={styles.editorialHeading}>Making England's school performance data actually readable</h2>
|
||||
<p>
|
||||
School performance data in England is rich but fragmented. The Department for Education publishes
|
||||
Key Stage 2 SATs, GCSE attainment, Ofsted outcomes, progress scores, admissions figures and
|
||||
demographics — each in its own table, each with its own jargon.
|
||||
School performance data in England is rich but fragmented. The Department for Education and Ofsted
|
||||
publish Key Stage 2 SATs, GCSE attainment, inspection outcomes, progress scores, admissions figures
|
||||
and demographics — each in its own table, each with its own jargon.
|
||||
</p>
|
||||
<p>
|
||||
SchoolCompare brings it all into one place. Every school page shows performance against the national
|
||||
average, explains what the numbers mean, and lets you shortlist schools side by side. Built for
|
||||
parents, governors, journalists, and anyone who wants to understand a school without reading a
|
||||
40-page inspection report.
|
||||
full inspection report.
|
||||
</p>
|
||||
</div>
|
||||
<div className={styles.factbox}>
|
||||
|
||||
@@ -720,10 +720,13 @@
|
||||
.miniRowHead {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 0.48rem;
|
||||
align-items: baseline;
|
||||
gap: 0.2rem;
|
||||
font-size: 0.44rem;
|
||||
color: var(--text-muted, #6d685f);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
letter-spacing: 0.01em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.miniRowHead strong {
|
||||
@@ -869,28 +872,77 @@
|
||||
color: var(--text-primary, #1a1612);
|
||||
}
|
||||
|
||||
.ofstedBadge {
|
||||
.ofstedFramework {
|
||||
align-self: flex-start;
|
||||
padding: 0.2rem 0.55rem;
|
||||
padding: 0.15rem 0.5rem;
|
||||
border-radius: 4px;
|
||||
background: rgba(45, 125, 125, 0.12);
|
||||
color: var(--accent-teal, #2d7d7d);
|
||||
font-size: 0.55rem;
|
||||
background: rgba(90, 58, 110, 0.12);
|
||||
color: #5a3a6e;
|
||||
font-size: 0.5rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.05em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.ofstedVerdict {
|
||||
font-family: var(--font-playfair), 'Playfair Display', serif;
|
||||
font-size: 1.05rem;
|
||||
.rcList {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.3rem;
|
||||
}
|
||||
|
||||
.rcRow {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.rcArea {
|
||||
font-size: 0.62rem;
|
||||
color: var(--text-secondary, #4a453d);
|
||||
}
|
||||
|
||||
.rcChip {
|
||||
padding: 0.1rem 0.4rem;
|
||||
border-radius: 3px;
|
||||
font-size: 0.52rem;
|
||||
font-weight: 700;
|
||||
line-height: 1.2;
|
||||
color: var(--text-primary, #1a1612);
|
||||
letter-spacing: 0.03em;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.ofstedVerdict em {
|
||||
.rcChipGood {
|
||||
background: rgba(45, 125, 125, 0.12);
|
||||
color: var(--accent-teal, #2d7d7d);
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.rcChipNeutral {
|
||||
background: var(--accent-gold-bg, rgba(180, 150, 40, 0.12));
|
||||
color: var(--accent-gold-text, #7a6800);
|
||||
}
|
||||
|
||||
/* Safeguarding is a separate binary met/not-met judgement, not a graded area,
|
||||
so it sits below the five-point list behind a divider with its own chip. */
|
||||
.rcSafeguarding {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.5rem;
|
||||
margin-top: 0.05rem;
|
||||
padding-top: 0.35rem;
|
||||
border-top: 1px dashed var(--border-color, #e5dfd5);
|
||||
}
|
||||
|
||||
.rcSep {
|
||||
color: var(--text-muted, #8a847a);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.rcChipMet {
|
||||
background: transparent;
|
||||
color: var(--accent-teal, #2d7d7d);
|
||||
border: 1px solid rgba(45, 125, 125, 0.4);
|
||||
}
|
||||
|
||||
.ofstedMeta {
|
||||
|
||||
@@ -261,7 +261,7 @@ export function HomeView({ initialSchools, filters, totalSchools, howItWorks, ed
|
||||
<div className={styles.heroSection}>
|
||||
<span className={styles.heroEyebrow}>
|
||||
<span className={styles.heroEyebrowDot} aria-hidden="true" />
|
||||
Updated with 2026/2027 admissions results
|
||||
Updated for the 2026/27 admissions round
|
||||
</span>
|
||||
<h1 className={styles.heroTitle}>
|
||||
Every school in England, <em className={styles.heroEmph}>compared.</em>
|
||||
|
||||
@@ -5,15 +5,26 @@
|
||||
import styles from './HomeView.module.css';
|
||||
|
||||
export function HowItWorksSection() {
|
||||
// "exc" is the school's above-expected result. DfE names this differently
|
||||
// by subject: "higher standard" for the reading and maths tests, "greater
|
||||
// depth" for teacher-assessed writing. "nat" is the national expected %.
|
||||
const miniCascade = [
|
||||
{ subj: 'Reading', exp: 96, exc: 73, nat: 75 },
|
||||
{ subj: 'Writing', exp: 81, exc: 15, nat: 72 },
|
||||
{ subj: 'Maths', exp: 85, exc: 47, nat: 74 },
|
||||
{ subj: 'Reading', exp: 96, exc: 44, nat: 75, excLabel: 'Higher std' },
|
||||
{ subj: 'Writing', exp: 81, exc: 26, nat: 72, excLabel: 'Greater depth' },
|
||||
{ subj: 'Maths', exp: 85, exc: 41, nat: 74, excLabel: 'Higher std' },
|
||||
];
|
||||
const compareRows = [
|
||||
{ label: 'Reading, Writing & Maths', a: '70%', b: '64%', aHi: true },
|
||||
{ label: 'Higher standard (RWM)', a: '13%', b: '6%', aHi: true },
|
||||
{ label: 'Ofsted', a: 'Outstanding', b: 'Good', aHi: true },
|
||||
{ label: 'Reading progress', a: '+2.1', b: '+0.4', aHi: true },
|
||||
];
|
||||
// Report card (Ofsted's framework from Nov 2025): one rating per area of
|
||||
// school life on a five-point scale. Safeguarding is judged separately, as a
|
||||
// binary met/not-met outcome — kept out of this list and shown on its own.
|
||||
const reportCard: Array<{ area: string; grade: string; good: boolean }> = [
|
||||
{ area: 'Achievement', grade: 'Strong', good: true },
|
||||
{ area: 'Curriculum & teaching', grade: 'Expected standard', good: false },
|
||||
{ area: 'Attendance & behaviour', grade: 'Strong', good: true },
|
||||
];
|
||||
|
||||
return (
|
||||
@@ -29,7 +40,7 @@ export function HowItWorksSection() {
|
||||
<div className={styles.hiwPhaseBlock}>
|
||||
<div className={styles.hiwPhaseLabel}>Primary · Year 6 · <strong>Key Stage 2 SATs</strong></div>
|
||||
<div className={styles.miniCascade}>
|
||||
{miniCascade.map(({ subj, exp, exc, nat }) => (
|
||||
{miniCascade.map(({ subj, exp, exc, nat, excLabel }) => (
|
||||
<div key={subj} className={styles.miniCascadeCol}>
|
||||
<div className={styles.miniSubj}>{subj}</div>
|
||||
<div className={styles.miniRowHead}><span>Expected</span><strong>{exp}%</strong></div>
|
||||
@@ -37,7 +48,7 @@ export function HowItWorksSection() {
|
||||
<div className={styles.miniNatPill} style={{ left: `${nat}%` }}>{nat}%</div>
|
||||
<div className={styles.miniBarExp} style={{ width: `${exp}%` }} />
|
||||
</div>
|
||||
<div className={styles.miniRowHead}><span>Exceeding</span><strong>{exc}%</strong></div>
|
||||
<div className={styles.miniRowHead}><span>{excLabel}</span><strong>{exc}%</strong></div>
|
||||
<div className={styles.miniTrack}>
|
||||
<div className={styles.miniBarExc} style={{ width: `${exc}%` }} />
|
||||
</div>
|
||||
@@ -49,15 +60,15 @@ export function HowItWorksSection() {
|
||||
<div className={styles.hiwPhaseLabel}>Secondary · Year 11 · <strong>GCSE Attainment 8</strong></div>
|
||||
<div className={styles.att8Row}>
|
||||
<div className={styles.att8BarWrap}>
|
||||
<div className={styles.att8BarHead}><span>This school</span><span>National avg 50.2</span></div>
|
||||
<div className={styles.att8BarHead}><span>This school</span><span>National avg 45.9</span></div>
|
||||
<div className={styles.att8Track}>
|
||||
<div className={styles.att8Fill} style={{ width: '62%' }} />
|
||||
<div className={styles.att8NatLine} style={{ left: '50%' }} />
|
||||
<div className={styles.att8Fill} style={{ width: '54.8%' }} />
|
||||
<div className={styles.att8NatLine} style={{ left: '45.9%' }} />
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.att8Score}>
|
||||
<div className={styles.att8Value}>62.4</div>
|
||||
<div className={styles.att8Delta}>+12.2 vs national</div>
|
||||
<div className={styles.att8Value}>54.8</div>
|
||||
<div className={styles.att8Delta}>+8.9 vs national</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -77,15 +88,26 @@ export function HowItWorksSection() {
|
||||
<span className={styles.ofstedBullet} />
|
||||
<span className={styles.ofstedTitle}>Latest Ofsted inspection</span>
|
||||
</div>
|
||||
<span className={styles.ofstedBadge}>OUTSTANDING</span>
|
||||
<div className={styles.ofstedVerdict}>Rated <em>Outstanding</em> at last inspection.</div>
|
||||
<div className={styles.ofstedMeta}>Full inspection · March 2024</div>
|
||||
<span className={styles.ofstedFramework}>Report card · five-point scale</span>
|
||||
<div className={styles.rcList}>
|
||||
{reportCard.map(({ area, grade, good }) => (
|
||||
<div key={area} className={styles.rcRow}>
|
||||
<span className={styles.rcArea}>{area}</span>
|
||||
<span className={`${styles.rcChip} ${good ? styles.rcChipGood : styles.rcChipNeutral}`}>{grade}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div className={styles.rcSafeguarding}>
|
||||
<span className={styles.rcArea}>Safeguarding <span className={styles.rcSep}>· separate check</span></span>
|
||||
<span className={`${styles.rcChip} ${styles.rcChipMet}`}>Met</span>
|
||||
</div>
|
||||
<div className={styles.ofstedMeta}>Full inspection · March 2026</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.hiwCardBody}>
|
||||
<div className={styles.hiwStep}>Judgement</div>
|
||||
<div className={styles.hiwTitle}>Ofsted at a glance</div>
|
||||
<p className={styles.hiwDesc}>Current grade, inspection date, and a plain-English headline — without opening a 40-page report.</p>
|
||||
<p className={styles.hiwDesc}>Since November 2025, Ofsted rates each area of school life on a five-point scale rather than one overall word. We show every area and the inspection date — and, for schools not yet reinspected, the older overall grade they still carry.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ export function RankingsView({
|
||||
<header className={styles.header}>
|
||||
<h1>School Rankings</h1>
|
||||
<p className={styles.subtitle}>
|
||||
Top-performing schools by {metricLabel.toLowerCase()}
|
||||
Schools ranked by {metricLabel.toLowerCase()}
|
||||
{!selectedArea && rankings.length > 0 && <span className={styles.limitNote}> — showing top {rankings.length}</span>}
|
||||
</p>
|
||||
</header>
|
||||
@@ -143,7 +143,10 @@ export function RankingsView({
|
||||
<p className={styles.metricDescription}>{currentMetricDef.description}</p>
|
||||
)}
|
||||
{isProgressScore && (
|
||||
<p className={styles.progressHint}>Progress scores: 0 = national average. Positive = above average.</p>
|
||||
<p className={styles.progressHint}>
|
||||
Progress scores: 0 = national average. Positive = above average.
|
||||
{isPrimary && ' KS2 progress isn’t published for 2023/24 or 2024/25 (there’s no key stage 1 baseline) — pick an earlier year to rank by it.'}
|
||||
</p>
|
||||
)}
|
||||
|
||||
{/* Filters */}
|
||||
@@ -218,7 +221,11 @@ export function RankingsView({
|
||||
{rankings.length === 0 ? (
|
||||
<EmptyState
|
||||
title="No rankings found"
|
||||
message="Try selecting a different metric, area, or year."
|
||||
message={
|
||||
isPrimary && isProgressScore
|
||||
? 'KS2 progress scores aren’t published for the most recent years (2023/24 and 2024/25) because there’s no key stage 1 baseline. Select an earlier year to see progress rankings.'
|
||||
: 'Try selecting a different metric, area, or year.'
|
||||
}
|
||||
action={{
|
||||
label: 'Clear filters',
|
||||
onClick: () => router.push(`${pathname}?phase=${selectedPhase}`),
|
||||
|
||||
@@ -18,9 +18,10 @@ import type {
|
||||
SchoolDeprivation, SchoolFinance, NationalAverages,
|
||||
} from '@/lib/types';
|
||||
import {
|
||||
formatPercentage, formatProgress, formatAcademicYear, isProposedToClose, ofstedLegacyAreas,
|
||||
formatPercentage, formatProgress, formatAcademicYear, isProposedToClose, ofstedLegacyAreas, isSpecialSchool,
|
||||
} from '@/lib/utils';
|
||||
import { DeltaChip } from './DeltaChip';
|
||||
import { SpecialSchoolNote } from './SpecialSchoolNote';
|
||||
import { summariseAdmissions } from '@/lib/compareLogic';
|
||||
|
||||
const PerformanceChart = dynamic(
|
||||
@@ -233,6 +234,27 @@ export function SchoolDetailView({
|
||||
const hasKS4Results = latestResults != null && latestResults.attainment_8_score != null;
|
||||
const hasAnyResults = hasKS2Results || hasKS4Results;
|
||||
|
||||
// Special schools / PRUs / AP: their pupils sit the same tests but very few
|
||||
// reach the mainstream "expected standard", so a 0% headline and an England
|
||||
// comparison portray them as failing against a benchmark that doesn't fit.
|
||||
const isSpecial = isSpecialSchool(schoolInfo);
|
||||
// Belt-and-braces for KS2: a whole-row zero attainment (every subject 0 — a
|
||||
// special/suppressed signature) is a placeholder, not a real result. This
|
||||
// needs ALL of RWM + reading + writing + maths to be 0, so a genuine 0%
|
||||
// combined (some pupils met individual subjects but not all three) stays
|
||||
// comparable. Attainment 8 is a single 0–80 score with no subject breakdown
|
||||
// to form such a signature, so KS4 keys off establishment type only — a
|
||||
// genuine (if extreme) 0.0 still shows its real figure and comparison.
|
||||
const ks2Placeholder = latestResults != null
|
||||
&& latestResults.rwm_expected_pct === 0
|
||||
&& (latestResults.reading_expected_pct ?? 0) === 0
|
||||
&& (latestResults.writing_expected_pct ?? 0) === 0
|
||||
&& (latestResults.maths_expected_pct ?? 0) === 0;
|
||||
// Whether to drop the England-average deltas / national markers / "below"
|
||||
// framing on the attainment measures.
|
||||
const suppressKs2Comparison = isSpecial || ks2Placeholder;
|
||||
const suppressKs4Comparison = isSpecial;
|
||||
|
||||
// Build section nav items dynamically — only sections with data.
|
||||
// Order is engagement-led (from section_nav_used analytics): the most-sought
|
||||
// sections — results, admissions, inclusion, history — sit near the top,
|
||||
@@ -624,13 +646,22 @@ export function SchoolDetailView({
|
||||
{isAllThrough ? 'SATs & GCSE Results' : isSecondary ? 'GCSE Results' : 'SATs Results'} ({formatAcademicYear(latestResults.year)})
|
||||
</h2>
|
||||
<p className={styles.sectionSubtitle}>
|
||||
{isAllThrough
|
||||
? 'KS2 SATs (end of Year 6) and GCSE results (Year 11) — this school covers both. England averages shown for comparison.'
|
||||
: isSecondary
|
||||
? 'GCSE results for Year 11 pupils. England averages shown for comparison.'
|
||||
: 'End-of-primary-school tests taken by Year 6 pupils. England averages shown for comparison.'}
|
||||
{isSpecial
|
||||
? (isSecondary
|
||||
? 'GCSE results for Year 11 pupils.'
|
||||
: 'End-of-primary-school tests taken by Year 6 pupils.')
|
||||
: isAllThrough
|
||||
? 'KS2 SATs (end of Year 6) and GCSE results (Year 11) — this school covers both. England averages shown for comparison.'
|
||||
: isSecondary
|
||||
? 'GCSE results for Year 11 pupils. England averages shown for comparison.'
|
||||
: 'End-of-primary-school tests taken by Year 6 pupils. England averages shown for comparison.'}
|
||||
</p>
|
||||
|
||||
{/* Explains up front why the England comparison is dropped below, so
|
||||
a 0% headline never reads as a failing grade against a benchmark
|
||||
that doesn't fit. Type-aware copy (special vs PRU vs AP). */}
|
||||
<SpecialSchoolNote school={schoolInfo} />
|
||||
|
||||
{/* ── Primary / KS2 content ── */}
|
||||
{hasKS2Results && (
|
||||
<>
|
||||
@@ -646,7 +677,7 @@ export function SchoolDetailView({
|
||||
</div>
|
||||
<div className={styles.heroStatValue}>
|
||||
{formatPercentage(latestResults.rwm_expected_pct)}
|
||||
{primaryAvg.rwm_expected_pct != null && (
|
||||
{!suppressKs2Comparison && primaryAvg.rwm_expected_pct != null && (
|
||||
<DeltaChip
|
||||
value={latestResults.rwm_expected_pct}
|
||||
baseline={primaryAvg.rwm_expected_pct}
|
||||
@@ -655,7 +686,7 @@ export function SchoolDetailView({
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
{primaryAvg.rwm_expected_pct != null && (
|
||||
{!suppressKs2Comparison && primaryAvg.rwm_expected_pct != null && (
|
||||
<div className={styles.heroStatHint}>England avg: {primaryAvg.rwm_expected_pct.toFixed(0)}%</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -668,7 +699,7 @@ export function SchoolDetailView({
|
||||
</div>
|
||||
<div className={styles.heroStatValue}>
|
||||
{formatPercentage(latestResults.rwm_high_pct)}
|
||||
{primaryAvg.rwm_high_pct != null && (
|
||||
{!suppressKs2Comparison && primaryAvg.rwm_high_pct != null && (
|
||||
<DeltaChip
|
||||
value={latestResults.rwm_high_pct}
|
||||
baseline={primaryAvg.rwm_high_pct}
|
||||
@@ -677,14 +708,15 @@ export function SchoolDetailView({
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
{primaryAvg.rwm_high_pct != null && (
|
||||
{!suppressKs2Comparison && primaryAvg.rwm_high_pct != null && (
|
||||
<div className={styles.heroStatHint}>England avg: {primaryAvg.rwm_high_pct.toFixed(0)}%</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{latestResults.rwm_expected_pct != null &&
|
||||
{!suppressKs2Comparison &&
|
||||
latestResults.rwm_expected_pct != null &&
|
||||
latestResults.reading_expected_pct != null &&
|
||||
latestResults.writing_expected_pct != null &&
|
||||
latestResults.maths_expected_pct != null && (
|
||||
@@ -708,28 +740,34 @@ export function SchoolDetailView({
|
||||
</div>
|
||||
)}
|
||||
|
||||
<SatsChart
|
||||
subjects={[
|
||||
{
|
||||
name: 'Reading',
|
||||
expectedPct: latestResults.reading_expected_pct,
|
||||
exceedingPct: latestResults.reading_high_pct,
|
||||
nationalExpectedPct: primaryAvg.reading_expected_pct,
|
||||
},
|
||||
{
|
||||
name: 'Writing',
|
||||
expectedPct: latestResults.writing_expected_pct,
|
||||
exceedingPct: latestResults.writing_high_pct,
|
||||
nationalExpectedPct: primaryAvg.writing_expected_pct,
|
||||
},
|
||||
{
|
||||
name: 'Maths',
|
||||
expectedPct: latestResults.maths_expected_pct,
|
||||
exceedingPct: latestResults.maths_high_pct,
|
||||
nationalExpectedPct: primaryAvg.maths_expected_pct,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
{/* All-zero placeholder rows (special / suppressed) would render as
|
||||
three empty bars against the national markers — misleading, so
|
||||
skip the chart. For a special school with some non-zero
|
||||
subjects, keep the bars but drop the national markers. */}
|
||||
{!ks2Placeholder && (
|
||||
<SatsChart
|
||||
subjects={[
|
||||
{
|
||||
name: 'Reading',
|
||||
expectedPct: latestResults.reading_expected_pct,
|
||||
exceedingPct: latestResults.reading_high_pct,
|
||||
nationalExpectedPct: suppressKs2Comparison ? null : primaryAvg.reading_expected_pct,
|
||||
},
|
||||
{
|
||||
name: 'Writing',
|
||||
expectedPct: latestResults.writing_expected_pct,
|
||||
exceedingPct: latestResults.writing_high_pct,
|
||||
nationalExpectedPct: suppressKs2Comparison ? null : primaryAvg.writing_expected_pct,
|
||||
},
|
||||
{
|
||||
name: 'Maths',
|
||||
expectedPct: latestResults.maths_expected_pct,
|
||||
exceedingPct: latestResults.maths_high_pct,
|
||||
nationalExpectedPct: suppressKs2Comparison ? null : primaryAvg.maths_expected_pct,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Progress scores row */}
|
||||
{(latestResults.reading_progress != null || latestResults.writing_progress != null || latestResults.maths_progress != null) && (
|
||||
@@ -786,7 +824,7 @@ export function SchoolDetailView({
|
||||
<MetricTooltip metricKey="attainment_8_score" />
|
||||
</div>
|
||||
<div className={styles.metricValue}>{latestResults.attainment_8_score.toFixed(1)}</div>
|
||||
{secondaryAvg.attainment_8_score != null && (
|
||||
{!suppressKs4Comparison && secondaryAvg.attainment_8_score != null && (
|
||||
<div className={styles.metricHint}>England avg: {secondaryAvg.attainment_8_score.toFixed(1)}</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -810,7 +848,7 @@ export function SchoolDetailView({
|
||||
<MetricTooltip metricKey="english_maths_standard_pass_pct" />
|
||||
</div>
|
||||
<div className={styles.metricValue}>{formatPercentage(latestResults.english_maths_standard_pass_pct)}</div>
|
||||
{secondaryAvg.english_maths_standard_pass_pct != null && (
|
||||
{!suppressKs4Comparison && secondaryAvg.english_maths_standard_pass_pct != null && (
|
||||
<div className={styles.metricHint}>England avg: {secondaryAvg.english_maths_standard_pass_pct.toFixed(0)}%</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -822,7 +860,7 @@ export function SchoolDetailView({
|
||||
<MetricTooltip metricKey="english_maths_strong_pass_pct" />
|
||||
</div>
|
||||
<div className={styles.metricValue}>{formatPercentage(latestResults.english_maths_strong_pass_pct)}</div>
|
||||
{secondaryAvg.english_maths_strong_pass_pct != null && (
|
||||
{!suppressKs4Comparison && secondaryAvg.english_maths_strong_pass_pct != null && (
|
||||
<div className={styles.metricHint}>England avg: {secondaryAvg.english_maths_strong_pass_pct.toFixed(0)}%</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -887,6 +925,15 @@ export function SchoolDetailView({
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{/* All-through admissions data covers a single entry point (usually the
|
||||
Year 7 secondary intake), not reception — say so, or a parent could
|
||||
read these as the whole-school figures. */}
|
||||
{isAllThrough && admissions.school_phase && (
|
||||
<p className={styles.sectionSubtitle}>
|
||||
These figures are for {admissions.school_phase.toLowerCase()} entry
|
||||
{/secondary/i.test(admissions.school_phase) ? ' (Year 7)' : /primary/i.test(admissions.school_phase) ? ' (Reception)' : ''}.
|
||||
</p>
|
||||
)}
|
||||
|
||||
<div className={styles.admissionsViewport}>
|
||||
{/* This-year Q&A */}
|
||||
@@ -1076,8 +1123,8 @@ export function SchoolDetailView({
|
||||
data={yearlyData}
|
||||
schoolName={schoolInfo.school_name}
|
||||
isSecondary={false}
|
||||
nationalRwmAvg={primaryAvg.rwm_expected_pct ?? null}
|
||||
nationalByYear={nationalAvg?.by_year}
|
||||
nationalRwmAvg={suppressKs2Comparison ? null : (primaryAvg.rwm_expected_pct ?? null)}
|
||||
nationalByYear={suppressKs2Comparison ? undefined : nationalAvg?.by_year}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
@@ -1090,8 +1137,8 @@ export function SchoolDetailView({
|
||||
data={yearlyData}
|
||||
schoolName={schoolInfo.school_name}
|
||||
isSecondary={true}
|
||||
nationalAtt8Avg={secondaryAvg.attainment_8_score ?? null}
|
||||
nationalByYear={nationalAvg?.by_year}
|
||||
nationalAtt8Avg={suppressKs4Comparison ? null : (secondaryAvg.attainment_8_score ?? null)}
|
||||
nationalByYear={suppressKs4Comparison ? undefined : nationalAvg?.by_year}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
@@ -1103,9 +1150,9 @@ export function SchoolDetailView({
|
||||
data={yearlyData}
|
||||
schoolName={schoolInfo.school_name}
|
||||
isSecondary={isSecondary}
|
||||
nationalRwmAvg={isPrimary ? (primaryAvg.rwm_expected_pct ?? null) : null}
|
||||
nationalAtt8Avg={isSecondary ? (secondaryAvg.attainment_8_score ?? null) : null}
|
||||
nationalByYear={nationalAvg?.by_year}
|
||||
nationalRwmAvg={isPrimary && !suppressKs2Comparison ? (primaryAvg.rwm_expected_pct ?? null) : null}
|
||||
nationalAtt8Avg={isSecondary && !suppressKs4Comparison ? (secondaryAvg.attainment_8_score ?? null) : null}
|
||||
nationalByYear={(isPrimary ? suppressKs2Comparison : suppressKs4Comparison) ? undefined : nationalAvg?.by_year}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
import type { School } from '@/lib/types';
|
||||
import { formatPercentage, calculateTrend, getPhaseStyle, schoolUrl, buildOfstedListBadge, formatAgeRange, isProposedToClose } from '@/lib/utils';
|
||||
import { formatPercentage, calculateTrend, getPhaseStyle, schoolUrl, buildOfstedListBadge, formatAgeRange, isProposedToClose, isSpecialSchool } from '@/lib/utils';
|
||||
import styles from './SchoolRow.module.css';
|
||||
|
||||
interface SchoolRowProps {
|
||||
@@ -38,10 +38,23 @@ export function SchoolRow({
|
||||
school.religious_denomination &&
|
||||
school.religious_denomination !== 'Does not apply';
|
||||
|
||||
// vs-national delta
|
||||
// A placeholder all-zero row (every subject 0 — a special/suppressed
|
||||
// signature, matching SchoolDetailView's ks2Placeholder) isn't a real score,
|
||||
// so its figure is hidden. A genuine 0% combined (some pupils met individual
|
||||
// subjects but not all three) is NOT all-zero and stays shown.
|
||||
const rwmPlaceholder =
|
||||
school.rwm_expected_pct === 0 &&
|
||||
(school.reading_expected_pct ?? 0) === 0 &&
|
||||
(school.writing_expected_pct ?? 0) === 0 &&
|
||||
(school.maths_expected_pct ?? 0) === 0;
|
||||
// The school's OWN figure and its year-over-year trend are same-school
|
||||
// measures — shown whenever there's a real value, special schools included.
|
||||
const showRwmValue = school.rwm_expected_pct != null && !rwmPlaceholder;
|
||||
// The vs-England delta is a mainstream benchmark: additionally dropped for
|
||||
// special schools / PRUs / AP, whose pupils aren't measured against it fairly.
|
||||
const rwmDelta =
|
||||
school.rwm_expected_pct != null && nationalAvgRwm != null
|
||||
? Math.round(school.rwm_expected_pct - nationalAvgRwm)
|
||||
showRwmValue && !isSpecialSchool(school) && nationalAvgRwm != null
|
||||
? Math.round((school.rwm_expected_pct as number) - nationalAvgRwm)
|
||||
: null;
|
||||
|
||||
const handleCompareClick = () => {
|
||||
@@ -87,9 +100,9 @@ export function SchoolRow({
|
||||
<div className={styles.line3}>
|
||||
<span className={styles.stat}>
|
||||
<strong className={styles.statValue}>
|
||||
{school.rwm_expected_pct != null ? formatPercentage(school.rwm_expected_pct, 0) : '—'}
|
||||
{showRwmValue ? formatPercentage(school.rwm_expected_pct, 0) : '—'}
|
||||
</strong>
|
||||
{school.prev_rwm_expected_pct != null && (
|
||||
{showRwmValue && school.prev_rwm_expected_pct != null && (
|
||||
<span
|
||||
className={`${styles.trend} ${styles[`trend${trend.charAt(0).toUpperCase() + trend.slice(1)}`]}`}
|
||||
title={`Previous year: ${formatPercentage(school.prev_rwm_expected_pct)}`}
|
||||
|
||||
@@ -23,8 +23,9 @@ import type {
|
||||
SchoolAdmissions, SenDetail, Phonics,
|
||||
SchoolDeprivation, SchoolFinance, NationalAverages,
|
||||
} from '@/lib/types';
|
||||
import { formatPercentage, formatProgress, formatAcademicYear, formatAgeRange, isProposedToClose, ofstedLegacyAreas } from '@/lib/utils';
|
||||
import { formatPercentage, formatProgress, formatAcademicYear, formatAgeRange, isProposedToClose, ofstedLegacyAreas, isSpecialSchool } from '@/lib/utils';
|
||||
import { DeltaChip } from './DeltaChip';
|
||||
import { SpecialSchoolNote } from './SpecialSchoolNote';
|
||||
import { track, getNavigationSource } from '@/lib/analytics';
|
||||
import styles from './SecondarySchoolDetailView.module.css';
|
||||
|
||||
@@ -107,6 +108,16 @@ export function SecondarySchoolDetailView({
|
||||
const p8Suspended = latestResults != null && latestResults.year >= 202425;
|
||||
const hasResults = latestResults?.attainment_8_score != null;
|
||||
|
||||
// Special schools / PRUs / AP sit the same GCSEs but teach pupils with SEND,
|
||||
// so their headline attainment is far below the mainstream average by design.
|
||||
// Drop the England comparison + "below" framing so the page doesn't portray
|
||||
// them as failing against a benchmark that doesn't fit. Attainment 8 is a
|
||||
// single 0–80 score with no subject breakdown to test for a placeholder, so
|
||||
// this keys off establishment type only — a genuine (if extreme) 0.0 at a
|
||||
// mainstream school still shows its real value and comparison.
|
||||
const isSpecial = isSpecialSchool(schoolInfo);
|
||||
const suppressComparison = isSpecial;
|
||||
|
||||
const admissionsTag = (() => {
|
||||
const policy = schoolInfo.admissions_policy?.toLowerCase() ?? '';
|
||||
if (policy.includes('selective')) return 'Selective';
|
||||
@@ -452,9 +463,11 @@ export function SecondarySchoolDetailView({
|
||||
GCSE Results ({formatAcademicYear(latestResults.year)})
|
||||
</h2>
|
||||
<p className={styles.sectionSubtitle}>
|
||||
GCSE results for Year 11 pupils. England averages shown for comparison.
|
||||
GCSE results for Year 11 pupils.{!suppressComparison && ' England averages shown for comparison.'}
|
||||
</p>
|
||||
|
||||
<SpecialSchoolNote school={schoolInfo} />
|
||||
|
||||
{p8Suspended && (
|
||||
<div className={styles.p8Banner}>
|
||||
Progress 8 isn't published for 2024/25: this GCSE year group sat no KS2 tests
|
||||
@@ -472,7 +485,7 @@ export function SecondarySchoolDetailView({
|
||||
</div>
|
||||
<div className={styles.heroStatValue}>
|
||||
{latestResults.attainment_8_score.toFixed(1)}
|
||||
{secondaryAvg.attainment_8_score != null && (
|
||||
{!suppressComparison && secondaryAvg.attainment_8_score != null && (
|
||||
<DeltaChip
|
||||
value={latestResults.attainment_8_score}
|
||||
baseline={secondaryAvg.attainment_8_score}
|
||||
@@ -481,7 +494,7 @@ export function SecondarySchoolDetailView({
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
{secondaryAvg.attainment_8_score != null && (
|
||||
{!suppressComparison && secondaryAvg.attainment_8_score != null && (
|
||||
<div className={styles.heroStatHint}>England avg: {secondaryAvg.attainment_8_score.toFixed(1)}</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -512,7 +525,7 @@ export function SecondarySchoolDetailView({
|
||||
</div>
|
||||
<div className={styles.heroStatValue}>
|
||||
{formatPercentage(latestResults.english_maths_strong_pass_pct)}
|
||||
{secondaryAvg.english_maths_strong_pass_pct != null && (
|
||||
{!suppressComparison && secondaryAvg.english_maths_strong_pass_pct != null && (
|
||||
<DeltaChip
|
||||
value={latestResults.english_maths_strong_pass_pct}
|
||||
baseline={secondaryAvg.english_maths_strong_pass_pct}
|
||||
@@ -521,7 +534,7 @@ export function SecondarySchoolDetailView({
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
{secondaryAvg.english_maths_strong_pass_pct != null && (
|
||||
{!suppressComparison && secondaryAvg.english_maths_strong_pass_pct != null && (
|
||||
<div className={styles.heroStatHint}>England avg: {secondaryAvg.english_maths_strong_pass_pct.toFixed(0)}%</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -534,7 +547,7 @@ export function SecondarySchoolDetailView({
|
||||
</div>
|
||||
<div className={styles.heroStatValue}>
|
||||
{formatPercentage(latestResults.english_maths_standard_pass_pct)}
|
||||
{secondaryAvg.english_maths_standard_pass_pct != null && (
|
||||
{!suppressComparison && secondaryAvg.english_maths_standard_pass_pct != null && (
|
||||
<DeltaChip
|
||||
value={latestResults.english_maths_standard_pass_pct}
|
||||
baseline={secondaryAvg.english_maths_standard_pass_pct}
|
||||
@@ -543,15 +556,17 @@ export function SecondarySchoolDetailView({
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
{secondaryAvg.english_maths_standard_pass_pct != null && (
|
||||
{!suppressComparison && secondaryAvg.english_maths_standard_pass_pct != null && (
|
||||
<div className={styles.heroStatHint}>England avg: {secondaryAvg.english_maths_standard_pass_pct.toFixed(0)}%</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Attainment 8 visual bar (0–80 scale) */}
|
||||
{latestResults.attainment_8_score != null && (
|
||||
{/* Attainment 8 visual bar (0–80 scale). This viz is explicitly
|
||||
"school vs national", so it's dropped for special schools where
|
||||
that comparison isn't meaningful. */}
|
||||
{!suppressComparison && latestResults.attainment_8_score != null && (
|
||||
<div className={styles.att8Viz}>
|
||||
<div className={styles.att8VizLabel}>Attainment 8 — school vs national</div>
|
||||
<div className={styles.att8VizTrack}>
|
||||
@@ -743,8 +758,8 @@ export function SecondarySchoolDetailView({
|
||||
data={yearlyData}
|
||||
schoolName={schoolInfo.school_name}
|
||||
isSecondary={true}
|
||||
nationalAtt8Avg={heroAtt8Nat}
|
||||
nationalByYear={nationalAvg?.by_year}
|
||||
nationalAtt8Avg={suppressComparison ? null : heroAtt8Nat}
|
||||
nationalByYear={suppressComparison ? undefined : nationalAvg?.by_year}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
'use client';
|
||||
|
||||
import type { School } from '@/lib/types';
|
||||
import { buildOfstedListBadge, getPhaseStyle, schoolUrl, formatAgeRange, isProposedToClose } from '@/lib/utils';
|
||||
import { buildOfstedListBadge, getPhaseStyle, schoolUrl, formatAgeRange, isProposedToClose, isSpecialSchool } from '@/lib/utils';
|
||||
import styles from './SecondarySchoolRow.module.css';
|
||||
|
||||
function detectAdmissionsTag(school: School): string | null {
|
||||
@@ -55,8 +55,14 @@ export function SecondarySchoolRow({
|
||||
const ofstedBadge = buildOfstedListBadge(school);
|
||||
const phase = getPhaseStyle(school.phase);
|
||||
const att8 = school.attainment_8_score;
|
||||
// The school's own Attainment 8 is a same-school figure — shown whenever it
|
||||
// exists (special schools included; their type tag on line 2 gives context).
|
||||
// Only the vs-LA-average delta, a benchmark comparison, is dropped for
|
||||
// special schools / PRUs / AP, whose pupils aren't measured against it fairly.
|
||||
const laDelta =
|
||||
att8 != null && laAvgAttainment8 != null ? att8 - laAvgAttainment8 : null;
|
||||
att8 != null && !isSpecialSchool(school) && laAvgAttainment8 != null
|
||||
? att8 - laAvgAttainment8
|
||||
: null;
|
||||
|
||||
const admissionsTag = detectAdmissionsTag(school);
|
||||
const sixthForm = hasSixthForm(school);
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/* Special-school / PRU / AP context note: soft, informational (teal), not a
|
||||
warning. Shared by both detail views so the styling can't drift. */
|
||||
.note {
|
||||
background: var(--bg-secondary, #f3ede4);
|
||||
border-left: 4px solid var(--accent-teal, #2d7d7d);
|
||||
border-radius: 0 6px 6px 0;
|
||||
padding: 0.7rem 1rem;
|
||||
margin: 0 0 1rem;
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.5;
|
||||
color: var(--text-secondary, #5c564d);
|
||||
}
|
||||
.note strong {
|
||||
color: var(--text-primary, #1a1612);
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* SpecialSchoolNote — the context note shown on special-school / PRU / AP
|
||||
* detail pages explaining why the mainstream England-average comparison is
|
||||
* dropped. Renders nothing for mainstream schools.
|
||||
*
|
||||
* The copy is type-aware: only genuine special schools have pupils with special
|
||||
* educational needs. Pupil referral units and alternative provision teach
|
||||
* pupils educated outside a mainstream setting (e.g. after exclusion, or for
|
||||
* medical reasons) who are not necessarily SEND — so their note says so rather
|
||||
* than mischaracterising them. Suppressing the England comparison is reasonable
|
||||
* for all three.
|
||||
*/
|
||||
|
||||
import { isSpecialSchool } from '@/lib/utils';
|
||||
import styles from './SpecialSchoolNote.module.css';
|
||||
|
||||
type SpecialKind = 'special' | 'pru' | 'ap';
|
||||
|
||||
function specialKind(schoolType: string | null | undefined): SpecialKind {
|
||||
const t = (schoolType ?? '').toLowerCase();
|
||||
if (/pupil referral/.test(t)) return 'pru';
|
||||
if (/alternative provision/.test(t)) return 'ap';
|
||||
return 'special';
|
||||
}
|
||||
|
||||
export function SpecialSchoolNote({ school }: { school: { school_type?: string | null } }) {
|
||||
if (!isSpecialSchool(school)) return null;
|
||||
const kind = specialKind(school.school_type);
|
||||
|
||||
return (
|
||||
<div className={styles.note} role="note">
|
||||
{kind === 'special' && (
|
||||
<>
|
||||
<strong>This is a special school.</strong> Its pupils have special educational needs and
|
||||
work towards individual targets. They sit the same national assessments, but very few
|
||||
reach the mainstream “expected standard” these measures report — so a
|
||||
comparison with the England average isn’t a meaningful guide to the school.
|
||||
</>
|
||||
)}
|
||||
{kind === 'pru' && (
|
||||
<>
|
||||
<strong>This is a pupil referral unit.</strong> It teaches pupils educated outside a
|
||||
mainstream school — for example after exclusion, or for medical or behavioural reasons.
|
||||
The mainstream “expected standard” and the England-average comparison
|
||||
aren’t a meaningful guide to the school.
|
||||
</>
|
||||
)}
|
||||
{kind === 'ap' && (
|
||||
<>
|
||||
<strong>This is an alternative provision setting.</strong> It teaches pupils educated
|
||||
outside a mainstream school. The mainstream “expected standard” and the
|
||||
England-average comparison aren’t a meaningful guide to the school.
|
||||
</>
|
||||
)}{' '}
|
||||
Where available, the progress its pupils make is a fairer measure.
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
'use client';
|
||||
|
||||
import { latestValues, verdict } from '@/lib/compareLogic';
|
||||
import { isSpecialSchool } from '@/lib/utils';
|
||||
import type { Benchmarks, ComparisonData, NationalAverages, School } from '@/lib/types';
|
||||
import { DotStrip } from '@/components/DotStrip';
|
||||
import { Cell, Chip, RowLabel, Section, SectionGrid, sectionStyles as s } from './sectionShared';
|
||||
@@ -90,15 +91,19 @@ function Strip({
|
||||
urns,
|
||||
schoolNames,
|
||||
national,
|
||||
special,
|
||||
}: {
|
||||
spec: StripSpec;
|
||||
data: Record<string, ComparisonData>;
|
||||
urns: number[];
|
||||
schoolNames: string[];
|
||||
national: Record<string, number> | undefined;
|
||||
/** Per-school special-school flag; special schools' mainstream attainment is
|
||||
* not a fair comparison, so it's dropped from the strip (no dot). */
|
||||
special: boolean[];
|
||||
}) {
|
||||
const values = latestValues(data, urns, spec.metric).map((v) =>
|
||||
v != null ? Math.round(v) : null,
|
||||
const values = latestValues(data, urns, spec.metric).map((v, i) =>
|
||||
v != null && !special[i] ? Math.round(v) : null,
|
||||
);
|
||||
const anchorValue = spec.anchorKey ? national?.[spec.anchorKey] : undefined;
|
||||
const anchor =
|
||||
@@ -135,12 +140,19 @@ export function CompareAcademics({
|
||||
}) {
|
||||
const urns = schools.map((school) => school.urn);
|
||||
const schoolNames = schools.map((school) => school.school_name);
|
||||
// Special schools / PRUs / AP: their pupils sit the same assessments but very
|
||||
// few reach the mainstream standard, so their attainment isn't a fair
|
||||
// like-for-like comparison — drop it (progress banding, which IS meaningful,
|
||||
// is kept).
|
||||
const specialFlags = schools.map((school) => isSpecialSchool(school));
|
||||
const dropSpecial = (vals: Array<number | null>) =>
|
||||
vals.map((v, i) => (specialFlags[i] ? null : v));
|
||||
const isSecondary = propIsSecondary !== undefined ? propIsSecondary : schools.some(
|
||||
(school) => data[String(school.urn)]?.school_info?.attainment_8_score != null,
|
||||
);
|
||||
|
||||
if (isSecondary) {
|
||||
const att8 = latestValues(data, urns, 'attainment_8_score');
|
||||
const att8 = dropSpecial(latestValues(data, urns, 'attainment_8_score'));
|
||||
const banding = urns.map((urn) => {
|
||||
const rows = data[String(urn)]?.yearly_data ?? [];
|
||||
for (let i = rows.length - 1; i >= 0; i--) {
|
||||
@@ -159,8 +171,8 @@ export function CompareAcademics({
|
||||
const y = rows.length ? Math.trunc(rows[rows.length - 1].year) : 0;
|
||||
return y >= 202425;
|
||||
});
|
||||
const grade5 = latestValues(data, urns, 'english_maths_strong_pass_pct');
|
||||
const ebacc = latestValues(data, urns, 'ebacc_entry_pct');
|
||||
const grade5 = dropSpecial(latestValues(data, urns, 'english_maths_strong_pass_pct'));
|
||||
const ebacc = dropSpecial(latestValues(data, urns, 'ebacc_entry_pct'));
|
||||
const att8Anchor = nationalAverages?.secondary?.attainment_8_score;
|
||||
const grade5Anchor = nationalAverages?.secondary?.english_maths_strong_pass_pct;
|
||||
const ebaccAnchor = nationalAverages?.secondary?.ebacc_entry_pct;
|
||||
@@ -272,7 +284,7 @@ export function CompareAcademics({
|
||||
}
|
||||
|
||||
const national = nationalAverages?.primary;
|
||||
const disadvantaged = latestValues(data, urns, 'rwm_expected_disadvantaged_pct');
|
||||
const disadvantaged = dropSpecial(latestValues(data, urns, 'rwm_expected_disadvantaged_pct'));
|
||||
const disadvantagedAnchor = benchmarks?.primary?.disadvantaged_rwm_expected_pct ?? null;
|
||||
// Cohort size behind the disadvantaged figure (spec §8.5): these are small
|
||||
// groups where single pupils move the percentage — show roughly how many
|
||||
@@ -307,6 +319,7 @@ export function CompareAcademics({
|
||||
urns={urns}
|
||||
schoolNames={schoolNames}
|
||||
national={national}
|
||||
special={specialFlags}
|
||||
/>
|
||||
))}
|
||||
|
||||
@@ -320,6 +333,7 @@ export function CompareAcademics({
|
||||
urns={urns}
|
||||
schoolNames={schoolNames}
|
||||
national={national}
|
||||
special={specialFlags}
|
||||
/>
|
||||
))}
|
||||
<p className={styles.stripNote}>
|
||||
|
||||
@@ -795,3 +795,24 @@ export const PROPOSED_TO_CLOSE_STATUS = 'Open, but proposed to close';
|
||||
export function isProposedToClose(school: { status?: string | null }): boolean {
|
||||
return school.status === PROPOSED_TO_CLOSE_STATUS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Special schools, pupil referral units and alternative provision teach pupils
|
||||
* with SEND or outside mainstream settings. Their pupils sit the same KS2/KS4
|
||||
* assessments but very few reach the mainstream "expected standard", so the
|
||||
* headline attainment measures — and any comparison to the England average —
|
||||
* are not a fair judgement of the school. Callers use this to drop the
|
||||
* mainstream-benchmark framing (deltas, "below England", national markers)
|
||||
* rather than portray these schools as failing.
|
||||
*
|
||||
* Detection is by establishment type: every DfE special-school type contains
|
||||
* "special" (e.g. "Community special school", "Academy special converter/sponsor
|
||||
* led", "Foundation special school", "Non-maintained special school", "Free
|
||||
* schools special", "Other independent special school"); PRUs and alternative
|
||||
* provision are matched by name. Special schools carry a mainstream `phase`
|
||||
* (Primary/Secondary/All-through), so `phase` alone can't identify them.
|
||||
*/
|
||||
export function isSpecialSchool(school: { school_type?: string | null }): boolean {
|
||||
const t = (school.school_type ?? '').toLowerCase();
|
||||
return /\bspecial\b/.test(t) || /pupil referral/.test(t) || /alternative provision/.test(t);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user