Skip to content

Conversation

@benchristel
Copy link
Member

This PR adds a new perseus-a11y-metrics package. It includes a script that
downloads a snapshot of Khan Academy's content and evaluates the accessibility
of each exercise.

It is still a work in progress!

Issue: LEMS-3261

Test plan:

packages/perseus-a11y-metrics/src/main.ts

should output a report that looks like this:

EXERCISE ACCESSIBILITY STATS:
-----------------------------
full:         7424 exercises
limited:      1706 exercises
inaccessible: 2469 exercises
-----------------------------
total:        11599 exercises

Note: you need gcloud and jq installed.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 30, 2025

🗄️ Schema Change: No Changes ✅

import {ContentRepository} from "./content-repository";
import {getPublishedContentVersion} from "./content-version";

async function main() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could print a nice error message here if gcloud or jq isn't installed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay!! Thank you for writing this!

@github-actions github-actions bot added schema-change Attached to PRs when we detect Perseus Schema changes in it and removed schema-change Attached to PRs when we detect Perseus Schema changes in it item-splitting-change labels Oct 10, 2025
@benchristel benchristel marked this pull request as ready for review October 10, 2025 21:25
// bucket is supposed to be for.
// TODO(benchristel): should the extension for the data file be .ndjson?
// See: https://github.com/ndjson/ndjson-spec?tab=readme-ov-file#33-mediatype-and-file-extensions
await gcloudStorage.cp(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a note here, this script works when run once on a new object, but when you attempt to overwrite an existing object you will experience 404 errors.

Added a bug here detailing this phenomenon, will also add a TODO here in case anyone wants to run this script before it is fixed.
https://khanacademy.atlassian.net/browse/LEMS-3674

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants