Share-link generation and med math on request
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 34s

- Visitors of class and exam links can generate NCLEX-style quizzes (default
  and maximum 50 questions, 25% select-all, Python-checked, optional 5 med
  math questions) and flashcard sets from chosen class materials, once the
  owner turns it on for the link.
- 4 quizzes and 2 flashcard sets per link per day; failed attempts do not
  count; "Reset limits" in the share dialog gives a fresh allowance.
- Sets are drafts tied to the link (migration 7): listed for every visitor,
  explainable, kept off the owner's drafts list, and reviewable or savable
  from the share dialog.
- Generate gains "Include med math" with a count (default 5): exactly that
  many dosage calculation questions at the chosen difficulty, spread through
  the quiz, even when the material has none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Elijah 2026-11-15 22:04:08 -07:00
parent 25bc03ea75
commit e945f589ce
16 changed files with 807 additions and 44 deletions

View file

@ -190,6 +190,16 @@ calculations, safety points, a self-check after teaching), so blocks appear with
for. Explain uses a reduced library without Question and Flashcards and is told to give
information only (`genUiPrompt('explain')`). Library telemetry is off (`OPENUI_TELEMETRY_DISABLED=1`, `DO_NOT_TRACK=1`).
## Medication math on request
Generate → "Include med math" with a count (default 5) asks for exactly that many dosage
calculation questions (`mathQuestions`), written at the chosen difficulty even when the
material has no calculations: easy is single-step doses and conversions, medium weight-based
doses and pump rates, hard drip rates, titrations and heparin protocols. They are written in
their own batches without the excerpts, then spread evenly through the quiz; the other batches
write no calculations. Without the option, calculations still appear only when the material
involves them. The Python check is told the exact number requested.
## AI on share links
Each share link has two switches, both off by default:
@ -210,6 +220,20 @@ allowance: each browser gets a random visitor id in a signed, HTTP-only cookie
forged cookie is replaced with a new id. Because clearing cookies gives a fresh allowance, each
link also has a cap of 500 requests per hour across all visitors.
### Generating on share links
Class and exam links have a third visitor switch, **Generate quizzes and flashcards** (off by
default). Visitors choose only the kind, how many (quizzes default to 50, at most 50: one exam;
flashcards default to 30), the difficulty, which of the link's class materials to use and,
for quizzes, "Include med math" (5 calculation questions). Quizzes are NCLEX style with 25%
select-all and the Python check. A link may make 4 quizzes and 2 flashcard sets a day (local
midnight, failed attempts not counted), on top of the per-device request limit; **Reset
limits** in the share dialog starts a fresh allowance. Sets are drafts tied to the link
(`drafts.share_id`, migration 7): every visitor of the link sees them under "Make your own
practice", they can be explained like shared questions, and they stay off the owner's drafts
list. The share dialog lists them; opening one lets the owner review it, save it to the
library or discard it from the link. Deleting the link deletes them.
## Original documents
A document's page offers Extracted text, Side by side and Original. PDFs and images show the