config.widget_templates.require_validation - Initialization - Author API

Author API Initialization


Controls whether an author must add a correct answer to a Question prior to saving.

You would want to use this to require authors to add a correct answer before saving. This eliminates the case where the Questions are authored without answers.

This will only be applicable to Question types that have "Auto scoring" enabled.


// Force authors to add answers for Questions before saving
var initializationOptions = {
    "config": {
        "widget_templates": {
            "require_validation": true


Attribute path config.widget_templates.require_validation

Default false

Type boolean


Note The "Set correct answer(s)" section of the Widget editor must be enabled for this option to take effect. This section may be hidden via the editor's custom global template or base_question_type initialization options.

Was this article helpful?

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