Interface QuestionRenderInstructions<Custom>

interface QuestionRenderInstructions<Custom> {
    choices: ChoiceRenderInstructions<Custom>[];
    currentAnswer: any;
    custom: Custom;
    disabled: boolean;
    error: any;
    id: string;
    type: QuestionType;
    validatedAnswer: any;
    validating: boolean;
}

Type Parameters

  • Custom = any

Hierarchy

  • ItemRenderInstructions<Custom>
    • QuestionRenderInstructions

Properties

Choices for questions with choice or choices as [[type]].

currentAnswer: any

Current answer of the question. The answer is unvalidated.

For questions with any as [[type]], it should be the input value.

For questions with choice as [[type]], it should be the value of the selected choice.

For questions with choices as [[type]], it should be a list of values of the selected choices.

custom: Custom

Any values that help you determine how to render the frontend UI.

disabled: boolean

Whether or not this item is disabled.

error: any

Error thrown by validator.

id: string

Item id.

Question type.

For questions with any as type, set the HTML component value using [[currentAnswer]] and use form's [[setAnswer]] method to handle onChange event.

For questions with choice as type, set the HTML component value using [[currentAnswer]] and use form's [[setChoice]] or [[selectChoice]] method to handle onChange event. Usually radio button group or dropdown select will be used for this type of questions.

For questions with choices as type, set the HTML component value using [[currentAnswer]] and use form's [[setChoices]] or [[selectChoice]] method to handle onChange event. Usually checkbox group or select with multiple mode turned on will be used for this type of questions.

validatedAnswer: any

Validated answer of the question.

For questions with any as [[type]], it should be the input value.

For questions with choice as [[type]], it should be the value of the selected choice.

For questions with choices as [[type]], it should be a list of values of the selected choices.

If the question is disabled or the answer is not valid, the answer will be set to undefined.

validating: boolean

Whether or not the question is currently being validated.

This value can be true if the validator used is an aysnc function.