Skip to content

Commit dfb3743

Browse files
committed
feat: change structure of street tutorial to match those of other project types
1 parent 5890915 commit dfb3743

File tree

2 files changed

+74
-134
lines changed

2 files changed

+74
-134
lines changed

mapswipe_workers/mapswipe_workers/project_types/street/tutorial.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def __init__(self, tutorial_draft):
2424

2525
# self.projectId = tutorial_draft["projectId"]
2626
self.projectType = tutorial_draft["projectType"]
27-
self.tutorial_tasks = tutorial_draft["tasks"]
27+
self.tutorial_tasks = tutorial_draft["tutorialTasks"]
2828
self.groups = dict()
2929
self.tasks = dict()
3030

@@ -54,14 +54,14 @@ def create_tutorial_groups(self):
5454
def create_tutorial_tasks(self):
5555
"""Create the tasks dict based on provided examples in geojson file."""
5656
task_list = []
57-
for i, task in enumerate(self.tutorial_tasks):
57+
for i, task in enumerate(self.tutorial_tasks["features"]):
5858
task = StreetTutorialTask(
5959
projectId=self.projectId,
6060
groupId=101,
61-
taskId=f"{task['taskImageId']}",
61+
taskId=f"{task['properties']['id']}",
6262
geometry="",
63-
referenceAnswer=task["referenceAnswer"],
64-
screen=i,
63+
referenceAnswer=task["properties"]["reference"],
64+
screen=task["properties"]["screen"],
6565
)
6666
task_list.append(asdict(task))
6767
if task_list:
Lines changed: 69 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,170 +1,110 @@
11
{
2-
"createdBy": "LtCUyou6CnSSc1H0Q0nDrN97x892",
3-
"tutorialDraftId": "waste_mapping_dar_es_salaam",
4-
"taskImageIds": [
5-
888464808378923,
6-
1552821322020271,
7-
2969692853315413,
8-
1036040467918366,
9-
837497816845037
10-
],
11-
"answers": [
12-
1,
13-
2,
14-
1,
15-
2,
16-
3
17-
],
18-
"customOptions": [
19-
{
20-
"description": "the shape does outline a building in the image",
21-
"icon": "hand-right-outline",
22-
"iconColor": "#00796B",
23-
"subOptions": [
24-
{
25-
"description": "doppelt",
26-
"value": 2
27-
},
28-
{
29-
"description": "dreifach",
30-
"value": 3
31-
}
32-
],
33-
"title": "Jetzt rede ich",
34-
"value": 1
35-
},
36-
{
37-
"description": "the shape doesn't match a building in the image",
38-
"icon": "close-outline",
39-
"iconColor": "#D32F2F",
40-
"title": "No",
41-
"value": 0
42-
}
43-
],
2+
"createdBy": "atCSosZACaN0qhcVjtMO1tq9d1G3",
3+
"tutorialDraftId": "test_tile_classification",
444
"informationPages": [
455
{
466
"blocks": [
477
{
488
"blockNumber": 1,
499
"blockType": "text",
50-
"textDescription": "asdf"
10+
"textDescription": "This is the first information page"
5111
},
5212
{
5313
"blockNumber": 2,
5414
"blockType": "image",
55-
"image": "https://firebasestorage.googleapis.com/v0/b/dev-mapswipe.appspot.com/o/tutorialImages%2F1705402528654-block-image-2-base-query-form.png?alt=media&token=54325ab8-c5e7-45a3-be41-1926a5984a05"
15+
"image": "https://firebasestorage.googleapis.com/v0/b/dev-mapswipe.appspot.com/o/tutorialImages%2F1739963139725-block-image-2-1x1.png?alt=media&token=ae584dcd-d351-4bfe-be5f-1e0d38547f72"
5616
}
5717
],
5818
"pageNumber": 1,
59-
"title": "asdf"
19+
"title": "Information page 1"
6020
}
6121
],
62-
"lookFor": "waste",
63-
"name": "Waste Mapping Dar es Salaam",
22+
"lookFor": "cobblestone",
23+
"name": "cobblestone-tutorial",
6424
"projectType": 7,
6525
"screens": [
6626
null,
6727
{
6828
"hint": {
69-
"description": "Swipe to learn some more.",
70-
"icon": "swipe-left",
71-
"title": "We've marked the correct square green."
29+
"description": "This seems to be a tarmac surface.",
30+
"icon": "check",
31+
"title": "Tarmac"
7232
},
7333
"instructions": {
74-
"description": "Tap once to mark the squares with buildings green.",
75-
"icon": "tap-1",
76-
"title": "There are some buildings in this image"
34+
"description": "Check out if the road surface material is cobblestone here",
35+
"icon": "check",
36+
"title": "Is this cobblestone?"
7737
},
7838
"success": {
79-
"description": "Swipe to the next screen to look for more.",
39+
"description": "Correct, this is not cobblestone",
8040
"icon": "check",
81-
"title": "You found your first areas with buildings!"
41+
"title": "Nice!"
8242
}
8343
},
8444
{
8545
"hint": {
86-
"description": "Swipe to learn some more.",
87-
"icon": "swipe-left",
88-
"title": "We've marked the correct square green."
46+
"description": "That surface does look like cobblestone!",
47+
"icon": "heart-outline",
48+
"title": "Cobblestone"
8949
},
9050
"instructions": {
91-
"description": "Tap once to mark the squares with buildings green.",
92-
"icon": "tap-1",
93-
"title": "There are some buildings in this image"
51+
"description": "Does this look like cobblestone?",
52+
"icon": "egg-outline",
53+
"title": "How about this one?"
9454
},
9555
"success": {
96-
"description": "Swipe to the next screen to look for more.",
97-
"icon": "check",
98-
"title": "You found your first"
99-
}
56+
"description": "Correct",
57+
"icon": "search-outline",
58+
"title": "Correct"
59+
}
60+
}
61+
],
62+
"tileServer": {
63+
"credits": "© 2019 Microsoft Corporation, Earthstar Geographics SIO",
64+
"name": "bing"
65+
},
66+
"tutorialTasks": {
67+
"crs": {
68+
"properties": {
69+
"name": "urn:ogc:def:crs:OGC:1.3:CRS84"
70+
},
71+
"type": "name"
10072
},
101-
{
102-
"hint": {
103-
"description": "Swipe to learn some more.",
104-
"icon": "swipe-left",
105-
"title": "We've marked the correct square green."
106-
},
107-
"instructions": {
108-
"description": "Tap once to mark the squares with buildings green.",
109-
"icon": "tap-1",
110-
"title": "There are some buildings in this image"
111-
},
112-
"success": {
113-
"description": "Swipe to the next screen to look for more.",
114-
"icon": "check",
115-
"title": "You found your first areas with buildings!"
116-
}
117-
},
118-
{
119-
"hint": {
120-
"description": "Swipe to learn some more.",
121-
"icon": "swipe-left",
122-
"title": "We've marked the correct square green."
73+
"features": [
74+
{
75+
"geometry": {
76+
"coordinates": [
77+
13.4514123,
78+
52.5103378,
79+
0
80+
],
81+
"type": "Point"
12382
},
124-
"instructions": {
125-
"description": "Tap once to mark the squares with buildings green.",
126-
"icon": "tap-1",
127-
"title": "There are some buildings in this image"
83+
"properties": {
84+
"id": "1171343450849316",
85+
"reference": 1,
86+
"screen": 1
12887
},
129-
"success": {
130-
"description": "Swipe to the next screen to look for more.",
131-
"icon": "check",
132-
"title": "You found your first areas with buildings!"
133-
}
134-
},
135-
{
136-
"hint": {
137-
"description": "Swipe to learn some more.",
138-
"icon": "swipe-left",
139-
"title": "We've marked the correct square green."
88+
"type": "Feature"
89+
},
90+
{
91+
"geometry": {
92+
"coordinates": [
93+
13.45285,
94+
52.508467,
95+
0
96+
],
97+
"type": "Point"
14098
},
141-
"instructions": {
142-
"description": "Tap once to mark the squares with buildings green.",
143-
"icon": "tap-1",
144-
"title": "There are some buildings in this image"
99+
"properties": {
100+
"id": "378811598610667",
101+
"reference": 0,
102+
"screen": 2
145103
},
146-
"success": {
147-
"description": "Swipe to the next screen to look for more.",
148-
"icon": "check",
149-
"title": "You found your first areas with buildings!"
150-
}
151-
},
152-
{
153-
"hint": {
154-
"description": "Swipe to learn some more.",
155-
"icon": "swipe-left",
156-
"title": "We've marked the correct square green."
157-
},
158-
"instructions": {
159-
"description": "Tap once to mark the squares with buildings green.",
160-
"icon": "tap-1",
161-
"title": "There are some buildings in this image"
162-
},
163-
"success": {
164-
"description": "Swipe to the next screen to look for more.",
165-
"icon": "check",
166-
"title": "You found your first areas with buildings!"
104+
"type": "Feature"
167105
}
168-
}
169-
]
106+
],
107+
"name": "cobblestone-scenario",
108+
"type": "FeatureCollection"
109+
}
170110
}

0 commit comments

Comments
 (0)