-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema-2.0.0.json
More file actions
258 lines (258 loc) · 6.48 KB
/
schema-2.0.0.json
File metadata and controls
258 lines (258 loc) · 6.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Long Form Quests Schema for GoInfoGame",
"version": "2.0.0",
"type": "object",
"properties": {
"version": {
"description": "Version of the long form JSON data. If not present defaults to 1.0.0.",
"default": "1.0.0",
"type": "string",
"pattern": "^\\d+\\.\\d+\\.\\d+$",
"examples": [
"1.0.0",
"2.1.3"
]
},
"elements": {
"type": "array",
"items": {
"$ref": "#/definitions/Element"
}
}
},
"required": [
"version",
"elements"
],
"definitions": {
"Element": {
"type": "object",
"description": "Element type. The base element that describes the type of element and the quests that are associated with it.",
"properties": {
"element_type": {
"description": "Type of element that the quests are associated with.",
"type": "string",
"examples": [
"Sidewalks",
"Kerb",
"Crossings"
]
},
"quest_query": {
"description": "Query to get the quests for the element type.",
"type": "string",
"examples": [
"ways with (highway=footway and footway=crossing)",
"ways with (highway=footway and footway=sidewalk)",
"nodes with barrier=kerb"
]
},
"element_type_icon": {
"description": "Icon to be displayed for the element type. The icon name should be a string (not a URL) of the selected image fron the given website. The icon will be fetched from the GoInfoGame icon set that is locally available.",
"type": "string",
"examples": [
"access_point",
"baby",
"barrier_on_road"
]
},
"quests": {
"description": "List of quests for the element type.",
"type": "array",
"items": {
"$ref": "#/definitions/Question"
}
}
},
"required": [
"element_type",
"quest_query",
"quests",
"element_type_icon"
]
},
"AnswerChoice": {
"type": "object",
"description": "Answer choice for a single quest. There can be multiple answer choices",
"properties": {
"value": {
"description": "Value of the answer choice",
"type": "string",
"examples": [
"yes",
"no",
"unknown"
]
},
"choice_text": {
"description": "Text to display for the answer choice",
"type": "string",
"examples": [
"Yes",
"No",
"Unknown"
]
},
"image_url": {
"description": "URL of the image to display for the answer choice. If the image is not available or if there is an error in loading the image, it will not be displayed.",
"type": "string",
"examples": [
"https://example.com/image.jpg"
]
},
"choice_follow_up": {
"description": "Used to define whether the user has to take a picture or not. If not provided, there will be no picture taken. If provided, this text will be shown to the user in the image taking screen.",
"type": "string",
"examples": [
"Is the sidewalk on the left side of the road?",
"Is the sidewalk on the right side of the road?"
]
}
},
"required": [
"value",
"choice_text"
]
},
"Question": {
"type": "object",
"description": "Question for a single quest. There can be multiple questions for an element.",
"properties": {
"quest_id": {
"description": "Unique identifier for the question",
"type": "number",
"examples": [
1,
2,
3
]
},
"quest_title": {
"description": "Title of the question",
"type": "string",
"examples": [
"Is the sidewalk on the left side of the road?",
"Is the sidewalk on the right side of the road?"
]
},
"quest_description": {
"description": "Description of the question",
"type": "string",
"examples": [
"Please select the option that best describes the sidewalk on the left side of the road.",
"Please select the option that best describes the sidewalk on the right side of the road."
]
},
"quest_image_url": {
"description": "URL of the image to display for the question. If the image is not available or if there is an error in loading the image, it will not be displayed.",
"type": "string",
"examples": [
"https://example.com/image.jpg"
]
},
"quest_type": {
"description": "Type of the question. Only two types supported at the moment. ExclusiveChoice for single choice questions and Numeric for numeric input questions.",
"type": "string",
"examples": [
"ExclusiveChoice",
"Numeric"
],
"enum": [
"ExclusiveChoice",
"Numeric"
]
},
"quest_tag": {
"description": "Tag to be added to the quest. This tag is sent as payload when the user answers the question.",
"type": "string",
"examples": [
"driveways",
"surface",
"crossing:markings"
]
},
"quest_answer_choices": {
"description": "Answer choices for the question. Only applicable for ExclusiveChoice type questions.",
"type": "array",
"items": {
"$ref": "#/definitions/AnswerChoice"
}
},
"quest_answer_validation": {
"description": "Validation for the answer. Only applicable for Numeric type questions.",
"type": "object",
"properties": {
"min": {
"description": "Minimum value for the answer",
"type": "number",
"examples": [
0,
1,
2
]
},
"max": {
"description": "Maximum value for the answer",
"type": "number",
"examples": [
0,
1,
2
]
}
}
},
"quest_answer_dependency": {
"description": "",
"type": "object",
"properties": {
"question_id": {
"description": "The Quest ID of the question that this questions visibility is dependent on.",
"type": "number",
"examples": [
1,
2,
3
]
},
"required_value": {
"description": "The value of the dependent question that will make this question visible.",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"examples": [
"yes",
"0",
[
"1",
"2"
],
[
"yes",
"no"
]
]
}
}
}
},
"required": [
"quest_id",
"quest_title",
"quest_description",
"quest_type",
"quest_tag",
"quest_answer_choices"
]
}
}
}