Default

Function: default()

[object Object]

Defined in: app/components/Activity/Edit/EditQuestionTile.tsx:36

A specialized form tile for creating or editing an activity specification question.

Features:

  • Bilingual Support: Provides inputs for both Dutch and English versions of the question.
  • Dynamic Type Selection: Supports various data types (String, Boolean, Number, etc.) via a dropdown.
  • Conditional Rendering: Displays an additional input field for options if the question type is set to 'MultipleChoice'.
  • Semicolon Parsing: Automatically splits and trims string input into an array of options for multiple-choice questions.
  • Interactive Deletion: Displays a floating "remove" button when the tile is hovered.

Parameters

props

The component props.

onRemove

() => void

Callback to remove this question from the parent state.

onUpdate

(field, value) => void

Callback to update a specific property of the question.

question

Partial<GetSpecificationQuestionResponseDto>

The current state of the question being edited.

Returns

[object Object]

Component

Example

<EditQuestionTile
question={myQuestion}
onRemove={() => handleRemove(index)}
onUpdate={(field, value) => handleUpdate(index, field, value)}
/>

On this page