Skip to content

Alternativtext für Bilder an Antwortoptionen (#342) - #344

Merged
rrolf merged 9 commits into
mainfrom
feature/option-image-alt
Nov 19, 2026
Merged

rrolf merged 9 commits into
mainfrom
feature/option-image-alt

Conversation

@rrolf

@rrolf rrolf commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Closes #342

Answer-option images get a bilingual alt text („Bildbeschreibung“) that is edited in the image dialog and rendered everywhere; image-only answers become properly named for screen readers.

What's in it

  • Data: AnswerOption.image_alt (modeltranslation _de/_en, ≤300), exposed as {de,en} map in REST, SSE/presenter, results (choice, priorities, ordering). Migration 0067.
  • Rendering rule (participant page, beamer, results, editor previews, import review): option with text → image is decorative (alt=""), text is read once; image-only option → alt is the image's text and the choice's accessible name; without alt → „Antwort N“ / "Answer N" (priority bars, which are score-sorted, use text or alt only).
  • Editor: option-image upload opens „Bild einfügen“ with alt (active tab language), credit fields and „Vorschlag erstellen“ (AI, only with AI_VISION, only on click); pencil „Bild bearbeiten“ reopens it; non-blocking hint „Bildbeschreibung fehlt“ for image-only options without a canonical-language alt (opens the dialog). Option-row buttons carry the answer number in their accessible names.
  • Carry-over: duplicate/copy, JSON export/import (optional field, old files valid, imported alt normalized), question import (H5P/ILIAS answer-image alt, normalized: decoded once, tags stripped, whitespace collapsed, capped), CSV export falls back to the alt for image-only options.
  • Docs: guide DE/EN, CHANGELOG.

Verification (isolated stack)

  • Backend: 2241 tests OK; ruff clean; makemigrations --check clean
  • Frontend: tsc -b, npm run build OK
  • e2e firefox: option-image-alt 7/7, image-dialog 14/14, image-credits + import-questions green (image-dialog has a Keycloak-login flake under load; green when run alone)
  • mkdocs strict DE + EN OK
  • Per-task reviews, whole-branch review + re-review of its fix wave

Deferred

  • LibreTranslate pre-fill for the option-image alt (edit per language in the dialog instead)

🤖 Generated with Claude Code

rrolf and others added 9 commits November 19, 2026 22:23
…sfer)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ollapse, cap)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng-alt hint

The option image dialog now asks for the image description (in the
language of the option's active tab, max. 300 characters) next to the
credit, with the AI "Suggest" when AI vision is on. An "Edit image"
button reopens it for an existing image; replacing or removing an image
clears its description. An image-only option without a description in
the canonical content language shows a non-blocking "Image description
missing" hint that opens the dialog in that language.

Presenter option list and result bars (live and walkthrough) follow the
rendering rule: img alt="" when the option has text, the resolved
image_alt for image-only options.

Refs #342

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#342)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eview panel (#342)

Numbered fallback (Answer N), resolved alt on results/ordering/priorities,
position in editor image button names, AI review img alt rule; e2e.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rrolf
rrolf merged commit 25a2957 into main Nov 19, 2026
6 checks passed
@rrolf
rrolf deleted the feature/option-image-alt branch November 19, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alternativtext für Bilder an Antwortoptionen

1 participant