QuestionnaireViewItem

constructor(questionnaireItem: Questionnaire.QuestionnaireItemComponent, questionnaireResponseItem: QuestionnaireResponse.QuestionnaireResponseItemComponent, validationResult: ValidationResult, answersChangedCallback: suspend (Questionnaire.QuestionnaireItemComponent, QuestionnaireResponse.QuestionnaireResponseItemComponent, List<QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent>, Any?) -> Unit, enabledAnswerOptions: List<Questionnaire.QuestionnaireItemAnswerOptionComponent> = questionnaireItem.answerOption.ifEmpty { emptyList() }, minAnswerValue: Type? = questionnaireItem.minValue, maxAnswerValue: Type? = questionnaireItem.maxValue, draftAnswer: Any? = null, enabledDisplayItems: List<Questionnaire.QuestionnaireItemComponent> = emptyList(), questionViewTextConfiguration: QuestionTextConfiguration = QuestionTextConfiguration(), isHelpCardOpen: Boolean = questionnaireItem.isHelpCode, helpCardStateChangedCallback: (Boolean, QuestionnaireResponse.QuestionnaireResponseItemComponent) -> Unit = { _, _ -> })

Parameters

validationResult

the ValidationResult of the answer(s) against the questionnaireItem

answersChangedCallback

the callback to notify the view model that the answers have been changed for the QuestionnaireResponse.QuestionnaireResponseItemComponent

enabledAnswerOptions

the enabled answer options in questionnaireItem

minAnswerValue

the inclusive lower bound on the range of allowed answer values, that may be used for widgets that check for bounds and change behavior based on the min allowed answer value, e.g the Slider widget

maxAnswerValue

the inclusive upper bound on the range of allowed answer values, that may be used for widgets that check for bounds and change behavior based on the max allowed answer value, e.g the Slider widget

draftAnswer

the draft input that cannot be stored in the QuestionnaireResponse.

enabledDisplayItems

the enabled display items in the given questionnaireItem

questionViewTextConfiguration

configuration to show asterisk, required and optional text in the header view.