Initialization Option Items API

show_distractor_rationale

Displays distractor rationales based on the learner's response.

You would want to use this so that you can display the additional distractor rationale information to the learner.

In "initial" and "resume" state, distractor rationale are displayed when the Check Answer button is clicked, or when the validate() method is called. In "review" state, distractor rationales are displayed immediately.

Examples

// Standard usage for displaying distractor rationale
var initializationOptions = {
    config: {
        questions_api_init_options: {
            show_distractor_rationale: true
        }
    }
    // ...
};

// Customized options for displaying distractor rationale
var initializationOptions = {
    config: {
        questions_api_init_options: {
            show_distractor_rationale: {
                per_question: "always",
                per_response: "never",
            }
        }
    }
    // ...
};

Values

Request object key config.questions_api_init_options.show_distractor_rationale

Default: false

This option can be initialized as one of the following types: boolean object.

  • Type boolean

    Boolean values can be used as shorthand configurations.

    Possible values:
    • true has the same effect as the object configuration set to:
      • "per_question": "incorrect" which will only display Question-level distractor rationale when the response is incorrect, and
      • "per_response": "always" which will display Question-level distractor rationale for any response.
    • false has the same effect as the object configuration set to:
      • "per_question": "never" which will never display Question-level distractor rationale, and
      • "per_response": "never" which will never display response-level distractor rationale.
  • Type object
    An object definition can be provided for finer controls.
    • per_question string

      Determines when Question-level distractor rationale are displayed. Question-level distractor rationale content is defined for each Question in the metadata.distractor_rationale attribute.

      Default: "incorrect"

      Possible values:
      • "correct" will only display Question-level distractor rationale when the response is correct.
      • "incorrect" will only display Question-level distractor rationale when the response is incorrect.
      • "always" will always display Question-level distractor rationale for any response.
      • "never" will never display Question-level distractor rationale.
    • per_response string

      Determines when response-level distractor rationale are displayed. Response-level distractor rationale content is defined for each Question in metadata.distractor_rationale_response_level.

      Note This only applies to Question types that support the metadata.distractor_rationale_response_level property. See Question Types for further information.

      Default: "always"

      Possible values:
      • "always" will always display response-level distractor rationale for every auto-scored or attempted response.
      • "never" will never display response-level distractor rationale.

Related articles

Was this article helpful?