Reads a survey body and works out how it should be scored — an AI brain reads the questions & answers to detect the structure (subscales, reverse-scored items, sum vs mean-then-scale, mapping, RAG…), then the exact maths is rendered and auto-verified with golden tests. Known PROMs take the instant proven path. Generates all three files: -surv-md.yaml, legacy -surv-js.js, and the unit test. Bulk mode scores many surveys at once.
Turns a survey body into its scoring files. An AI reads the body and decides the scoring structure only; the exact numbers are computed deterministically and golden-tested, so nothing clinical is ever guessed. It always produces the metadata -surv-md.yaml, the legacy -surv-js.js, and a unit test.
When to use it
For the survey-scoring hand-over work — one survey or a whole batch.
How to use it
Pick an AI engine — Puter is free; OpenAI/Anthropic need your own key. (Known PROMs don't need the AI at all.)
Single: choose From repo (pick a -surv slug) or Paste body, then Generate scoring. Review the detected structure, confidence and the three output tabs, then Write all to repo.
Bulk: paste several -surv slugs (or Scan for un-scored surveys), Score all, review the table, then Write all.
Commit and open a merge request; tag Tim.
Good to know
Each result shows how it was scored: family (known PROM, instant), AI (structure inferred), or fallback (safe single-sum). Low confidence or "needs review" = check it by hand.
Author hints in the body (e.g. # scoreAs: oos) are respected and surfaced.
The body's itemSlugs must list surv-common-js + <slug>-js for the JS to run in-app.
Troubleshooting
"AI unavailable — used fallback" — Puter didn't load or the key/quota failed; the deterministic single-sum was used. Re-run, or pick a different engine.
Flagged / low confidence — finish the scoring by hand; the output is a scaffold.
Setup — Chrome or Edge, connect the mr-content folder once (status pill). Everything stays on your computer; only the survey text (no patient data) goes to the chosen AI.
Generated scoring
Write all saves metadata + legacy JS next to the body and the test into _tests/test/ — then commit + open a merge request for Tim. Never push release.