Question Types

This section will describe all question types supported by Datasaur and how to create it via API

Field

Required

Description

Type

Yes

See this page to learn more about what questions are supported Datasaur.

Config

No

See GraphQL Input: QuestionConfigInput for the options

Name

Yes

Column name in Row based labeling

Label

Yes

How the field is displayed to the labeler in the Label Set extension

Required

Yes

Is the question required to be answered by the labeler before proceeding?

Examples of each question type are provided below.

Text Field

{
"type": "TEXT",
"config": {
"multiple": true
},
"name": "Author",
"label": "Author",
"required": true
}

Text Area

{
"type": "TEXT",
"config": {
"multiline": true,
"multiple": true
},
"name": "Quick Review",
"label": "Simple Review",
"required": true
}

Dropdown

{
"type": "DROPDOWN",
"config": {
"multiple": true,
"options": [
{
"id": "1",
"label": "Fiction"
},
{
"id": "2",
"label": "Non fiction"
}
]
},
"name": "Genre",
"label": "Genre",
"required": true
}

Hierarchical Dropdown

{
"type": "HIERARCHICAL_DROPDOWN",
"config": {
"multiple": true,
"options": [
{
"id": "1",
"label": "A"
},
{
"id": "2",
"label": "B",
"parentId": "1"
},
{
"id": "3",
"label": "C"
},
{
"id": "4",
"label": "D",
"parentId": "3"
}
]
},
"name": "Q4",
"label": "Question 4",
"required": false
}

Date

{
"type": "DATE",
"config": {
"format": "DD/MM/YYYY"
},
"name": "Publication Date",
"label": "Publication Date",
"required": true
}

Time

{
"type": "TIME",
"config": {
"format": "HH:mm"
},
"name": "Best Time Reading",
"label": "Best Time to Read",
"required": true
}

Slider

You can set step to adjust the slider increment value.

{
"type": "SLIDER",
"config": {
"min": 1,
"max": 10,
"step": 1
},
"name": "Rate",
"label": "How would you rate this book?",
"required": false
}

Grouped Attributes

You can create questions nested within other questions. This example creates two sub text fields (ex: Age and Sub-genre) inside a question (ex: Type). For now we only limit nested questions to two levels of depth.

{
"type": "NESTED",
"config": {
"multiple": true,
"questions": [
{
"type": "TEXT",
"config": {
"multiline": false
},
"name": "Age",
"label": "Age",
"required": true
},
{
"type": "TEXT",
"config": {
"multiline": false
},
"name": "Sub-genre",
"label": "Sub-genre",
"required": true
}
]
},
"name": "Type",
"label": "Type",
"required": true
}