Code powering GCSE and A-Level results analysis from FFT Education Datalab and the Nuffield Foundation, as featured on our results microsite.
For background to the project, refer to the About page of the results microsite.
py
: Six Python files, details of which are provided belowdata
: Data files on which the site is based:source
: Excel files (.xls
,.xlsx
) of entry and grades data for the period published by the Joint Council for Qualifications. Filenames take the form<level>_<year>_<scope>_<grades (GCSE only)>
. Herescope
refers to the breakdowns by home nation (UK
,EN
,WA
,NI
), age of entrant (GCSE only;15
,16
,17
) or home nation and age (GCSE only;EN16
only).grades
refers to whether datafiles are in terms of A*-G grades (ag
), or the key grades at which the 9-1 grade structure and the A*-G grade structure are pegged (keygrades
).output
:a-level
:<level>-entries.json
: Compiled entries data produced bydata_compiler.py
, based on the source data files<level>-grades.json
: Compiled grades data produced bydata_compiler.py
, based on the source data files<level>-subjects.json
: A bespoke dataset produced by Datalab, giving subject definitions, flags for whether a subject is an English Baccalaureate subject, is double-counted in Progress 8, or is a facilitating subject, reform dates, and contextual information.<level>-text.json
: A data file written by theanalysis_writer.py
script, it provides analysis of entry numbers and grades for each subject.
as-level
:- as per a-level
gcse
:- as per a-level
popn
:popn.json
: A data file used by theanalysis_writer.py
script. The source is ultimately the ONS's mid-year population estimates
templates
: template files for subject-level php pages and level sub-pagesa-level
,as-level
,gcse
: subject-level php pages, generated bytemplate_copier.py
a-level.php
,as-level.php
,gcse.php
: level sub-pagescss
,img
,inc
,js
, together with various individual home directory files: web files
Data files are shaped in the format required for use in Highcharts charts.
subjects_checker: Checks completeness in both directions between source files and -subjects.json
files.
data_compiler: Compiles -entries.json
and -grades.json
files, with data for all subjects in -subjects.json
files.
analysis_writer: Writes analysis to -text.json
files for all subjects in -subjects.json
files with at least one year of entry data. Blank for those with none.
extract_generator: Generates a number of bespoke data extracts from the -entries.json
and -grades.json
files.
versioning_updater: Appends a query string to links to .php
, .js
, .json
.css
project files in all .php
and .js
files, so that cached versions of these files aren't loaded once they are updated.
template_copier: Produces a .php
page for each of the three levels (GCSE, A-Level, AS-Level) and each subject in subjects.json
, based on the template files in the templates
folder.
- Bring in and rename any new source data files, following the naming convention
<level>_<year>_<scope>_<grades (GCSE only)>
subjects_checker.py
- Update
target-year
in script (most recent year for which data is available) - Run
- (If required) Update
-subject.json
files - (If required) Re-run
- Update
- Run
data_compiler.py
analysis_writer.py
- Update
min-year
in script to match the start year used in charts - Run
- Update
- (If required) Run
extract_generator.py
versioning_updater.py
- Run
- Check output
template_copier.py
almost certainly won't need running on results day - it only needs running after design tweaks to subject pages.
The microsite has the ability to produce three types of bespoke chart. In each case, only entries charts can be produced, not grade breakdown charts.
This allows comparison of entry trends in multiple subjects.
The URL used is of the form:
Up to seven subjects can be displayed before series colours repeat.
This allows comparison of entry trends in a single subject by the different country and age breakdowns for which we have data.
The URL used is of one of the following forms:
- https://results.ffteducationdatalab.org.uk/gcse/bespoke.php?sbj=FREN|options=UK,EN,WA,NI
- https://results.ffteducationdatalab.org.uk/gcse/bespoke.php?sbj=FREN|options=15,16,17
- https://results.ffteducationdatalab.org.uk/gcse/bespoke.php?sbj=FREN|options=EN16,WA16,NI17
This allows comparison of entry trends in multiple subjects in a panel of charts, either for all students in the UK or for a single country or age breakdown for which we have data.
The URL used is of one of the following forms:
- https://results.ffteducationdatalab.org.uk/gcse/small_multiple.php?sbj=FREN,GERM,SPAN,PHYS,CHEM,GEOG,HIST,BIOL,MATH,ENLA,ENLI,RELS
- https://results.ffteducationdatalab.org.uk/gcse/small_multiple.php?sbj=FREN,GERM,SPAN,PHYS,CHEM,GEOG,HIST,BIOL,MATH,ENLA,ENLI,RELS|options=EN16
Only a single option can be specified, where this functionality is used.
NB: The small multiple functionality is under active development and is currently only optimised for larger monitors. The ability to set the chart title by way of a parameter has also not been implemented.
- Python scripts are made available here under the MIT licence - see the
LICENSE
file for full details. - Content of the results day analysis microsite - for example, written analysis of entry numbers and grades for each subject - is made available under a Creative Commons attribution licence (CC BY 4.0).
- Source data is produced by the Joint Council for Qualifications. Questions relating to reuse of the source data should be directed to JCQ.