This repository has been archived by the owner on May 11, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make radio subexercises of multiple problems work.
First, radio choices are defined as sibling to the solution element; radio setup() uses that list to make a series of inputs with labels. Multiple setup() copies everything in the solution (usually just a couple of .sol subexercises) to the solution area. The choices list needs to be removed not to appear "repeated" on the problem page. Second, radio precalculates the index of the correct choice in the setup() and passes this as additional info to its createValidator(). However, multiple passes just the respective .sol element to any of its subproblem createValidator() functions. For now, radio-in-multiple falls back to old radio code that does not need the additional info. Some more things to do (deserving a separate branch): * verify that choices are always defined just after the radio and turn .siblings('.choices') in radio setup() into .next('.choices'), so that a multiple can work with more than one radio subproblem; * move the correct-index logic from radio setup() to createValidator(); * update the note on radios under Answer Types / multiple in the wiki.
- Loading branch information