validate - Methods - Questions API

Questions API Methods

validate()

Validate the current response for the question instance.

Arguments

  • options object

    • showCorrectAnswers boolean

      When true, correct answers will be displayed with the validation UI.

      Default: false

    • showDistractorRationale boolean DistractorRationaleOptions

      Determines whether distractor rationale are displayed with the validation UI.

      When omitted, the show_distractor_rationale configuration from the Initialization object will be used in its place.

    • feedbackAttempts boolean

      When true, this will increment feedbackAttemptCount or do nothing if the feedbackAttemptCount limit has already been reached.

      Default: false

  • callback function

    Callback that can be used for asynchronous Question types. Optional.

Return value

None (undefined).

Type definitions

  • DistractorRationaleOptions object

    • perQuestion string

      Determines whether question-level distractor rationale are displayed. Question-level distractor rationale content is defined for each question in metadata.distractor_rationale.

      Default: "incorrect"

      Possible values

      • "always" will display question-level distractor rationale for any response.
      • "never" will never display question-level distractor rationale.
      • "correct" will only display question-level distractor rationale if the response is correct.
      • "incorrect" will only display question-level distractor rationale if the response is incorrect.
    • perResponse string

      Determines whether 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 futher information.

      Default: "always"

      Possible values

      • "always" will display distractor rationale for every checked response or non-empty response container.
      • "never" will never display response-level distractor rationale.
Was this article helpful?

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