Require editable inputs in writable activity sections#294
Merged
elasticsounds merged 5 commits intomainfrom Apr 19, 2026
Merged
Require editable inputs in writable activity sections#294elasticsounds merged 5 commits intomainfrom
elasticsounds merged 5 commits intomainfrom
Conversation
Validate that activity_open_ended_answer, activity_fill_in_the_blank, and activity_fill_in_a_table sections contain at least one <textarea>, writable <input>, or [[blank:item-N]] marker — fail loudly when the LLM emits only static underlines so the renderer retries. Permit the LLM to strip textbook blank placeholders (___ or ...) from label text when it emits a separate editable element, and skip text replacement on data-id elements containing nested editables so they aren't destroyed. Update prompts to add a label-plus-separate-input pattern for form-style labels, require one textarea per response field for open-ended answers, drop the hardcoded Spanish placeholder text, and add a writable-page precedence rule to page sectioning.
- Sectioning: classify labeled ID forms (Nombre/Apellido/Fecha/Lugar) and determinable prompts (unscramble, count syllables/letters) as fill-in-the-blank based on response STRUCTURE, not on whether the answer is gradable. Detect empty boxes as blanks, not just underlines. - Open-ended answer: allow <input type="text"> for short single-line fields so one-line textareas don't push text above the baseline. Add ruled-paper styling scoped to open-ended textareas. Instruct wrapping decorative separators (/, -) in aria-hidden spans. - Validator: treat content inside aria-hidden="true" ancestors as exempt from the data-id requirement, and always strip textbook blank placeholders (___, ...) when the LLM emits a separate editable element so underscores never render beside an input.
d7b488c to
74cbf87
Compare
Prompt now routes single-word missing-letter sources (e.g. "en_ro") to pattern 2 with one marker per underscore, and date/phone split fields to pattern 2b with separators living between inputs instead of inside the label. Validator strips orphan `/` and `-` runs left behind after removing `___` placeholders, and ignores single underscores when comparing inline-letter blanks to their source text. Runtime hydration sizes each blank to the known answer length + 1 (via window.correctAnswers), falling back to a narrow word-internal slot when no answer is available.
The adt-preview route only rebuilt base.bundle.min.js when the file was missing, so edits under assets/adt/modules/** were silently ignored when a stale bundle already existed on disk. Compare the bundle's mtime to the max mtime of base.js + modules/** and rebuild when the sources are newer. Skipped when ADT_RESOURCES_ZIP is set so packaged builds (where esbuild isn't available inside the pkg'd binary) still serve the pre-built bundle as-is.
text-2xl in the inline-letter-blanks example caused long words like _eptiembr_ to wrap inside multi-column grids on desktop while mobile looked fine. Default to text-lg and add explicit guidance to avoid text-2xl+ in multi-column layouts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan