Wire up the "Add a second version" button - #9
Closed
dancockrell wants to merge 1 commit into
Closed
Conversation
#btnAddForm existed in the markup, its label updated dynamically by
renderForms() ("+ Add version C", etc.), and its supporting helpers
(nextFormLetter, unusedCode, the remove-version button) were all in
place — but nothing ever attached a click handler to it. Clicking
"+ Add a second version" did nothing.
Wires it the same way btnAddWritten is wired: push a new form (next
letter, next unused code, empty key) into editing.forms and re-render.
Rebuilt QuickGrade.html and sw.js via `python build.py` to keep the
single-file build in sync.
Owner
Author
|
Superseded by merged PR #11. The useful Add a second version behavior was reimplemented there as focused source code with browser coverage. PR #11 passed the fast scanner regression gate, the complete 29-suite browser QA job, and the separate deterministic generated-file verification before merge at 6853573. Closing this conflicting draft so the queue points to the tested implementation now on main. |
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.
#btnAddForm("+ Add a second version") existed in the markup, and its label was updated dynamically byrenderForms()(e.g. "+ Add version C"). All the supporting logic was already built:nextFormLetter(),unusedCode()(a next-unused-3-digit-code generator that was itself completely uncalled), and the "remove version" button for existing forms. But nothing ever attached aclickhandler to#btnAddForm— clicking it did nothing.Wired it the same way the neighboring
#btnAddWrittenbutton is wired: push a new form ({id: nextFormLetter(), code: unusedCode(), key: [], rules: {}}) intoediting.formsand callrenderForms().Ran
python build.pyafterward to regenerateQuickGrade.htmlandsw.js(cache-bust hash) so the single-file build stays in sync withjs/app.js, per the repo's own workflow in the README.Verified
node -c js/app.jspasses and the build completes cleanly. I did not havetools/'s Playwright deps installed in this environment to run the e2e suite (tools/test-forms.jsexercises the forms feature only through theQG.DB/QG.ScoringAPI directly, not the button, so it wouldn't have caught this).Generated by Claude Code