Skip to main content
Version: v2.0.0-rc3

VegaComponentConfig

The BaseIndividualComponent interface is used to define the required fields for all components.

All components must include the response field, which is an array of Response interfaces. There are additional optional fields that can be included in a component that help layout the task. These include the nextButtonText, nextButtonLocation, instructionLocation, correctAnswer. There are other fields that can be included in a component that are used to identify the task in the admin panel. These include the meta, description, instruction, and title fields.

Extends

Properties

PropertyTypeDescriptionInherited from
allowFailedTraining?booleanControls whether the component should allow failed training. If not provided, the default is true.BaseIndividualComponent.allowFailedTraining
configobjectThe vega or vega-lite configuration.-
correctAnswer?Answer[]The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.BaseIndividualComponent.correctAnswer
description?stringThe description of the component. This is used to identify and provide additional information for the component in the admin panel.BaseIndividualComponent.description
instruction?stringThe instruction of the component. This is used to identify and provide additional information for the component in the admin panel.BaseIndividualComponent.instruction
instructionLocation?"sidebar" | "aboveStimulus" | "belowStimulus"The location of the instructions.BaseIndividualComponent.instructionLocation
meta?Record<string, unknown>The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.BaseIndividualComponent.meta
nextButtonDisableTime?numberA timeout (in ms) after which the next button will be disabled.BaseIndividualComponent.nextButtonDisableTime
nextButtonEnableTime?numberA timer (in ms) after which the next button will be enabled.BaseIndividualComponent.nextButtonEnableTime
nextButtonLocation?"sidebar" | "aboveStimulus" | "belowStimulus"The location of the next button.BaseIndividualComponent.nextButtonLocation
nextButtonText?stringThe text that is displayed on the next button.BaseIndividualComponent.nextButtonText
provideFeedback?booleanControls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.BaseIndividualComponent.provideFeedback
recordAudio?booleanWhether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.BaseIndividualComponent.recordAudio
responseResponse[]The responses to the componentBaseIndividualComponent.response
trainingAttempts?numberThe number of training attempts allowed for the component. The next button will be disabled until either the correct answer is given or the number of attempts is reached. When the number of attempts is reached, if the answer is incorrect still, the correct value will be shown to the participant. The default value is 2. Providing a value of -1 will allow infinite attempts and the participant must enter the correct answer to continue, and reVISit will not show the correct answer to the user.BaseIndividualComponent.trainingAttempts
type"vega"--