Skip to main content

TextOnlyResponse

Defined in: parser/types.ts:1247

The TextOnlyResponse interface is used to define the properties of a text only response. TextOnlyResponses render as a block of text that is displayed to the user. This can be used to display instructions or other information. It does not accept any input from the user.

{
"id": "textOnlyResponse",
"type": "textOnly",
"prompt": "This is a text only response, it accepts markdown so you can **bold** or _italicize_ text.",
"location": "belowStimulus",
"restartEnumeration": true
}

In this example, the text only response is displayed below the stimulus and the enumeration of the questions is restarted.

Extends​

  • Omit<BaseResponse, "secondaryText" | "required" | "requiredValue" | "requiredLabel" | "paramCapture" | "hidden" | "withDontKnow">

Properties​

PropertyTypeDescriptionOverridesInherited fromDefined in
delay?numberDelay in milliseconds before an element activates. Must be non-negative; defaults to 0 meaning the element is always active. Minimum 0-BaseResponse.delayparser/types.ts:520
excludeFromRandomization?booleanExclude response from randomization. If present, will override the responseOrder randomization setting in the components. Defaults to false.-BaseResponse.excludeFromRandomizationparser/types.ts:516
hidden?undefined---parser/types.ts:1259
idstringThe id of the response. This is used to identify the response in the data file.-BaseResponse.idparser/types.ts:486
infoText?stringThe description that is displayed when the participant hovers over the response. This does not accept markdown.-BaseResponse.infoTextparser/types.ts:494
location?ConfigResponseBlockLocationControls the response location. These might be the same for all responses, or differ across responses. Defaults to belowStimulus-BaseResponse.locationparser/types.ts:498
onSubmit?GlobalStoreAction[]Apply these actions to the final submitted answer, in declared order.-BaseResponse.onSubmitparser/types.ts:484
paramCapture?undefined---parser/types.ts:1258
path?stringPath under src/public/ to response code. Custom responses require a default React component. Any response code module may export validate(value, values, response) to return an error message, a boolean validity result, or null for valid input. It may separately export score(value, values, response, expected?) to return a boolean or a score from 0 to 1; null uses ordinary correct-answer matching. expected is the configured correct answer when correctness is checked.-BaseResponse.pathparser/types.ts:488
promptstringThe markdown text that is displayed to the user.BaseResponse.prompt-parser/types.ts:1250
required?undefined---parser/types.ts:1255
requiredLabel?undefined---parser/types.ts:1257
requiredValue?undefined---parser/types.ts:1256
restartEnumeration?booleanWhether to restart the enumeration of the questions. Defaults to false.--parser/types.ts:1252
secondaryText?undefined---parser/types.ts:1254
style?StylesYou can set styles here, using React CSSProperties, for example: {"width": 100} or {"width": "50%"}-BaseResponse.styleparser/types.ts:514
stylesheetPath?stringThe path to the external stylesheet file.-BaseResponse.stylesheetPathparser/types.ts:512
type"textOnly"---parser/types.ts:1248
visibleIf?ResponseVisibilityConditionShow this response only when another response in this component satisfies the condition.-BaseResponse.visibleIfparser/types.ts:518
withDivider?booleanRenders the response with a trailing divider. If present, will override the divider setting in the components or uiConfig.-BaseResponse.withDividerparser/types.ts:508
withDontKnow?undefined---parser/types.ts:1260