22from mapswipe_workers .project_types .base .tutorial import BaseTutorial
33from mapswipe_workers .project_types .base .tile_server import BaseTileServer
44from mapswipe_workers .utils import tile_functions as t
5+ from mapswipe_workers .definitions import ProjectType
56
67
78class Tutorial (BaseTutorial ):
@@ -15,7 +16,6 @@ def __init__(self, tutorial_draft):
1516 self .zoomLevel = int (tutorial_draft .get ("zoomLevel" , 18 ))
1617 self .tileServer = vars (BaseTileServer (tutorial_draft ["tileServer" ]))
1718 self .tutorial_tasks = tutorial_draft ["tutorialTasks" ]
18- self .screens = tutorial_draft ["screens" ]
1919 self .groups = dict ()
2020 self .tasks = dict ()
2121
@@ -46,7 +46,7 @@ def create_tutorial_groups(self):
4646 "progress" : 0 , # this is not needed from back end perspective
4747 }
4848
49- if self .projectType in [3 ]:
49+ if self .projectType in [ProjectType . CHANGE_DETECTION . value ]:
5050 # need to adjust xMax and yMax for Change Detection projects
5151 # since they use a different view with only one tile per screen
5252 self .groups [101 ]["xMax" ] = str (100 + (number_of_screens - 1 ))
@@ -111,7 +111,10 @@ def create_tutorial_tasks(self):
111111 }
112112
113113 # Completeness and Change Detection projects use a second tile image url
114- if self .projectType in [3 , 4 ]:
114+ if self .projectType in [
115+ ProjectType .CHANGE_DETECTION .value ,
116+ ProjectType .COMPLETENESS .value ,
117+ ]:
115118 task ["urlB" ] = t .tile_coords_zoom_and_tileserver_to_url (
116119 tile_x , tile_y , self .zoomLevel , self .tileServerB
117120 )
0 commit comments