@refinio/one.ui
    Preparing search index...

    An item representing the current question and other data like the current answer ...

    type QuestionnaireResponseBuilderItem = {
        changeAnswer: (data: QuestionnaireValue[]) => void;
        completeAnswer: () => void;
        enabled: boolean;
        level: number;
        nextEnabledItem: () => string | undefined;
        path: string;
        question: Question;
        stack: string[];
        subItems?: IterableIterator<QuestionnaireResponseBuilderItem>;
        validationFailed: boolean;
        value: QuestionnaireValue[];
    }
    Index

    Properties

    changeAnswer: (data: QuestionnaireValue[]) => void

    Sets a new answer for the question. This will emit the onAnswerChange event. This is still considered an incomplete answer,

    completeAnswer

    completeAnswer: () => void

    Tag an answer as complete. This will emit the onAnswerComplete event. Useful for saving the current Questionnaire state

    enabled: boolean

    Enabled state of question

    level: number

    The level number for nested questions. 0 = root level

    nextEnabledItem: () => string | undefined

    Get the linkId of the next question that is enabled.

    Note: This function only returns the correct result after the iteration encountered the next enabled question. That is the reason why this is a function - so that the values can be updated of past elements while the iteration is still continuing.

    Type declaration

      • (): string | undefined
      • Returns string | undefined

        If there is no next item, undefined is returned.

    path: string

    The whole path including the questionnaire url

    Example: 'http://refinio.one/questionnaire1/group1/question1'

    question: Question

    The current question

    stack: string[]

    Stack of level names, level 0 is the url of the questionnaire

    Example: ['http://refinio.one/questionnaire1', 'group1', 'question1']

    subItems?: IterableIterator<QuestionnaireResponseBuilderItem>

    Iterator for iterating sub items

    validationFailed: boolean

    Set to true if the validation of the answer failed.

    value: QuestionnaireValue[]

    The current value.

    This will even be set if the questionnaire is disabled, but it won't be saved when the final response is compiled.