That would certainly work but if you're inheriting from questionView you shouldn't need to do that.
You also shouldn't need to have an onSubmit
function in your code - questionView should handle that.
What you DO need to have is a function called isCorrect
that returns either true
or false
.
You might also want to add a canSubmit
function - assuming you want to prevent the user from submitting until they have selected an answer (not always required e.g. in Slider you can just hit submit without moving the slider)
Finally, if you want your question to have partly correct feedback, you'll want to include an isPartlyCorrect
function.
BTW feel free to ask for further support over in the Framework Gitter chat if you need.
Equally you might want to have a look at adapt-contrib-question - although I notice it hasn't been updated in ages.. :-(