Requiring Authors to Set Correct Answers for Score-able Question Types

You can control if authors are required to set the correct answers for score-able Question types before saving by using the require_validation init option of Author API.  If set to true, authors will get an error message and the section for setting in the correct and alternate answers would be highlighted in the Question Editor API template for authors to set the answers. 

Note: authors are only expected to set the correct answers for score-able Question types when the default auto scoring option is enabled.

Check_Validation_on_Save.png

Figure 1: Requiring authors to set correct answers before saving score-able Question types.

The require_validation init option of Author API will not work with custom Question types.

You can customize the save behaviour of score-able Question types by calling the checkValidation public method of the Question Editor API instance embedded within Author API. The method takes in a showErrors argument to decide if the section to set in correct answers should be highlighted, if authors have not set in a correct answer for score-able Question types. 

Was this article helpful?

Did you arrive here by accident? If so, learn more about Learnosity.