← Projects
AFOQT Study Trainer
Practice questions, timed mock sections and flashcards for the Air Force Officer Qualifying Test, in one page with no backend.
- Year
- 2026
- Stack
- JavaScript, HTML and CSS, Anthropic API (optional)
- Built
- With AI coding assistance
What it does
A study tool for the math and verbal parts of the Air Force Officer Qualifying Test. It is unofficial and not affiliated with the Air Force.
- Practice. 117 questions: 57 math across 20 topics, and 60 verbal (synonyms, antonyms and analogies). Every question has a hint, worked steps and an explanation. An optional timer gives 60 to 90 seconds for math and 20 for verbal.
- Mock exam. Four timed sections named after the real subtests: Arithmetic Reasoning (29 minutes), Math Knowledge (22), Word Knowledge (5) and Verbal Analogies (8), with 15 questions each and a score per section.
- Flashcards. 40 vocabulary cards, shuffled, which you mark as known or to review.
- Weak spots. Accuracy by topic for the current session, naming the best topic and the one that needs work.
- Lessons and cheat sheets. Nine short lessons, plus reference sheets for formulas, geometry, algebra rules, word roots and analogy types.
- AI tutor (optional). Explains a concept using the Anthropic API, with a key the visitor supplies.
How it is built
- One HTML file, no build step and no backend. The question bank, lessons and logic ship in a single page. Once it has loaded, everything except the AI tutor works without a network connection. The cost is a 1,700-line file that is harder to maintain than separate modules would be.
- The visitor brings their own API key. The tutor is the only feature that costs money to run, so it uses the visitor’s key rather than one of mine. That keeps my cost at zero and means no key of mine is exposed in the page.
- Scores stay in memory. Nothing is written to the browser’s storage, so there is nothing to clear and nothing left behind on a shared computer. The trade-off is in the limitations below.
Security and data handling
- The API key is held in memory only. It is never written to storage or logged, and it is sent only to Anthropic, straight from the browser. It is gone when the page is closed.
- The tutor’s reply is treated as untrusted. It is escaped before display, and only a short list of plain formatting tags is allowed back in, so a reply cannot inject script into the page.
- The app has no accounts and collects no data.
Known limitations
- It covers four of the test’s twelve subtests.
- Mock sections use the real time limits but only 15 questions each, fewer than the real sections.
- The Verbal Analogies section draws from the whole verbal bank, so it also includes synonym and antonym questions.
- Progress is not saved. Scores and flashcard marks reset when the page is reloaded.
- Flashcards are shuffled, not scheduled; there is no spaced repetition.
- The AI tutor is pinned to a model that Anthropic retired in June 2026, so it fails until the model name is updated.
- Calling the API from the browser means any script on the page could read the key while it is in memory. The page loads its fonts from Google, which I would self-host to close that gap.
What I would change
- Save progress in the browser so weak topics carry over between sessions.
- Draw each mock section from questions of its own type, at full length.
- Update the tutor to a current model and show a clear message when the API returns an error.
- Self-host the fonts and add a content security policy.