Disable "Check" until any answer is selected
I would like to simplify the MultipleChoice question buttons. Currently, I have only "Check" button visible by hiding the other two in "Behavioral settings" and it should stay this way. However, if the user clicks "Check" without choosing any answer first, the button disappears and the user is stuck. (despite of the "Require user input before the solution can be viewed" setting)
Is there any method to disable the "Check" button when there is no answer selected? (maybe in javascript?)
[Edit]
I figured it out.
Method 1: hack into multichoice.js and wrap the "Check" button click handler with a condition: if (self.getAnswerGiven()) {...}
Method 2: Write a custom script. Listen to "domChanged" event and in it add a custom "click" handler to "Check" button. In this handler, conditionally (see above) trigger the "Retry" button "click" event (works even if the "Retry" is hidden). This solution lacks flexibility, but fortunately, the "Retry" button does what's needed, i.e. enables input and shows "Check" button.
falcon
Tue, 06/16/2015 - 11:47
Permalink
Great work! We would be happy
Great work! We would be happy to add this to multichoice if you provide a pull request on github