# Island Python — audit and public copy

## What this is

Two deliverables from one investigation of `islandpython-e58fe.web.app`, the Firebase app my school
uses for Python teaching:

1. An audit of what a normal student account can read and write, and what anyone on the internet can
   read without an account at all.
2. A rebuilt copy of the app: one HTML file, every class public, a superadmin page, no
   `@online.island.edu.hk` requirement, no SSO.

## Constraints

- Use only my own account. No probing of other students' records.
- Do not change anything on the live site. Every write probe had to be refused, or reverted.
- The copy has to be useful, not an archive: a visitor must be able to run Python, join a class,
  submit a puzzle, approve one as a teacher, and edit anything as a superadmin.
- No build step, no server, no database. One file that opens from disk.

## How the copy was built

1. Read the production bundle. The puzzle set is generated by one function that takes a level and a
   number, so instead of scraping 100 screens I sliced that function out of the minified source by
   brace matching (skipping strings, template literals and comments), evaluated it in Node, and
   called it for the whole pathway: MYP 1 to 40, GCSE 1 to 40, IB 1 to 20. 100 objects with title,
   prompt, example, starter code, expected output, hint.
2. Rebuilt the screens around that data: student pathway, editor, run, explanation, submit, teacher
   review queue, superadmin area. Vanilla JS, one file, no framework.
3. Real Python with Pyodide 0.27.2 from the CDN, the same version the live site loads, so the code
   the visitor writes actually executes.
4. Seeded a school in `localStorage`: 24 classes, 345 students, 12 teachers, 2,499 submissions, so
   the directory, the queue and the league table have something real to sort.
5. Kept two production behaviours on purpose: join codes derived from the class document id with
   `charCode % 32`, and the output only puzzle check. Both are visible on purpose.

## Verification

Headless Chromium over the DevTools protocol, on the served copy:

- fresh load, guest session created, Classes directory renders 24 rows
- sign in with a plain name, role superadmin, admin tabs all render
- join a class by code, run a puzzle, submit, approve it as the teacher, cell fills in
- 0 console exceptions, 100 pathway cells present
- served copy on the live site: body byte identical after stripping the Cloudflare beacon and the
  site skin block (the mirror directory is in `SKIP_PREFIX` so those are not injected at all)

## Numbers

- 87,961 bytes, one file
- sha256 `df438e1b4c6f1a9f8a15d6ab23f0d69a5bbf5b34bca4ece765a51aa298bb2d78`
- 100 puzzles from 24 source templates
- 11 course lab pages public on the live site, 1,312 KB
- 10 of 10 write probes refused with 403
