pdf-quiz-generator/backend/tests
Daniel deb8ee7830
Some checks failed
Tests / backend (push) Failing after 6s
Tests / frontend (push) Failing after 41s
Tests / e2e (push) Failing after 40s
fix: the high-yield view was the longest prose in the article
Measured across the 323 AI drafts in the bank before touching anything.
The prompt describes three readings of a topic and the second of them
was not happening:

  short     326 sections   1 per article   1,808 chars   4 highlighted
  long    2,112 sections   6.5 per article   721 chars
  clinical 1,060 sections                     531 chars

So the revision view — the thing meant to be tight lists of what a
candidate must know — came out as a single section two and a half times
longer than a full one, written as bullets that were paragraphs, and 4
of 326 carried the ==highlight== the reader has a renderer for. "Tight
lists, not prose" and "sparingly" are adjectives, and the model read
them as suggestions.

They are numbers now: 2 to 4 separate sections, each under 600
characters, bullets of at most 20 words, and one to three highlighted
facts per section with an example of what that looks like.

Two drafts written against the live model afterwards:

  Kawasaki disease        3 short sections, 292 chars avg, 3/3 highlighted
  Neonatal hypoglycaemia  3 short sections, 227 chars avg, 3/3 highlighted

and the reader draws nine key-point marks on the first of them.

Also, refining no longer loses a section's variant. The existing draft
went to the model as a flat list of `## Heading`, so it had to guess all
over again which sections were the bedside and which were the revision
view — a refine could quietly move one into the other. The variant
travels in the heading now and the prompt says to keep it.

Left alone deliberately: the 16,000-token ceiling (no truncation
failure in the logs to justify moving it) and temperature 0.4.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TqXevQJhxFrM7jJg82cgZN
2026-09-13 15:19:37 +02:00
..
__init__.py
api-contract.json feat: no account creation here — the provider makes accounts 2026-09-13 14:37:10 +02:00
test_access.py fix: a role is not set here while the provider holds it 2026-09-13 14:04:16 +02:00
test_ai_mode.py fix: drawers that close, sources that are sources, and a model that does not haggle 2026-09-12 23:34:24 +02:00
test_ai_mode_matching.py refactor: remove the LMS 2026-09-12 23:27:51 +02:00
test_ai_practice.py refactor: remove the LMS 2026-09-12 23:27:51 +02:00
test_api_contract.py feat: a versioned API, refresh tokens, and an end-to-end stack that found four bugs 2026-09-13 01:23:38 +02:00
test_article_ai.py fix: the high-yield view was the longest prose in the article 2026-09-13 15:19:37 +02:00
test_article_notes.py feat: question folders, per-section notes, and two feedback paths 2026-09-12 18:37:43 +02:00
test_article_search_index.py feat: three answers, chosen by a number rather than by the model 2026-09-12 16:15:05 +02:00
test_articles_cards.py feat: an article follows a topic, rather than copying it once 2026-09-12 19:57:06 +02:00
test_articles_migration.py
test_bank_cleanup.py refactor: remove the LMS 2026-09-12 23:27:51 +02:00
test_blueprint_plans.py
test_captcha.py feat: Cap replaces hCaptcha, self-hosted beside the app 2026-09-12 06:14:14 +02:00
test_category_grants.py fix: the answer side of a question needs an attempt, or the job of writing it 2026-09-13 00:13:43 +02:00
test_category_migration.py
test_collections.py refactor: remove per-question sharing 2026-09-12 08:42:51 +02:00
test_contact_privacy.py fix: the contact form's messages were readable by anyone 2026-09-12 22:37:28 +02:00
test_draft_questions.py
test_exam_admin.py
test_exam_blueprint.py
test_exam_scoped_tags.py refactor: remove the LMS 2026-09-12 23:27:51 +02:00
test_exams.py refactor: remove the LMS 2026-09-12 23:27:51 +02:00
test_feedback.py feat: question folders, per-section notes, and two feedback paths 2026-09-12 18:37:43 +02:00
test_file_intake.py fix: an upload is what its bytes say, not what its name claims 2026-09-12 19:05:12 +02:00
test_global_search.py refactor: remove per-question sharing 2026-09-12 08:42:51 +02:00
test_hybrid_search.py refactor: remove the LMS 2026-09-12 23:27:51 +02:00
test_media_library.py refactor: remove the LMS 2026-09-12 23:27:51 +02:00
test_multi_category.py refactor: remove the LMS 2026-09-12 23:27:51 +02:00
test_option_explanations.py
test_prepared_session.py feat: a session prepared for you, and a model that can see when the one on the job cannot 2026-09-12 15:46:04 +02:00
test_question_detail_access.py feat: the bank belongs to a role, not to a person 2026-09-13 13:26:25 +02:00
test_question_figures.py fix: a schema promising an owner where the column now says NULL 2026-09-13 14:17:55 +02:00
test_question_folders.py feat: question folders, per-section notes, and two feedback paths 2026-09-12 18:37:43 +02:00
test_question_trash.py
test_question_versions.py refactor: remove the LMS 2026-09-12 23:27:51 +02:00
test_quiz_builder.py refactor: the app is a PWA, so the native wrapper goes 2026-09-13 00:26:35 +02:00
test_quiz_sessions.py refactor: remove the LMS 2026-09-12 23:27:51 +02:00
test_refresh_tokens.py feat: a versioned API, refresh tokens, and an end-to-end stack that found four bugs 2026-09-13 01:23:38 +02:00
test_related_privacy.py feat: the bank belongs to a role, not to a person 2026-09-13 13:26:25 +02:00
test_rerank.py refactor: remove the LMS 2026-09-12 23:27:51 +02:00
test_session_lifecycle.py refactor: remove per-question sharing 2026-09-12 08:42:51 +02:00
test_share_public.py refactor: remove the LMS 2026-09-12 23:27:51 +02:00
test_shared_category.py feat: ground AI drafts in the library and PubMed, and mend the card system 2026-09-13 02:44:42 +02:00
test_sso_hardening.py feat: no account creation here — the provider makes accounts 2026-09-13 14:37:10 +02:00
test_sso_roles.py fix: a role is not set here while the provider holds it 2026-09-13 14:04:16 +02:00
test_study_plan_editing.py
test_study_plan_sessions.py
test_study_tools.py refactor: remove the LMS 2026-09-12 23:27:51 +02:00
test_study_tools_migration.py
test_tag_hierarchy.py refactor: remove the LMS 2026-09-12 23:27:51 +02:00
test_thumbnails.py feat: thumbnails for uploaded images, at two widths and no others 2026-09-12 08:49:20 +02:00
test_tts_voices.py fix: a speech model is added with its voices, and Orpheus is sent where it works 2026-09-13 05:04:37 +02:00
test_vision_fallback.py fix: the answer side of a question needs an attempt, or the job of writing it 2026-09-13 00:13:43 +02:00