rapid-router 5.4.1__py2.py3-none-any.whl → 7.6.8__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. example_project/rapid_router_test_settings.py +164 -0
  2. example_project/settings.py +152 -0
  3. example_project/urls.py +15 -0
  4. example_project/{example_project/wsgi.py → wsgi.py} +2 -1
  5. game/__init__.py +1 -1
  6. game/admin.py +43 -4
  7. game/app_settings.py +3 -7
  8. game/character.py +26 -18
  9. game/decor.py +172 -97
  10. game/end_to_end_tests/base_game_test.py +44 -33
  11. game/end_to_end_tests/editor_page.py +17 -2
  12. game/end_to_end_tests/game_page.py +127 -45
  13. game/end_to_end_tests/selenium_test_case.py +1 -20
  14. game/end_to_end_tests/test_cow_crashes.py +3 -5
  15. game/end_to_end_tests/test_language_dropdown.py +14 -0
  16. game/end_to_end_tests/test_level_editor.py +290 -0
  17. game/end_to_end_tests/test_level_failures.py +1 -1
  18. game/end_to_end_tests/test_level_selection.py +79 -0
  19. game/end_to_end_tests/test_play_through.py +240 -102
  20. game/end_to_end_tests/test_python_levels.py +44 -13
  21. game/end_to_end_tests/test_saving_workspace.py +22 -0
  22. game/forms.py +9 -2
  23. game/level_management.py +38 -29
  24. game/messages.py +1218 -203
  25. game/migrations/0001_squashed_0025_levels_ordering_pt1.py +19 -1
  26. game/migrations/0026_levels_pt2.py +13 -2
  27. game/migrations/0032_cannot_turn_left_level.py +13 -2
  28. game/migrations/0033_recursion_level.py +13 -2
  29. game/migrations/0034_joes_level.py +13 -2
  30. game/migrations/0035_disable_route_score_level_70.py +0 -2
  31. game/migrations/0036_level_score_73.py +0 -2
  32. game/migrations/0037_level_score_79.py +0 -2
  33. game/migrations/0038_level_score_40.py +0 -1
  34. game/migrations/0042_level_score_73.py +0 -2
  35. game/migrations/0048_add_cow_field_and_blocks.py +0 -2
  36. game/migrations/0049_level_score_34.py +0 -2
  37. game/migrations/0050_level_score_40.py +0 -2
  38. game/migrations/0051_level_score_49.py +0 -1
  39. game/migrations/0076_level_locked_for_class.py +19 -0
  40. game/migrations/0077_alter_level_next_level.py +52 -0
  41. game/migrations/0078_add_block_types.py +23 -0
  42. game/migrations/0079_populate_block_type_add_cow_blocks.py +60 -0
  43. game/migrations/0080_level_disable_algorithm_score.py +18 -0
  44. game/migrations/0081_first_12_levels_no_algo_score.py +29 -0
  45. game/migrations/0082_level_43_solution.py +16 -0
  46. game/migrations/0083_add_cows_to_existing_levels.py +195 -0
  47. game/migrations/0084_alter_block_block_type.py +18 -0
  48. game/migrations/0085_add_new_blocks.py +53 -0
  49. game/migrations/0086_loop_levels.py +482 -0
  50. game/migrations/0087_workspace_python_view_enabled.py +18 -0
  51. game/migrations/0088_rename_episodes.py +35 -0
  52. game/migrations/0089_episodes_in_development.py +30 -0
  53. game/migrations/0090_add_missing_model_solutions.py +144 -0
  54. game/migrations/0091_disable_algo_score_if_no_model_solution.py +46 -0
  55. game/migrations/0092_disable_algo_score_in_custom_levels.py +28 -0
  56. game/migrations/0093_alter_level_character_name.py +18 -0
  57. game/migrations/0094_add_hint_lesson_subtitle_to_levels.py +28 -0
  58. game/migrations/0095_level_commands.py +18 -0
  59. game/migrations/0096_alter_level_commands.py +18 -0
  60. game/migrations/0097_add_python_den_levels.py +1515 -0
  61. game/migrations/0098_add_episode_link_fields.py +44 -0
  62. game/migrations/0099_python_episodes_links.py +103 -0
  63. game/migrations/0100_reorder_python_levels.py +179 -0
  64. game/migrations/0101_rename_episodes.py +45 -0
  65. game/migrations/0102_reoder_episodes_13_14.py +136 -0
  66. game/migrations/0103_level_1015_solution.py +26 -0
  67. game/migrations/0104_remove_level_direct_drive.py +17 -0
  68. game/migrations/0105_delete_invalid_attempts.py +18 -0
  69. game/migrations/0106_fields_to_snake_case.py +48 -0
  70. game/migrations/0107_rename_worksheet_link_episode_student_worksheet_link.py +18 -0
  71. game/migrations/0108_episode_indy_worksheet_link.py +18 -0
  72. game/migrations/0109_create_episodes_23_and_24.py +99 -0
  73. game/migrations/0110_remove_episode_indy_worksheet_link_and_more.py +100 -0
  74. game/migrations/0111_create_worksheets.py +149 -0
  75. game/migrations/0112_worksheet_locked_classes.py +21 -0
  76. game/migrations/0113_level_needs_approval.py +18 -0
  77. game/migrations/0114_default_and_non_student_levels_no_approval.py +31 -0
  78. game/migrations/0115_level_level__default_does_not_need_approval.py +22 -0
  79. game/migrations/0116_update_worksheet_video_links.py +68 -0
  80. game/migrations/0117_update_solutions_to_if_else.py +61 -0
  81. game/models.py +157 -16
  82. game/permissions.py +34 -19
  83. game/python_den_urls.py +26 -0
  84. game/random_road.py +43 -127
  85. game/serializers.py +12 -17
  86. game/static/django_reverse_js/js/reverse.js +171 -0
  87. game/static/game/css/LilitaOne-Regular.ttf +0 -0
  88. game/static/game/css/backgrounds.css +14 -10
  89. game/static/game/css/dataTables.custom.css +4 -2
  90. game/static/game/css/dataTables.jqueryui.css +561 -320
  91. game/static/game/css/editor.css +47 -0
  92. game/static/game/css/game.css +43 -49
  93. game/static/game/css/game_screen.css +116 -53
  94. game/static/game/css/jquery.dataTables.css +455 -251
  95. game/static/game/css/level_editor.css +10 -1
  96. game/static/game/css/level_selection.css +32 -3
  97. game/static/game/css/level_share.css +6 -5
  98. game/static/game/css/skulpt/codemirror.css +1 -0
  99. game/static/game/image/Python_Den_hero_student.png +0 -0
  100. game/static/game/image/Python_levels_page.svg +1954 -0
  101. game/static/game/image/characters/front_view/Electric_van.svg +448 -0
  102. game/static/game/image/characters/top_view/Electric_van.svg +448 -0
  103. game/static/game/image/characters/top_view/Sleigh.svg +436 -0
  104. game/static/game/image/decor/city/solar_panel.svg +1200 -0
  105. game/static/game/image/decor/farm/solar_panel.svg +86 -0
  106. game/static/game/image/decor/grass/solar_panel.svg +86 -0
  107. game/static/game/image/decor/snow/barn.svg +1788 -0
  108. game/static/game/image/decor/snow/cfc.svg +1050 -147
  109. game/static/game/image/decor/snow/crops.svg +7370 -0
  110. game/static/game/image/decor/snow/hospital.svg +1220 -0
  111. game/static/game/image/decor/snow/house1.svg +971 -0
  112. game/static/game/image/decor/snow/house2.svg +1574 -0
  113. game/static/game/image/decor/snow/school.svg +1071 -0
  114. game/static/game/image/decor/snow/shop.svg +3211 -0
  115. game/static/game/image/decor/snow/solar_panel.svg +173 -0
  116. game/static/game/image/electric_van.svg +448 -0
  117. game/static/game/image/icons/add_house.svg +26 -0
  118. game/static/game/image/icons/delete_house.svg +26 -0
  119. game/static/game/image/icons/description.svg +1 -0
  120. game/static/game/image/icons/hint.svg +1 -0
  121. game/static/game/image/icons/if_else.svg +3 -0
  122. game/static/game/image/icons/python.svg +1 -1
  123. game/static/game/image/if_else_example.png +0 -0
  124. game/static/game/image/pigeon.svg +684 -0
  125. game/static/game/image/python_den_header.svg +19 -0
  126. game/static/game/js/animation.js +84 -28
  127. game/static/game/js/blockly/msg/js/bg.js +52 -1
  128. game/static/game/js/blockly/msg/js/ca.js +52 -1
  129. game/static/game/js/blockly/msg/js/en-gb.js +52 -1
  130. game/static/game/js/blockly/msg/js/en.js +52 -1
  131. game/static/game/js/blockly/msg/js/es.js +52 -1
  132. game/static/game/js/blockly/msg/js/fr.js +52 -1
  133. game/static/game/js/blockly/msg/js/hi.js +52 -1
  134. game/static/game/js/blockly/msg/js/it.js +52 -1
  135. game/static/game/js/blockly/msg/js/pl.js +52 -1
  136. game/static/game/js/blockly/msg/js/pt-br.js +52 -1
  137. game/static/game/js/blockly/msg/js/ru.js +52 -1
  138. game/static/game/js/blockly/msg/js/ur.js +52 -1
  139. game/static/game/js/blocklyCompiler.js +550 -392
  140. game/static/game/js/blocklyControl.js +335 -302
  141. game/static/game/js/blocklyCustomBlocks.js +691 -458
  142. game/static/game/js/blocklyCustomisations.js +3 -1
  143. game/static/game/js/button.js +12 -0
  144. game/static/game/js/cow.js +15 -130
  145. game/static/game/js/drawing.js +313 -201
  146. game/static/game/js/editor.js +23 -0
  147. game/static/game/js/game.js +148 -139
  148. game/static/game/js/jquery.dataTables.min.js +3 -159
  149. game/static/game/js/level_editor.js +823 -448
  150. game/static/game/js/level_moderation.js +33 -2
  151. game/static/game/js/level_selection.js +62 -25
  152. game/static/game/js/loadLanguages.js +21 -0
  153. game/static/game/js/map.js +106 -36
  154. game/static/game/js/model.js +55 -107
  155. game/static/game/js/pathFinder.js +73 -72
  156. game/static/game/js/program.js +184 -193
  157. game/static/game/js/pythonControl.js +14 -1
  158. game/static/game/js/scoreboard.js +0 -37
  159. game/static/game/js/scoreboardSharedLevels.js +48 -0
  160. game/static/game/js/sharing.js +22 -10
  161. game/static/game/js/skulpt/codemirror.js +5 -4
  162. game/static/game/js/skulpt/skulpt-stdlib.js +1 -1
  163. game/static/game/js/sound.js +52 -5
  164. game/static/game/js/van.js +0 -7
  165. game/static/game/raphael_image/characters/top_view/Electric_van.svg +448 -0
  166. game/static/game/raphael_image/characters/top_view/Sleigh.svg +436 -0
  167. game/static/game/raphael_image/decor/city/solar_panel.svg +1200 -0
  168. game/static/game/raphael_image/decor/farm/solar_panel.svg +86 -0
  169. game/static/game/raphael_image/decor/grass/solar_panel.svg +86 -0
  170. game/static/game/raphael_image/decor/snow/barn.svg +1788 -0
  171. game/static/game/raphael_image/decor/snow/cfc.svg +1050 -147
  172. game/static/game/raphael_image/decor/snow/crops.svg +7370 -0
  173. game/static/game/raphael_image/decor/snow/hospital.svg +1220 -0
  174. game/static/game/raphael_image/decor/snow/house1.svg +971 -0
  175. game/static/game/raphael_image/decor/snow/house2.svg +1574 -0
  176. game/static/game/raphael_image/decor/snow/school.svg +1071 -0
  177. game/static/game/raphael_image/decor/snow/shop.svg +3211 -0
  178. game/static/game/raphael_image/decor/snow/solar_panel.svg +173 -0
  179. game/static/game/raphael_image/pigeon.svg +685 -0
  180. game/static/game/raphael_image/sleigh_wreckage.svg +430 -0
  181. game/static/game/sass/game.scss +22 -6
  182. game/static/game/sound/clown_horn.mp3 +0 -0
  183. game/static/game/sound/clown_horn.ogg +0 -0
  184. game/static/game/sound/electric_van_starting.mp3 +0 -0
  185. game/static/game/sound/electric_van_starting.ogg +0 -0
  186. game/static/game/sound/pigeon.mp3 +0 -0
  187. game/static/game/sound/pigeon.ogg +0 -0
  188. game/static/game/sound/sleigh_bells.mp3 +0 -0
  189. game/static/game/sound/sleigh_bells.ogg +0 -0
  190. game/static/game/sound/sleigh_crash.mp3 +0 -0
  191. game/static/game/sound/sleigh_crash.ogg +0 -0
  192. game/templates/game/base.html +35 -15
  193. game/templates/game/basenonav.html +23 -17
  194. game/templates/game/game.html +236 -111
  195. game/templates/game/level_editor.html +353 -275
  196. game/templates/game/level_moderation.html +19 -6
  197. game/templates/game/level_selection.html +75 -62
  198. game/templates/game/python_den_level_selection.html +291 -0
  199. game/templates/game/python_den_worksheet.html +101 -0
  200. game/templates/game/scoreboard.html +88 -65
  201. game/tests/test_level_editor.py +210 -35
  202. game/tests/test_level_moderation.py +6 -20
  203. game/tests/test_level_selection.py +332 -11
  204. game/tests/test_python_den_worksheet.py +85 -0
  205. game/tests/test_scoreboard.py +258 -66
  206. game/tests/utils/level.py +43 -3
  207. game/tests/utils/teacher.py +2 -2
  208. game/theme.py +21 -21
  209. game/urls.py +125 -78
  210. game/views/language_code_conversions.py +90 -0
  211. game/views/level.py +201 -63
  212. game/views/level_editor.py +109 -48
  213. game/views/level_moderation.py +29 -6
  214. game/views/level_selection.py +179 -56
  215. game/views/level_solutions.py +600 -106
  216. game/views/scoreboard.py +181 -66
  217. game/views/worksheet.py +25 -0
  218. rapid_router-7.6.8.dist-info/METADATA +174 -0
  219. {rapid_router-5.4.1.dist-info → rapid_router-7.6.8.dist-info}/RECORD +222 -242
  220. {rapid_router-5.4.1.dist-info → rapid_router-7.6.8.dist-info}/WHEEL +1 -1
  221. rapid_router-7.6.8.dist-info/licenses/LICENSE.md +3 -0
  222. example_project/example_project/__init__.py +0 -1
  223. example_project/example_project/settings.py +0 -54
  224. example_project/example_project/urls.py +0 -16
  225. example_project/manage.py +0 -10
  226. game/autoconfig.py +0 -59
  227. game/csp_config.py +0 -23
  228. game/locale/ar_SA/LC_MESSAGES/django.mo +0 -0
  229. game/locale/ar_SA/LC_MESSAGES/django.po +0 -405
  230. game/locale/ar_SA/LC_MESSAGES/djangojs.mo +0 -0
  231. game/locale/ar_SA/LC_MESSAGES/djangojs.po +0 -743
  232. game/locale/bg_BG/LC_MESSAGES/django.mo +0 -0
  233. game/locale/bg_BG/LC_MESSAGES/django.po +0 -405
  234. game/locale/bg_BG/LC_MESSAGES/djangojs.mo +0 -0
  235. game/locale/bg_BG/LC_MESSAGES/djangojs.po +0 -739
  236. game/locale/ca_ES/LC_MESSAGES/django.mo +0 -0
  237. game/locale/ca_ES/LC_MESSAGES/django.po +0 -405
  238. game/locale/ca_ES/LC_MESSAGES/djangojs.mo +0 -0
  239. game/locale/ca_ES/LC_MESSAGES/djangojs.po +0 -740
  240. game/locale/cs_CZ/LC_MESSAGES/django.mo +0 -0
  241. game/locale/cs_CZ/LC_MESSAGES/django.po +0 -405
  242. game/locale/cs_CZ/LC_MESSAGES/djangojs.mo +0 -0
  243. game/locale/cs_CZ/LC_MESSAGES/djangojs.po +0 -741
  244. game/locale/cy_GB/LC_MESSAGES/django.mo +0 -0
  245. game/locale/cy_GB/LC_MESSAGES/django.po +0 -405
  246. game/locale/cy_GB/LC_MESSAGES/djangojs.mo +0 -0
  247. game/locale/cy_GB/LC_MESSAGES/djangojs.po +0 -743
  248. game/locale/de_DE/LC_MESSAGES/django.mo +0 -0
  249. game/locale/de_DE/LC_MESSAGES/django.po +0 -405
  250. game/locale/de_DE/LC_MESSAGES/djangojs.mo +0 -0
  251. game/locale/de_DE/LC_MESSAGES/djangojs.po +0 -739
  252. game/locale/el_GR/LC_MESSAGES/django.mo +0 -0
  253. game/locale/el_GR/LC_MESSAGES/django.po +0 -405
  254. game/locale/el_GR/LC_MESSAGES/djangojs.mo +0 -0
  255. game/locale/el_GR/LC_MESSAGES/djangojs.po +0 -739
  256. game/locale/en_GB/LC_MESSAGES/django.mo +0 -0
  257. game/locale/en_GB/LC_MESSAGES/django.po +0 -405
  258. game/locale/en_GB/LC_MESSAGES/djangojs.mo +0 -0
  259. game/locale/en_GB/LC_MESSAGES/djangojs.po +0 -739
  260. game/locale/es_ES/LC_MESSAGES/django.mo +0 -0
  261. game/locale/es_ES/LC_MESSAGES/django.po +0 -405
  262. game/locale/es_ES/LC_MESSAGES/djangojs.mo +0 -0
  263. game/locale/es_ES/LC_MESSAGES/djangojs.po +0 -739
  264. game/locale/fi_FI/LC_MESSAGES/django.mo +0 -0
  265. game/locale/fi_FI/LC_MESSAGES/django.po +0 -405
  266. game/locale/fi_FI/LC_MESSAGES/djangojs.mo +0 -0
  267. game/locale/fi_FI/LC_MESSAGES/djangojs.po +0 -739
  268. game/locale/fr_FR/LC_MESSAGES/django.mo +0 -0
  269. game/locale/fr_FR/LC_MESSAGES/django.po +0 -405
  270. game/locale/fr_FR/LC_MESSAGES/djangojs.mo +0 -0
  271. game/locale/fr_FR/LC_MESSAGES/djangojs.po +0 -739
  272. game/locale/gu_IN/LC_MESSAGES/django.mo +0 -0
  273. game/locale/gu_IN/LC_MESSAGES/django.po +0 -405
  274. game/locale/gu_IN/LC_MESSAGES/djangojs.mo +0 -0
  275. game/locale/gu_IN/LC_MESSAGES/djangojs.po +0 -739
  276. game/locale/hi_IN/LC_MESSAGES/django.mo +0 -0
  277. game/locale/hi_IN/LC_MESSAGES/django.po +0 -405
  278. game/locale/hi_IN/LC_MESSAGES/djangojs.mo +0 -0
  279. game/locale/hi_IN/LC_MESSAGES/djangojs.po +0 -739
  280. game/locale/id_ID/LC_MESSAGES/django.mo +0 -0
  281. game/locale/id_ID/LC_MESSAGES/django.po +0 -405
  282. game/locale/id_ID/LC_MESSAGES/djangojs.mo +0 -0
  283. game/locale/id_ID/LC_MESSAGES/djangojs.po +0 -738
  284. game/locale/it_IT/LC_MESSAGES/django.mo +0 -0
  285. game/locale/it_IT/LC_MESSAGES/django.po +0 -405
  286. game/locale/it_IT/LC_MESSAGES/djangojs.mo +0 -0
  287. game/locale/it_IT/LC_MESSAGES/djangojs.po +0 -739
  288. game/locale/ja_JP/LC_MESSAGES/django.mo +0 -0
  289. game/locale/ja_JP/LC_MESSAGES/django.po +0 -405
  290. game/locale/ja_JP/LC_MESSAGES/djangojs.mo +0 -0
  291. game/locale/ja_JP/LC_MESSAGES/djangojs.po +0 -738
  292. game/locale/lol_US/LC_MESSAGES/django.mo +0 -0
  293. game/locale/lol_US/LC_MESSAGES/django.po +0 -405
  294. game/locale/lol_US/LC_MESSAGES/djangojs.mo +0 -0
  295. game/locale/lol_US/LC_MESSAGES/djangojs.po +0 -739
  296. game/locale/nb_NO/LC_MESSAGES/django.mo +0 -0
  297. game/locale/nb_NO/LC_MESSAGES/django.po +0 -405
  298. game/locale/nb_NO/LC_MESSAGES/djangojs.mo +0 -0
  299. game/locale/nb_NO/LC_MESSAGES/djangojs.po +0 -739
  300. game/locale/nl_NL/LC_MESSAGES/django.mo +0 -0
  301. game/locale/nl_NL/LC_MESSAGES/django.po +0 -405
  302. game/locale/nl_NL/LC_MESSAGES/djangojs.mo +0 -0
  303. game/locale/nl_NL/LC_MESSAGES/djangojs.po +0 -739
  304. game/locale/pl_PL/LC_MESSAGES/django.mo +0 -0
  305. game/locale/pl_PL/LC_MESSAGES/django.po +0 -405
  306. game/locale/pl_PL/LC_MESSAGES/djangojs.mo +0 -0
  307. game/locale/pl_PL/LC_MESSAGES/djangojs.po +0 -741
  308. game/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
  309. game/locale/pt_BR/LC_MESSAGES/django.po +0 -405
  310. game/locale/pt_BR/LC_MESSAGES/djangojs.mo +0 -0
  311. game/locale/pt_BR/LC_MESSAGES/djangojs.po +0 -739
  312. game/locale/pt_PT/LC_MESSAGES/django.mo +0 -0
  313. game/locale/pt_PT/LC_MESSAGES/django.po +0 -405
  314. game/locale/pt_PT/LC_MESSAGES/djangojs.mo +0 -0
  315. game/locale/pt_PT/LC_MESSAGES/djangojs.po +0 -739
  316. game/locale/ro_RO/LC_MESSAGES/django.mo +0 -0
  317. game/locale/ro_RO/LC_MESSAGES/django.po +0 -405
  318. game/locale/ro_RO/LC_MESSAGES/djangojs.mo +0 -0
  319. game/locale/ro_RO/LC_MESSAGES/djangojs.po +0 -740
  320. game/locale/ru_RU/LC_MESSAGES/django.mo +0 -0
  321. game/locale/ru_RU/LC_MESSAGES/django.po +0 -405
  322. game/locale/ru_RU/LC_MESSAGES/djangojs.mo +0 -0
  323. game/locale/ru_RU/LC_MESSAGES/djangojs.po +0 -741
  324. game/locale/sv_SE/LC_MESSAGES/django.mo +0 -0
  325. game/locale/sv_SE/LC_MESSAGES/django.po +0 -405
  326. game/locale/sv_SE/LC_MESSAGES/djangojs.mo +0 -0
  327. game/locale/sv_SE/LC_MESSAGES/djangojs.po +0 -739
  328. game/locale/tl_PH/LC_MESSAGES/django.mo +0 -0
  329. game/locale/tl_PH/LC_MESSAGES/django.po +0 -405
  330. game/locale/tl_PH/LC_MESSAGES/djangojs.mo +0 -0
  331. game/locale/tl_PH/LC_MESSAGES/djangojs.po +0 -739
  332. game/locale/tlh_AA/LC_MESSAGES/django.mo +0 -0
  333. game/locale/tlh_AA/LC_MESSAGES/django.po +0 -405
  334. game/locale/tlh_AA/LC_MESSAGES/djangojs.mo +0 -0
  335. game/locale/tlh_AA/LC_MESSAGES/djangojs.po +0 -739
  336. game/locale/tr_TR/LC_MESSAGES/django.mo +0 -0
  337. game/locale/tr_TR/LC_MESSAGES/django.po +0 -405
  338. game/locale/tr_TR/LC_MESSAGES/djangojs.mo +0 -0
  339. game/locale/tr_TR/LC_MESSAGES/djangojs.po +0 -740
  340. game/locale/ur_IN/LC_MESSAGES/django.mo +0 -0
  341. game/locale/ur_IN/LC_MESSAGES/django.po +0 -405
  342. game/locale/ur_IN/LC_MESSAGES/djangojs.mo +0 -0
  343. game/locale/ur_IN/LC_MESSAGES/djangojs.po +0 -739
  344. game/locale/ur_PK/LC_MESSAGES/django.mo +0 -0
  345. game/locale/ur_PK/LC_MESSAGES/django.po +0 -405
  346. game/locale/ur_PK/LC_MESSAGES/djangojs.mo +0 -0
  347. game/locale/ur_PK/LC_MESSAGES/djangojs.po +0 -739
  348. game/static/game/image/actions/go.svg +0 -18
  349. game/static/game/image/icons/destination.svg +0 -9
  350. game/static/game/js/pqselect.min.js +0 -9
  351. game/static/game/js/widget-scroller.js +0 -906
  352. rapid_router-5.4.1.dist-info/LICENSE.md +0 -577
  353. rapid_router-5.4.1.dist-info/METADATA +0 -24
  354. {rapid_router-5.4.1.dist-info → rapid_router-7.6.8.dist-info}/top_level.txt +0 -0
game/messages.py CHANGED
@@ -1,51 +1,37 @@
1
1
  from builtins import str
2
2
 
3
3
 
4
- def level_creation_email_subject():
5
- return "Custom level to moderate"
6
-
7
-
8
- def level_creation_email_text_content():
4
+ def video_link(url):
9
5
  return (
10
- "Your student {student_name} from your class {class_name} has created this level: {level_url}. "
11
- "If you want to moderate it, you can do it on the moderation board: {moderate_url}."
6
+ "<div class='popup_video'>"
7
+ "<video controls name='media'>"
8
+ "<source src=" + str(url) + "type='video/mp4'></video><br></div>"
12
9
  )
13
10
 
14
11
 
15
- def youtubeLink(width, height, url, border):
16
- return (
17
- "<iframe width='"
18
- + str(width)
19
- + "' height='"
20
- + str(height)
21
- + "' src='"
22
- + str(url)
23
- + "?rel=0"
24
- + "' frameborder='"
25
- + str(border)
26
- + "' allowfullscreen class='video'></iframe><br>"
27
- )
12
+ def play_button_icon_url():
13
+ return '<img src="/static/game/image/icons/play.svg" alt="Play icon">' "<b>Play</b>"
28
14
 
29
15
 
30
- def play_button_icon_url():
16
+ def step_button_icon_url():
31
17
  return (
32
- '<img src="/static/game/image/actions/go.svg" alt="Play button" '
33
- 'style="width: 4%;">'
18
+ '<img src="/static/game/image/icons/step.svg" alt="Step button" '
19
+ '" style="width: 4%;">'
34
20
  )
35
21
 
36
22
 
37
- def step_button_icon_url():
23
+ def if_else_icon_url():
38
24
  return (
39
- '<img src="/static/game/image/icons/step.svg" alt="Step button" '
25
+ '<img src="/static/game/image/icons/if_else.svg" alt="If Else button" '
40
26
  '" style="width: 4%;">'
41
27
  )
42
28
 
43
29
 
44
- def noPermissionMessage():
45
- return "You have no permission to see this."
30
+ def if_else_example_url():
31
+ return '<img src="/static/game/image/if_else_example.png" alt="If Else example">'
46
32
 
47
33
 
48
- def notSharedLevel():
34
+ def not_shared_level():
49
35
  return (
50
36
  "This level is private. You can only see the public levels and the ones "
51
37
  "created by other users only if they share them with you."
@@ -55,118 +41,58 @@ def notSharedLevel():
55
41
  """ Strings used in the scoreboard. """
56
42
 
57
43
 
58
- def noPermissionTitle():
44
+ def no_permission_title():
59
45
  return "No permission"
60
46
 
61
47
 
62
- def noPermissionScoreboard():
48
+ def no_permission_scoreboard():
63
49
  return (
64
50
  "Scoreboard is only visible to school students and teachers. Log in if you "
65
51
  "think you should be able to see it."
66
52
  )
67
53
 
68
54
 
69
- def noDataToShow():
70
- return (
71
- "There is no data to show. Please contact your administrator if this is "
72
- "unexpected."
73
- )
74
-
75
-
76
55
  """ Strings used on the level moderation page. """
77
56
 
78
57
 
79
- def noPermissionLevelModerationTitle():
58
+ def no_permission_level_moderation_title():
80
59
  return "No permission"
81
60
 
82
61
 
83
- def noPermissionLevelModerationPage():
62
+ def no_permission_level_moderation_page():
84
63
  return (
85
64
  "Level moderation is only visible to teachers. Log in if you "
86
65
  "think you should be able to see it."
87
66
  )
88
67
 
89
68
 
90
- def noPermissionLevelModerationClass():
69
+ def no_permission_level_moderation_class():
91
70
  return (
92
71
  "You do not teach this class. Please contact your administrator if this "
93
72
  "is unexpected."
94
73
  )
95
74
 
96
75
 
97
- def noPermissionLevelModerationStudent():
98
- return (
99
- "You do not teach this student. Please contact your administrator if this "
100
- "is unexpected."
101
- )
102
-
103
-
104
- def noDataToShowLevelModeration():
76
+ def no_data_to_show_level_moderation():
105
77
  return (
106
78
  "You have not created any classes and therefore is no data to show. "
107
79
  "Please contact your administrator if this is unexpected."
108
80
  )
109
81
 
110
82
 
111
- """ String messages used on the settings page. """
112
-
113
-
114
- def shareTitle():
115
- return "Level Share"
116
-
117
-
118
- def shareSuccessfulPerson(name, surname):
119
- return f"You shared your level with {name} {surname} successfully!"
120
-
121
-
122
- def shareSuccessfulClass(className):
123
- return f"You shared your level with class {className} successfully!"
124
-
125
-
126
- def shareUnsuccessfulPerson(first_name, last_name):
127
- return (
128
- f"We were unable to find {first_name} {last_name}. Are you sure you got their "
129
- f"name right?"
130
- )
131
-
132
-
133
- def shareUnsuccessfulClass(className):
134
- return f"We were unable to find class {className}. Are you sure you got it right?"
83
+ """ Strings used on the Python Den worksheet page. """
135
84
 
136
85
 
137
- def noLevelsToShow():
138
- return "It seems that you have not created any levels. How about creating one now?"
139
-
140
-
141
- def levelsMessage():
142
- return (
143
- "All the levels you have created so far. Click on them to play them or share "
144
- "them with your friends."
145
- )
86
+ def no_permission_python_den_worksheet_title():
87
+ return "No permission"
146
88
 
147
89
 
148
- def sharedLevelsMessage():
90
+ def no_permission_python_den_worksheet_page():
149
91
  return (
150
- "All the levels created by others that were shared with you. Click on them to "
151
- "play them."
92
+ "This content is only available to logged in users. Please log in to access this page."
152
93
  )
153
94
 
154
95
 
155
- def noSharedLevels():
156
- return "No one shared a level with you yet."
157
-
158
-
159
- """ Strings used in the class view. """
160
-
161
-
162
- def chooseClass():
163
- return "Choose a class you want to see."
164
-
165
-
166
- def noPermission():
167
- return "You don't have permissions to see this."
168
-
169
-
170
96
  """ String messages used as level tips in the game view. """
171
97
 
172
98
 
@@ -178,16 +104,7 @@ def build_description(title, message):
178
104
  return f"<b>{title}</b><br><br>{message}"
179
105
 
180
106
 
181
- def title_level_default():
182
- return " "
183
-
184
-
185
- def description_level_default():
186
- return "Can you find the shortest route?"
187
-
188
-
189
- def hint_level_default():
190
- return "Think back to earlier levels. What did you learn?"
107
+ # RAPID ROUTER
191
108
 
192
109
 
193
110
  def title_level1():
@@ -444,7 +361,7 @@ def description_level13():
444
361
  f"Often there is more than one way to get to the house. The route that needs "
445
362
  f"the fewest directions is usually best. <br> Help the van find the "
446
363
  f"shortest route to the house. <br> You can press the {play_button_icon_url()} "
447
- f"or <b>Play</b> buttons to start the van."
364
+ f"button to start the van."
448
365
  )
449
366
  return build_description(title_level13(), message)
450
367
 
@@ -568,18 +485,22 @@ def title_level19():
568
485
 
569
486
 
570
487
  def description_level19():
571
- message = youtubeLink(
572
- 600, 400, "https://www.youtube-nocookie.com/embed/vFGd0v3msRE", 0
488
+ message = video_link(
489
+ "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdCZE3FuBgH5fHsGocKGv%2Fuploads%2FPucDWuRfzuTxeLI6IHRx%2FMahana%20explains%20repeat%20functions.mp4?alt=media&token=361c8495-dc7d-4e18-9a7f-4c07c3fd303d"
573
490
  )
574
491
  message += (
492
+ "<div class='popup_message'>"
575
493
  "Attach a block inside the <b>Repeat</b> block to make the van repeat "
576
494
  "that instruction. <br> This means you can use one block instead of lots "
577
495
  "of blocks to do the same thing over and over again. <br> How many times "
578
496
  "do you want the instruction repeated? Type the number into the "
579
497
  "<b>Repeat</b> block. <br> The repeated sets of blocks make a 'loop'. "
580
498
  "<br><br> When you are ready, press <b>Play</b>!"
499
+ "</div>"
500
+ )
501
+ return build_description(
502
+ title_level19(), f"<div class='main_popup_container'>{message}</div>"
581
503
  )
582
- return build_description(title_level19(), message)
583
504
 
584
505
 
585
506
  def hint_level19():
@@ -591,7 +512,7 @@ def hint_level19():
591
512
 
592
513
 
593
514
  def title_level20():
594
- return "Use the <b>Repeat</b> block to make your sequence shorter and simpler"
515
+ return "Use the <b>repeat</b> block to make your sequence shorter and simpler"
595
516
 
596
517
 
597
518
  def description_level20():
@@ -775,18 +696,22 @@ def title_level29():
775
696
 
776
697
 
777
698
  def description_level29():
778
- message = youtubeLink(
779
- 600, 400, "https://www.youtube-nocookie.com/embed/EDwc80X_LQI", 0
699
+ message = video_link(
700
+ "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdCZE3FuBgH5fHsGocKGv%2Fuploads%2FmUm2VB4N62Opk2CezOFR%2FAna%20discusses%20repeat%20until%20and%20repeat%20while%20functions.mp4?alt=media&token=1add73b1-9e21-4cdb-876d-31495012bb50"
780
701
  )
781
702
  message += (
703
+ "<div class='popup_message'>"
782
704
  "Drag a block inside a <b>Repeat until</b> block to make the van repeat an "
783
705
  "instruction. <br> Attach a 'condition' so the van knows when to stop "
784
706
  "repeating the instruction. <br> Here, you want the van to repeat your "
785
707
  "instruction until it is at the destination. <br> Doing this means "
786
708
  "you don't have to work out how many times the van should repeat your "
787
709
  "instruction."
710
+ "</div>"
711
+ )
712
+ return build_description(
713
+ title_level29(), f"<div class='main_popup_container'>{message}</div>"
788
714
  )
789
- return build_description(title_level29(), message)
790
715
 
791
716
 
792
717
  def hint_level29():
@@ -835,7 +760,7 @@ def hint_level31():
835
760
 
836
761
 
837
762
  def title_level32():
838
- return "Uh oh, it's <b>Until</b> fever!"
763
+ return "Uh oh, it's <b>until</b> fever!"
839
764
 
840
765
 
841
766
  def description_level32():
@@ -852,22 +777,26 @@ def hint_level32():
852
777
 
853
778
 
854
779
  def title_level33():
855
- return "Now it's time to try the <b>If</b> block"
780
+ return "Now it's time to try the <b>if</b> block"
856
781
 
857
782
 
858
783
  def description_level33():
859
- message = youtubeLink(
860
- 600, 400, "https://www.youtube-nocookie.com/embed/O0RXbJyYq8o", 0
784
+ message = video_link(
785
+ "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdCZE3FuBgH5fHsGocKGv%2Fuploads%2F8A63G0OQlNdxMpvLuK9j%2FChris%20and%20Matt%20introduce%20if%20statements.mp4?alt=media&token=6fc94e71-a8b1-43a4-aadd-63fcf3b5788c"
861
786
  )
862
787
  message += (
788
+ "<div class='popup_message'>"
863
789
  "Another way of telling the van what to do is to use the <b>If</b> block. "
864
790
  "For example, <b>If</b> the <b>road exists forwards do</b> <b>Move "
865
791
  "forwards</b>. <br> This is called an 'if statement'. <br> Try "
866
792
  "using the <b>If</b> block and the <b>Repeat</b> block together. <br> "
867
793
  "The <b>Repeat</b> block will stretch if you attach the <b>If</b> block "
868
794
  "inside it."
795
+ "</div>"
796
+ )
797
+ return build_description(
798
+ title_level33(), f"<div class='main_popup_container'>{message}</div>"
869
799
  )
870
- return build_description(title_level33(), message)
871
800
 
872
801
 
873
802
  def hint_level33():
@@ -879,15 +808,15 @@ def hint_level33():
879
808
 
880
809
 
881
810
  def title_level34():
882
- return "Multiple <b>If</b>s"
811
+ return "<b>If</b> and bends"
883
812
 
884
813
 
885
814
  def description_level34():
886
815
  message = (
887
816
  "It can be handy to use <b>If</b> to give your van choices, so you don't "
888
817
  "have to give the van new instructions at every step. <br> For "
889
- "example: Tell the van <b>If</b> the <b>road exists forwards do Move "
890
- "forwards,</b> but <b>If</b> the <b>road exists left do Turn left</b>. "
818
+ "example: Tell the van <b>If</b> the <b>road exists forwards</b> do <b>Move "
819
+ "forwards</b>, <b>Else</b> do <b>Turn left</b>. "
891
820
  "<br> The van will choose correctly from the <b>Move forwards</b> and "
892
821
  "<b>Turn left</b> instructions depending on the road. <br> Use an 'if "
893
822
  "statement' in a 'loop' to drive the van down this bendy road."
@@ -898,7 +827,7 @@ def description_level34():
898
827
  def hint_level34():
899
828
  return (
900
829
  "This route looks complicated, but you can solve it without counting blocks. "
901
- "You are going to use a <b>Repeat until</b> block again and <b>If</b> blocks "
830
+ "You are going to use a <b>Repeat until</b> block again and an <b>If</b> block "
902
831
  "to help the driver check the road ahead so they can decide which way to go. "
903
832
  "What are the possible directions on this route?"
904
833
  )
@@ -928,23 +857,25 @@ def hint_level35():
928
857
 
929
858
 
930
859
  def title_level36():
931
- return "What else? If-else, that's what!"
860
+ return "What else? <b>If-else</b>, that's what!"
932
861
 
933
862
 
934
863
  def description_level36():
935
- message = youtubeLink(
936
- 600, 400, "https://www.youtube-nocookie.com/embed/GUUJSRuAyU0", 0
937
- )
938
- message += (
939
- "You can change the <b>If</b> block to make more choices. Click on the "
940
- "star in the <b>If</b> block and add <b>Else if</b>. <br> This will tell "
941
- "the van what to do if the first <b>If</b> direction can't be done. "
942
- "<br> For example, tell the van to <b>Turn left</b> <b>If</b> the "
943
- "<b>road exists left</b>. Add <b>Else if</b> the <b>road exists right"
944
- "</b>, <b>Turn right</b>. <br> This uses fewer blocks and makes sure "
945
- "that only one step is taken in each loop. <br> This type of "
946
- "algorithm is called a 'general algorithm' as it can be used with most "
947
- "simple routes."
864
+ message = (
865
+ f"<div class='popup_message'>"
866
+ f"You can change the <b>if</b> block to make more choices. Click on the"
867
+ f" {if_else_icon_url()} to add <b>else if</b>."
868
+ f"<br>"
869
+ f"This will tell the van what to do if the first <b>if</b> direction"
870
+ f" can't be done."
871
+ f"<br>"
872
+ f"You can also add an <b>else</b> block to tell the van what to do if"
873
+ f" none of the conditions match."
874
+ f"<br>"
875
+ f"{if_else_example_url()}"
876
+ f"<br>"
877
+ f"This is a general algorithm, it can be used for lots of different routes!"
878
+ f"</div>"
948
879
  )
949
880
  return build_description(title_level36(), message)
950
881
 
@@ -976,22 +907,29 @@ def hint_level37():
976
907
 
977
908
 
978
909
  def title_level38():
979
- return "Third time lucky!"
910
+ return "Where did the cows come from?"
980
911
 
981
912
 
982
913
  def description_level38():
983
914
  message = (
984
- "Well done! You've got so far. <br> Can you apply the knowledge you "
985
- "gained going through this part of the game to this level?"
915
+ "Well done! You've got so far."
916
+ "<br>"
917
+ "Can you apply the knowledge you gained going through this part of the "
918
+ "game to this level? This time there are some hidden cows that you "
919
+ "need to get out of the road! Can you work out what to do?"
920
+ "<br><br>"
921
+ "Hint: Cows don't like noise"
986
922
  )
987
923
  return build_description(title_level38(), message)
988
924
 
989
925
 
990
926
  def hint_level38():
991
927
  return (
992
- "This is a really long route. With a counted loop, your program would be quite "
993
- "long but is this program going to be any longer than your solution to the "
994
- "last level?"
928
+ "This is a really long route. With a counted loop, your program would "
929
+ "be quite long but is this program going to be any longer than your "
930
+ "solution to the last level?"
931
+ "<br><br>"
932
+ "Hint: Cows don't like noise"
995
933
  )
996
934
 
997
935
 
@@ -1001,19 +939,20 @@ def title_level39():
1001
939
 
1002
940
  def description_level39():
1003
941
  message = (
1004
- "Can you use the 'general algorithm' here so that the van takes a "
1005
- "shorter route? Or maybe there's a more efficient way? <br><br>Keep "
1006
- "an eye on the fuel level - try to use as little as possible."
942
+ "It looks like the cows have escaped when you get to the side roads, "
943
+ "so be careful not to hit them!"
944
+ "<br><br>"
945
+ "Hint: Cows don't like noise"
1007
946
  )
1008
947
  return build_description(title_level39(), message)
1009
948
 
1010
949
 
1011
- # TODO: Update when we update this level
1012
950
  def hint_level39():
1013
951
  return (
1014
- "Uh oh, moving around the blocks in your 'general algorithm' might not "
1015
- "be the most efficient solution. How about creating a simple solution "
1016
- "without 'if statements' that will help the van reach the house?"
952
+ "You'll need to modify your general algorithm here so you can get back "
953
+ "on track if you hit a dead end."
954
+ "<br><br>"
955
+ "Hint: Cows don't like noise"
1017
956
  )
1018
957
 
1019
958
 
@@ -1101,18 +1040,22 @@ def title_level44():
1101
1040
 
1102
1041
 
1103
1042
  def description_level44():
1104
- message = youtubeLink(
1105
- 600, 400, "https://www.youtube-nocookie.com/embed/EDwc80X_LQI", 0
1043
+ message = video_link(
1044
+ "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdCZE3FuBgH5fHsGocKGv%2Fuploads%2FVDmgFe1LBpTpWI2b9EVN%2FWill%20discusses%20variables.mp4?alt=media&token=3fb3c5ca-f0d7-4f98-9274-5c4db8f64eac"
1106
1045
  )
1107
1046
  message += (
1047
+ "<div class='popup_message'>"
1108
1048
  "The light varies from red to green. <br>"
1109
1049
  "The van must check which colour the traffic light is when it reaches them "
1110
1050
  "- if it goes past a red light it will break the Highway Code."
1111
1051
  "<br> Here, you want the van to repeat the wait instruction while the traffic light is red. "
1112
1052
  "Drag a block inside a <b>Repeat while</b> block to make the van repeat an instruction. "
1113
1053
  "<br> Attach a 'condition' so the van knows when to repeat the instruction."
1054
+ "</div>"
1055
+ )
1056
+ return build_description(
1057
+ title_level44(), f"<div class='main_popup_container'>{message}</div>"
1114
1058
  )
1115
- return build_description(title_level44(), message)
1116
1059
 
1117
1060
 
1118
1061
  def hint_level44():
@@ -1167,16 +1110,18 @@ def title_level47():
1167
1110
  def description_level47():
1168
1111
  message = (
1169
1112
  "Put your knowledge to test. Create an algorithm to lead the van to the "
1170
- "house. <br> Don't forget to add a turn and to make the van wait at a "
1171
- "traffic light."
1113
+ "house. <br> Don't forget to add a turn block and this time, you "
1114
+ "need to avoid cows instead of waiting at traffic lights."
1172
1115
  )
1173
1116
  return build_description(title_level47(), message)
1174
1117
 
1175
1118
 
1176
1119
  def hint_level47():
1177
1120
  return (
1178
- "This route is similar to the last one but the turn is in the other direction. "
1179
- "Can you adapt your program?"
1121
+ "This route is similar to the last one but the turn is in a different "
1122
+ "direction, and there are now cows instead of traffic lights!!"
1123
+ "<br><br>"
1124
+ "Do you remember what to do?"
1180
1125
  )
1181
1126
 
1182
1127
 
@@ -1269,7 +1214,7 @@ def hint_level51():
1269
1214
 
1270
1215
 
1271
1216
  def title_level52():
1272
- return "A Bit more Tricky"
1217
+ return "A bit more tricky"
1273
1218
 
1274
1219
 
1275
1220
  def description_level52():
@@ -1308,7 +1253,7 @@ def hint_level53():
1308
1253
 
1309
1254
 
1310
1255
  def title_level54():
1311
- return "Round and Round"
1256
+ return "Round and round"
1312
1257
 
1313
1258
 
1314
1259
  def description_level54():
@@ -1327,7 +1272,7 @@ def hint_level54():
1327
1272
 
1328
1273
 
1329
1274
  def title_level55():
1330
- return "Wonky Fish!"
1275
+ return "Wonky fish!"
1331
1276
 
1332
1277
 
1333
1278
  def description_level55():
@@ -1343,7 +1288,7 @@ def hint_level55():
1343
1288
 
1344
1289
 
1345
1290
  def title_level56():
1346
- return "Concrete Wasteland"
1291
+ return "Concrete wasteland"
1347
1292
 
1348
1293
 
1349
1294
  def description_level56():
@@ -1362,7 +1307,7 @@ def hint_level56():
1362
1307
 
1363
1308
 
1364
1309
  def title_level57():
1365
- return "This is <b>not...</b> the same"
1310
+ return "This is <b>not</b>... the same"
1366
1311
 
1367
1312
 
1368
1313
  def description_level57():
@@ -1461,7 +1406,7 @@ def hint_level61():
1461
1406
 
1462
1407
 
1463
1408
  def title_level62():
1464
- return "Lots of Traffic Lights!"
1409
+ return "Lots of traffic lights!"
1465
1410
 
1466
1411
 
1467
1412
  def description_level62():
@@ -1478,7 +1423,7 @@ def hint_level62():
1478
1423
 
1479
1424
 
1480
1425
  def title_level63():
1481
- return "Wiggle Wiggle"
1426
+ return "Wiggle wiggle"
1482
1427
 
1483
1428
 
1484
1429
  def description_level63():
@@ -1499,7 +1444,7 @@ def hint_level63():
1499
1444
 
1500
1445
 
1501
1446
  def title_level64():
1502
- return "Muddy Patterns with Phil"
1447
+ return "Muddy patterns with Phil"
1503
1448
 
1504
1449
 
1505
1450
  def description_level64():
@@ -1556,7 +1501,7 @@ def hint_level66():
1556
1501
 
1557
1502
 
1558
1503
  def title_level67():
1559
- return "Crazy Farm"
1504
+ return "Crazy farm"
1560
1505
 
1561
1506
 
1562
1507
  def description_level67():
@@ -1639,7 +1584,7 @@ def hint_level71():
1639
1584
 
1640
1585
 
1641
1586
  def title_level72():
1642
- return "Can Wes Find his lunch?"
1587
+ return "Can Wes find his lunch?"
1643
1588
 
1644
1589
 
1645
1590
  def description_level72():
@@ -1719,7 +1664,7 @@ def hint_level76():
1719
1664
 
1720
1665
 
1721
1666
  def title_level77():
1722
- return "G Force"
1667
+ return "G force"
1723
1668
 
1724
1669
 
1725
1670
  def description_level77():
@@ -1753,7 +1698,7 @@ def hint_level78():
1753
1698
 
1754
1699
 
1755
1700
  def title_level79():
1756
- return "Muddy Mayhem"
1701
+ return "Muddy mayhem"
1757
1702
 
1758
1703
 
1759
1704
  def description_level79():
@@ -1770,6 +1715,7 @@ def hint_level79():
1770
1715
  )
1771
1716
 
1772
1717
 
1718
+ # Legacy RR levels, still referenced in some Python Den levels
1773
1719
  # --- Introduction to Python levels ---
1774
1720
 
1775
1721
  INTRO_HINT = (
@@ -1785,11 +1731,16 @@ def title_level80():
1785
1731
 
1786
1732
 
1787
1733
  def description_level80():
1788
- message = (
1789
- "As you create your program using Blockly see what it looks like in the Python "
1734
+ message = video_link(
1735
+ "https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdCZE3FuBgH5fHsGocKGv%2Fuploads%2FhwOkHWSHqONf5lm7vbc4%2FCode%20for%20Life_%20Python.mp4?alt=media&token=8b47268c-91ea-4315-80e8-05c40d84372c"
1736
+ )
1737
+ message += (
1738
+ "As you create your program using Blockly, see what it looks like in the Python "
1790
1739
  "programming language. Can you tell which Python statement matches which block?"
1791
1740
  )
1792
- return build_description(title_level80(), message)
1741
+ return build_description(
1742
+ title_level80(), f"<div class='main_popup_container'>{message}</div>"
1743
+ )
1793
1744
 
1794
1745
 
1795
1746
  def hint_level80():
@@ -1805,7 +1756,7 @@ def title_level81():
1805
1756
 
1806
1757
  def description_level81():
1807
1758
  message = (
1808
- "As you create your program using Blockly see what it looks like in the Python "
1759
+ "As you create your program using Blockly, see what it looks like in the Python "
1809
1760
  "programming language. Can you tell which Python statement matches which block?"
1810
1761
  )
1811
1762
  return build_description(title_level81(), message)
@@ -1822,7 +1773,7 @@ def title_level82():
1822
1773
 
1823
1774
  def description_level82():
1824
1775
  message = (
1825
- "As you create your program using Blockly see what it looks like in the Python "
1776
+ "As you create your program using Blockly, see what it looks like in the Python "
1826
1777
  "programming language. Can you tell which Python statement matches which block?"
1827
1778
  )
1828
1779
  return build_description(title_level82(), message)
@@ -1843,7 +1794,7 @@ def title_level83():
1843
1794
 
1844
1795
  def description_level83():
1845
1796
  message = (
1846
- "As you create your program using Blockly see what it looks like in the Python "
1797
+ "As you create your program using Blockly, see what it looks like in the Python "
1847
1798
  "programming language. Try adding a <b>repeat</b> block and watch what happens in Python."
1848
1799
  )
1849
1800
  return build_description(title_level83(), message)
@@ -1855,12 +1806,12 @@ def hint_level83():
1855
1806
 
1856
1807
 
1857
1808
  def title_level84():
1858
- return "Repeat and watch"
1809
+ return "<b>Repeat</b> and watch"
1859
1810
 
1860
1811
 
1861
1812
  def description_level84():
1862
1813
  message = (
1863
- "As you create your program using Blockly see what it looks like in the Python "
1814
+ "As you create your program using Blockly, see what it looks like in the Python "
1864
1815
  "programming language. Try adding a <b>repeat</b> block and watch what happens in Python."
1865
1816
  )
1866
1817
  return build_description(title_level84(), message)
@@ -1872,12 +1823,12 @@ def hint_level84():
1872
1823
 
1873
1824
 
1874
1825
  def title_level85():
1875
- return "Looks easy but use repeat until and see what happens?"
1826
+ return "Looks easy but use <b>repeat until</b> and see what happens?"
1876
1827
 
1877
1828
 
1878
1829
  def description_level85():
1879
1830
  message = (
1880
- "As you create your program using Blockly see what it looks like in the Python "
1831
+ "As you create your program using Blockly, see what it looks like in the Python "
1881
1832
  "programming language. Try adding a <b>repeat</b> until block and watch what "
1882
1833
  "happens in Python."
1883
1834
  )
@@ -1890,12 +1841,12 @@ def hint_level85():
1890
1841
 
1891
1842
 
1892
1843
  def title_level86():
1893
- return "See what the if blocks looks like in Python"
1844
+ return "See what the <b>if</b> blocks looks like in Python"
1894
1845
 
1895
1846
 
1896
1847
  def description_level86():
1897
1848
  message = (
1898
- "As you create your program using Blockly see what it looks like in the Python "
1849
+ "As you create your program using Blockly, see what it looks like in the Python "
1899
1850
  "programming language. Try adding an <b>if</b> block and watch what happens in Python."
1900
1851
  )
1901
1852
  return build_description(title_level86(), message)
@@ -1906,12 +1857,12 @@ def hint_level86():
1906
1857
 
1907
1858
 
1908
1859
  def title_level87():
1909
- return "Don't forget to use else if"
1860
+ return "Don't forget to use <b>else if</b>"
1910
1861
 
1911
1862
 
1912
1863
  def description_level87():
1913
1864
  message = (
1914
- "As you create your program using Blockly see what it looks like in the Python "
1865
+ "As you create your program using Blockly, see what it looks like in the Python "
1915
1866
  "programming language. Try adding an <b>if</b> block and watch what happens in "
1916
1867
  "Python particularly with <b>else if</b> and <b>else</b> statements."
1917
1868
  )
@@ -1923,12 +1874,12 @@ def hint_level87():
1923
1874
 
1924
1875
 
1925
1876
  def title_level88():
1926
- return "See what happens when you add Traffic lights"
1877
+ return "See what happens when you add traffic lights"
1927
1878
 
1928
1879
 
1929
1880
  def description_level88():
1930
1881
  message = (
1931
- "As you create your program using Blockly see what it looks like in the Python "
1882
+ "As you create your program using Blockly, see what it looks like in the Python "
1932
1883
  "programming language. Try adding an <b>if</b> block and watch what happens in "
1933
1884
  "Python particularly with <b>else if</b> and <b>else</b> statements."
1934
1885
  )
@@ -1945,7 +1896,7 @@ def title_level89():
1945
1896
 
1946
1897
  def description_level89():
1947
1898
  message = (
1948
- "As you create your program using Blockly see what it looks like in the Python "
1899
+ "As you create your program using Blockly, see what it looks like in the Python "
1949
1900
  "programming language. Try adding an <b>if</b> block and watch what happens in "
1950
1901
  "Python particularly with <b>else if</b> and <b>else</b> statements."
1951
1902
  )
@@ -1962,7 +1913,7 @@ def title_level90():
1962
1913
 
1963
1914
  def description_level90():
1964
1915
  message = (
1965
- "As you create your program using Blockly see what it looks like in the Python "
1916
+ "As you create your program using Blockly, see what it looks like in the Python "
1966
1917
  "language. Try adding a procedure and watch what happens in Python."
1967
1918
  )
1968
1919
  return build_description(title_level90(), message)
@@ -1981,7 +1932,7 @@ def title_level91():
1981
1932
 
1982
1933
  def description_level91():
1983
1934
  message = (
1984
- "As you create your program using Blockly see what it looks like in the Python "
1935
+ "As you create your program using Blockly, see what it looks like in the Python "
1985
1936
  "language. Try adding a procedure and watch what happens in Python."
1986
1937
  )
1987
1938
  return build_description(title_level91(), message)
@@ -1998,7 +1949,7 @@ def hint_level91():
1998
1949
 
1999
1950
  PYTHON_HINT = (
2000
1951
  "<br /><br />Check our documentation site, to see "
2001
- "<a href='https://docs.codeforlife.education/rapid-router/python-commands' target='_blank'>the full list of commands</a>."
1952
+ "<a href='https://code-for-life.gitbook.io/rapid-router/rapid-router-python-commands' target='_blank'>the full list of commands</a>."
2002
1953
  "<br /><br />To learn more about Python in general, check this "
2003
1954
  "<a href='https://wiki.python.org/moin/BeginnersGuide' target='_blank'>Beginner's Guide to Python</a>."
2004
1955
  )
@@ -2017,6 +1968,15 @@ def description_level92():
2017
1968
  return build_description(title_level92(), message)
2018
1969
 
2019
1970
 
1971
+ def commands_level92():
1972
+ return (
1973
+ "<b>Movement</b>"
1974
+ + "<br>my_van.move_forwards()"
1975
+ + "<br>my_van.turn_left()"
1976
+ + "<br>my_van.turn_right()"
1977
+ )
1978
+
1979
+
2020
1980
  def hint_level92():
2021
1981
  return (
2022
1982
  "Try using the following commands:<br><pre>my_van.move_forwards()<br>my_van.turn_left()"
@@ -2036,6 +1996,15 @@ def description_level93():
2036
1996
  return build_description(title_level93(), message)
2037
1997
 
2038
1998
 
1999
+ def commands_level93():
2000
+ return (
2001
+ "<b>Movement</b>"
2002
+ + "<br>my_van.move_forwards()"
2003
+ + "<br>my_van.turn_left()"
2004
+ + "<br>my_van.turn_right()"
2005
+ )
2006
+
2007
+
2039
2008
  def hint_level93():
2040
2009
  return (
2041
2010
  """Try using the following commands:
@@ -2058,6 +2027,15 @@ def description_level94():
2058
2027
  return build_description(title_level94(), message)
2059
2028
 
2060
2029
 
2030
+ def commands_level94():
2031
+ return (
2032
+ "<b>Movement</b>"
2033
+ + "<br>my_van.move_forwards()"
2034
+ + "<br>my_van.turn_left()"
2035
+ + "<br>my_van.turn_right()"
2036
+ )
2037
+
2038
+
2061
2039
  def hint_level94():
2062
2040
  return (
2063
2041
  """Try using the following commands:
@@ -2080,6 +2058,15 @@ def description_level95():
2080
2058
  return build_description(title_level95(), message)
2081
2059
 
2082
2060
 
2061
+ def commands_level95():
2062
+ return (
2063
+ "<b>Movement</b>"
2064
+ + "<br>my_van.move_forwards()"
2065
+ + "<br>my_van.turn_left()"
2066
+ + "<br>my_van.turn_right()"
2067
+ )
2068
+
2069
+
2083
2070
  def hint_level95():
2084
2071
  return (
2085
2072
  """To repeat some statements a set number of times you can use something like the following:
@@ -2104,6 +2091,10 @@ def description_level96():
2104
2091
  return build_description(title_level96(), message)
2105
2092
 
2106
2093
 
2094
+ def commands_level96():
2095
+ return "<b>Movement</b>" + "<br>my_van.move_forwards()" + "<br>my_van.turn_left()"
2096
+
2097
+
2107
2098
  def hint_level96():
2108
2099
  return (
2109
2100
  """To repeat some statements a set number of times you can use something like the following:
@@ -2127,6 +2118,15 @@ def description_level97():
2127
2118
  return build_description(title_level97(), message)
2128
2119
 
2129
2120
 
2121
+ def commands_level97():
2122
+ return (
2123
+ "<b>Movement</b>"
2124
+ + "<br>my_van.move_forwards()"
2125
+ + "<br>my_van.turn_left()"
2126
+ + "<br>my_van.turn_right()"
2127
+ )
2128
+
2129
+
2130
2130
  def hint_level97():
2131
2131
  return (
2132
2132
  """To repeat within a repeats a set number of times you can use something like the following:
@@ -2153,6 +2153,21 @@ def description_level98():
2153
2153
  return build_description(title_level98(), message)
2154
2154
 
2155
2155
 
2156
+ def commands_level98():
2157
+ return (
2158
+ '<div class="row">'
2159
+ + '<div class="large-4 columns">'
2160
+ + "<b>Movement</b>"
2161
+ + "<br>my_van.move_forwards()"
2162
+ + "<br>my_van.turn_left()</div>"
2163
+ + '<div class="large-4 columns">'
2164
+ + "<b>Position</b>"
2165
+ + "<br>my_van.at_destination()"
2166
+ + "<br>my_van.is_road_forward()</div>"
2167
+ + '<div class="large-4 columns"></div></div>'
2168
+ )
2169
+
2170
+
2156
2171
  def hint_level98():
2157
2172
  return (
2158
2173
  """To repeat while a condition is met you can use something like the following:
@@ -2179,6 +2194,24 @@ def description_level99():
2179
2194
  return build_description(title_level99(), message)
2180
2195
 
2181
2196
 
2197
+ def commands_level99():
2198
+ return (
2199
+ '<div class="row">'
2200
+ + '<div class="large-4 columns">'
2201
+ + "<b>Movement</b>"
2202
+ + "<br>my_van.move_forwards()"
2203
+ + "<br>my_van.turn_left()"
2204
+ + "<br>my_van.turn_right()</div>"
2205
+ + '<div class="large-4 columns">'
2206
+ + "<b>Position</b>"
2207
+ + "<br>my_van.at_destination()"
2208
+ + "<br>my_van.is_road_right()"
2209
+ + "<br>my_van.is_road_left()"
2210
+ + "<br>my_van.is_road_forward()</div>"
2211
+ + '<div class="large-4 columns"></div></div>'
2212
+ )
2213
+
2214
+
2182
2215
  def hint_level99():
2183
2216
  return (
2184
2217
  """To repeat while a condition is met you can use something like the following:
@@ -2204,6 +2237,24 @@ def description_level100():
2204
2237
  return build_description(title_level100(), message)
2205
2238
 
2206
2239
 
2240
+ def commands_level100():
2241
+ return (
2242
+ '<div class="row">'
2243
+ + '<div class="large-4 columns">'
2244
+ + "<b>Movement</b>"
2245
+ + "<br>my_van.move_forwards()"
2246
+ + "<br>my_van.turn_left()"
2247
+ + "<br>my_van.turn_right()</div>"
2248
+ + '<div class="large-4 columns">'
2249
+ + "<b>Position</b>"
2250
+ + "<br>my_van.at_destination()"
2251
+ + "<br>my_van.is_road_forward()"
2252
+ + "<br>my_van.is_road_right()"
2253
+ + "<br>my_van.is_road_left()</div>"
2254
+ + '<div class="large-4 columns"></div></div>'
2255
+ )
2256
+
2257
+
2207
2258
  def hint_level100():
2208
2259
  return (
2209
2260
  "Try using<br><pre>if my_van.at_dead_end():</pre><br>to check if the van is at a dead end."
@@ -2212,7 +2263,7 @@ def hint_level100():
2212
2263
 
2213
2264
 
2214
2265
  def title_level101():
2215
- return "Function or Junction?"
2266
+ return "Function or junction?"
2216
2267
 
2217
2268
 
2218
2269
  def description_level101():
@@ -2224,6 +2275,15 @@ def description_level101():
2224
2275
  return build_description(title_level101(), message)
2225
2276
 
2226
2277
 
2278
+ def commands_level101():
2279
+ return (
2280
+ "<b>Movement</b>"
2281
+ + "<br>my_van.move_forwards()"
2282
+ + "<br>my_van.turn_left()"
2283
+ + "<br>my_van.turn_right()"
2284
+ )
2285
+
2286
+
2227
2287
  def hint_level101():
2228
2288
  return (
2229
2289
  """To define a function in Python you could do something like:
@@ -2248,6 +2308,15 @@ def description_level102():
2248
2308
  return build_description(title_level102(), message)
2249
2309
 
2250
2310
 
2311
+ def commands_level102():
2312
+ return (
2313
+ "<b>Movement</b>"
2314
+ + "<br>my_van.move_forwards()"
2315
+ + "<br>my_van.turn_left()"
2316
+ + "<br>my_van.turn_right()"
2317
+ )
2318
+
2319
+
2251
2320
  def hint_level102():
2252
2321
  return (
2253
2322
  """To define a function in Python you could do something like:
@@ -2271,6 +2340,15 @@ def description_level103():
2271
2340
  return build_description(title_level103(), message)
2272
2341
 
2273
2342
 
2343
+ def commands_level103():
2344
+ return (
2345
+ "<b>Movement</b>"
2346
+ + "<br>my_van.move_forwards()"
2347
+ + "<br>my_van.turn_left()"
2348
+ + "<br>my_van.turn_right()"
2349
+ )
2350
+
2351
+
2274
2352
  def hint_level103():
2275
2353
  return (
2276
2354
  """To define a function that calls another function you could do something like:
@@ -2298,6 +2376,15 @@ def description_level104():
2298
2376
  return build_description(title_level104(), message)
2299
2377
 
2300
2378
 
2379
+ def commands_level104():
2380
+ return (
2381
+ "<b>Movement</b>"
2382
+ + "<br>my_van.move_forwards()"
2383
+ + "<br>my_van.turn_left()"
2384
+ + "<br>my_van.turn_right()"
2385
+ )
2386
+
2387
+
2301
2388
  def hint_level104():
2302
2389
  return (
2303
2390
  """To define a function that calls another function you could do something like:
@@ -2325,6 +2412,25 @@ def description_level105():
2325
2412
  return build_description(title_level105(), message)
2326
2413
 
2327
2414
 
2415
+ def commands_level105():
2416
+ return (
2417
+ '<div class="row">'
2418
+ + '<div class="large-4 columns">'
2419
+ + "<b>Movement</b>"
2420
+ + "<br>my_van.move_forwards()"
2421
+ + "<br>my_van.turn_left()"
2422
+ + "<br>my_van.turn_right()"
2423
+ + "<br>my_van.wait()</div>"
2424
+ + '<div class="large-4 columns">'
2425
+ + "<b>Position</b>"
2426
+ + "<br>my_van.is_road_forward()"
2427
+ + "<br>my_van.is_road_left()"
2428
+ + "<br>my_van.at_red_traffic_light()"
2429
+ + "<br>my_van.at_destination()</div>"
2430
+ + '<div class="large-4 columns"></div></div>'
2431
+ )
2432
+
2433
+
2328
2434
  def hint_level105():
2329
2435
  return (
2330
2436
  "For this you will have to use a combination of the <b>while</b> and <b>if</b> statements."
@@ -2346,15 +2452,30 @@ def description_level106():
2346
2452
  return build_description(title_level106(), message)
2347
2453
 
2348
2454
 
2455
+ def commands_level106():
2456
+ return (
2457
+ '<div class="row">'
2458
+ + '<div class="large-4 columns">'
2459
+ + "<b>Movement</b>"
2460
+ + "<br>my_van.move_forwards()"
2461
+ + "<br>my_van.turn_right()</div>"
2462
+ + '<div class="large-4 columns">'
2463
+ + "<b>Position</b>"
2464
+ + "<br>my_van.at_destination()</div>"
2465
+ + '<div class="large-4 columns"></div></div>'
2466
+ )
2467
+
2468
+
2349
2469
  def hint_level106():
2350
2470
  return (
2351
2471
  """To use a variable to store the number of grid squares the van has to move you can do something like the following:
2352
- <pre>n = 1
2472
+ <pre>count = 1
2353
2473
  while not my_van.at_destination():
2354
- print n
2355
- n += 1</pre>
2356
- Variables can be used in place of constants when calling functions. For example to repeat something n times you can do something like the following:
2357
- <pre>for count in range(n):</pre>"""
2474
+ # Do something
2475
+ print(count)
2476
+ count = count + 1</pre>
2477
+ Variables can be used in place of fixed values when calling functions. For example to repeat something <strong>number</strong> times you can do something like the following:
2478
+ <pre>for count in range(number):</pre>"""
2358
2479
  + PYTHON_HINT
2359
2480
  )
2360
2481
 
@@ -2371,9 +2492,23 @@ def description_level107():
2371
2492
  return build_description(title_level107(), message)
2372
2493
 
2373
2494
 
2495
+ def commands_level107():
2496
+ return (
2497
+ '<div class="row">'
2498
+ + '<div class="large-4 columns">'
2499
+ + "<b>Movement</b>"
2500
+ + "<br>my_van.move_forwards()"
2501
+ + "<br>my_van.turn_left()</div>"
2502
+ + '<div class="large-4 columns">'
2503
+ + "<b>Position</b>"
2504
+ + "<br>my_van.at_destination()</div>"
2505
+ + '<div class="large-4 columns"></div></div>'
2506
+ )
2507
+
2508
+
2374
2509
  def hint_level107():
2375
2510
  return (
2376
- "To double the value of a variable you can do something like the following:<br><pre>n *= 2</pre>"
2511
+ "To double the value of a variable you can do something like the following:<br><pre>number *= 2</pre>"
2377
2512
  + PYTHON_HINT
2378
2513
  )
2379
2514
 
@@ -2387,32 +2522,899 @@ def description_level108():
2387
2522
  return build_description(title_level108(), message)
2388
2523
 
2389
2524
 
2525
+ def commands_level108():
2526
+ return (
2527
+ '<div class="row">'
2528
+ + '<div class="large-4 columns">'
2529
+ + "<b>Movement</b>"
2530
+ + "<br>my_van.move_forwards()"
2531
+ + "<br>my_van.turn_left()</div>"
2532
+ + '<div class="large-4 columns">'
2533
+ + "<b>Position</b>"
2534
+ + "<br>my_van.at_destination()</div>"
2535
+ + '<div class="large-4 columns"></div></div>'
2536
+ )
2537
+
2538
+
2390
2539
  def hint_level108():
2391
2540
  return (
2392
2541
  "To decrease the value of a variable by an amount you can do something like the "
2393
- "following:<br><pre>n -= 5</pre>" + PYTHON_HINT
2542
+ "following:<br><pre>count = count - 5</pre>" + PYTHON_HINT
2394
2543
  )
2395
2544
 
2396
2545
 
2397
2546
  def title_level109():
2398
- return "Final challenge!"
2547
+ return "Spiral challenge!"
2399
2548
 
2400
2549
 
2401
2550
  def description_level109():
2402
2551
  message = (
2403
- "For the last challenge, the road straight line sections of road start off increasing "
2552
+ "For this challenge, the straight line sections of road start off increasing "
2404
2553
  "by 1 after each turn and then switch to dividing by 2 with a twist!"
2405
2554
  )
2406
2555
  return build_description(title_level109(), message)
2407
2556
 
2408
2557
 
2558
+ def commands_level109():
2559
+ return (
2560
+ '<div class="row">'
2561
+ + '<div class="large-4 columns">'
2562
+ + "<b>Movement</b>"
2563
+ + "<br>my_van.move_forwards()"
2564
+ + "<br>my_van.turn_right()"
2565
+ + "<br>my_van.turn_left()</div>"
2566
+ + '<div class="large-4 columns">'
2567
+ + "<b>Position</b>"
2568
+ + "<br>my_van.at_destination()</div>"
2569
+ + '<div class="large-4 columns"></div></div>'
2570
+ )
2571
+
2572
+
2409
2573
  def hint_level109():
2410
2574
  return (
2411
- "To halve the value of a variable you can do something like the following:<br><pre>n /= 2</pre>"
2575
+ "To halve the value of a variable you can do something like the following:<br><pre>number /= 2</pre>"
2412
2576
  + PYTHON_HINT
2413
2577
  )
2414
2578
 
2415
2579
 
2580
+ # PYTHON DEN
2581
+
2582
+ # Worksheets starter code
2583
+
2584
+ def worksheet_starter_code():
2585
+ return "# Write your code below"
2586
+
2587
+ # Episode 12, Levels 110 - 122
2588
+ (
2589
+ title_level1001,
2590
+ description_level1001,
2591
+ hint_level1001,
2592
+ ) = (
2593
+ lambda: "Here's Python",
2594
+ lambda: build_description(
2595
+ title_level1001(),
2596
+ "As you create your program using Blockly, see what it looks like in the Python programming language. Can you tell which Python statement matches which block?",
2597
+ ),
2598
+ lambda: "This is a deliberately simple level. What you need to focus on is the Python code that is being generated for the blocks you join.",
2599
+ )
2600
+
2601
+ (
2602
+ title_level1002,
2603
+ description_level1002,
2604
+ hint_level1002,
2605
+ ) = (
2606
+ lambda: "Matching Blockly",
2607
+ lambda: build_description(
2608
+ title_level1002(),
2609
+ "As you create your program using Blockly, see what it looks like in the Python programming language. Can you tell which Python statement matches which block?",
2610
+ ),
2611
+ lambda: "This is a deliberately simple level. What you need to focus on is the Python code that is being generated for the blocks you join.",
2612
+ )
2613
+
2614
+ (
2615
+ title_level1003,
2616
+ description_level1003,
2617
+ hint_level1003,
2618
+ ) = (
2619
+ lambda: "Don't forget to find the shortest route",
2620
+ lambda: build_description(
2621
+ title_level1003(),
2622
+ "As you create your program using Blockly, see what it looks like in the Python programming language. Can you tell which Python statement matches which block?"
2623
+ "<br><br>"
2624
+ "Don't forget to find the shortest route!",
2625
+ ),
2626
+ lambda: "Pay close attention to the spelling of the Python commands, the use of the dot and the round brackets.",
2627
+ )
2628
+
2629
+ (
2630
+ title_level1004,
2631
+ description_level1004,
2632
+ hint_level1004,
2633
+ commands_level1004,
2634
+ ) = (
2635
+ lambda: "Where did the blocks go?",
2636
+ lambda: build_description(
2637
+ title_level1004(),
2638
+ "Can you remember how the Python was formed under the blocks in the previous levels? Take a look in the Py Commands for a quick reminder.",
2639
+ ),
2640
+ lambda: "Now it is your turn, you can click on the Py commands button for a reminder of the Python commands that you can use.",
2641
+ lambda: "<b>Movement</b>"
2642
+ + "<br>my_van.move_forwards()"
2643
+ + "<br>my_van.turn_left()"
2644
+ + "<br>my_van.turn_right()",
2645
+ )
2646
+
2647
+ (
2648
+ title_level1005,
2649
+ description_level1005,
2650
+ hint_level1005,
2651
+ commands_level1005,
2652
+ ) = (
2653
+ lambda: "Tree snake",
2654
+ lambda: build_description(
2655
+ title_level1005(),
2656
+ "This route is just a bit longer. Make sure you type the Python code accurately!",
2657
+ ),
2658
+ lambda: "The most common errors here are missing the round brackets at the end of the commands or mistyping the commands, e.g. use my_van.move_fowards() and not my_van.move_foward()",
2659
+ lambda: "<b>Movement</b>"
2660
+ + "<br>my_van.move_forwards()"
2661
+ + "<br>my_van.turn_left()"
2662
+ + "<br>my_van.turn_right()",
2663
+ )
2664
+
2665
+ (
2666
+ title_level1006,
2667
+ description_level1006,
2668
+ hint_level1006,
2669
+ commands_level1006,
2670
+ ) = (
2671
+ lambda: "Which way to turn? This way or that way?",
2672
+ lambda: build_description(
2673
+ title_level1006(),
2674
+ "Try to find the shortest route using Python code only. You are getting really good at this!",
2675
+ ),
2676
+ lambda: "If you are stuck on this one, check that you are using the Python commands accurately. Click the Py Commands button to help you.",
2677
+ lambda: "<b>Movement</b>"
2678
+ + "<br>my_van.move_forwards()"
2679
+ + "<br>my_van.turn_left()"
2680
+ + "<br>my_van.turn_right()",
2681
+ )
2682
+
2683
+ (
2684
+ title_level1007,
2685
+ description_level1007,
2686
+ hint_level1007,
2687
+ ) = (
2688
+ lambda: "In a <b>while</b>, crocodile!",
2689
+ lambda: build_description(
2690
+ title_level1007(),
2691
+ "<div class='main_popup_container'>"
2692
+ "<div class='popup_message'>"
2693
+ "Try to build up the blocks using a while loop to solve this one. Make sure that you count carefully."
2694
+ "<br><br><br><br><br><br><br><br>Watch this video for more details: <br>"
2695
+ "</div>"
2696
+ f"{video_link("https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdCZE3FuBgH5fHsGocKGv%2Fuploads%2F3ojsv3EPh8qREqYMJBqo%2FPython%20Den%20Variable%20blocks%20demo.mp4?alt=media&token=192e4448-f16b-497f-b0d3-18163fd7d1d7")}"
2697
+ "</div>",
2698
+ ),
2699
+ lambda: "<div class='main_popup_container'>"
2700
+ "<div class='popup_message'>"
2701
+ "Make sure that you are using the right blocks here. You must use the pink block for variables and the dark blue number block for values."
2702
+ "<br><br><br><br><br><br><br><br>Watch the video here if you are unsure.<br>"
2703
+ "</div>"
2704
+ f"{video_link("https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdCZE3FuBgH5fHsGocKGv%2Fuploads%2F3ojsv3EPh8qREqYMJBqo%2FPython%20Den%20Variable%20blocks%20demo.mp4?alt=media&token=192e4448-f16b-497f-b0d3-18163fd7d1d7")}"
2705
+ "</div>",
2706
+ )
2707
+
2708
+ (
2709
+ title_level1008,
2710
+ description_level1008,
2711
+ hint_level1008,
2712
+ ) = (
2713
+ lambda: "Wiggle <b>while</b> you work",
2714
+ lambda: build_description(
2715
+ title_level1008(),
2716
+ "Now look at the Python code for that while loop you created. Can you match the blocks to the Python? What do you notice about the Python code?",
2717
+ ),
2718
+ lambda: "If you cannot solve this one, try creating a solution without a while loop and then looking for what is repeated...",
2719
+ )
2720
+
2721
+ (
2722
+ title_level1009,
2723
+ description_level1009,
2724
+ hint_level1009,
2725
+ ) = (
2726
+ lambda: "This way, that way, forwards...",
2727
+ lambda: build_description(
2728
+ title_level1009(),
2729
+ "Think carefully about this one. It might be that some code is inside a loop and some code is not…",
2730
+ ),
2731
+ lambda: "You can solve this in stages. Try moving to the start of the repeated section, then adding the loop and then finishing it off.",
2732
+ )
2733
+
2734
+ (
2735
+ title_level1010,
2736
+ description_level1010,
2737
+ hint_level1010,
2738
+ commands_level1010,
2739
+ ) = (
2740
+ lambda: "Four leaf clover",
2741
+ lambda: build_description(
2742
+ title_level1010(),
2743
+ "Look for a pattern and then count how many times it repeats. Good luck!",
2744
+ ),
2745
+ lambda: "If you cannot solve this one, try creating a solution without a while loop and then looking for what is repeated...",
2746
+ lambda: "<b>Movement</b>"
2747
+ + "<br>my_van.move_forwards()"
2748
+ + "<br>my_van.turn_left()"
2749
+ + "<br>my_van.turn_right()",
2750
+ )
2751
+
2752
+ (
2753
+ title_level1011,
2754
+ description_level1011,
2755
+ hint_level1011,
2756
+ commands_level1011,
2757
+ ) = (
2758
+ lambda: "Pond life",
2759
+ lambda: build_description(
2760
+ title_level1011(),
2761
+ "There is a pattern of moves in this one too. Can you spot it?",
2762
+ ),
2763
+ lambda: "What if you go down the middle section?",
2764
+ lambda: "<b>Movement</b>"
2765
+ + "<br>my_van.move_forwards()"
2766
+ + "<br>my_van.turn_left()"
2767
+ + "<br>my_van.turn_right()",
2768
+ )
2769
+
2770
+ (
2771
+ title_level1012,
2772
+ description_level1012,
2773
+ hint_level1012,
2774
+ commands_level1012,
2775
+ ) = (
2776
+ lambda: "Farmyard overdrive",
2777
+ lambda: build_description(
2778
+ title_level1012(),
2779
+ "Look for a pattern before you type any code. You can solve this one with a counted loop…",
2780
+ ),
2781
+ lambda: "Try that middle route...",
2782
+ lambda: "<b>Movement</b>"
2783
+ + "<br>my_van.move_forwards()"
2784
+ + "<br>my_van.turn_left()"
2785
+ + "<br>my_van.turn_right()",
2786
+ )
2787
+
2788
+ (
2789
+ title_level1013,
2790
+ description_level1013,
2791
+ hint_level1013,
2792
+ commands_level1013,
2793
+ ) = (
2794
+ lambda: "Snnnaaaake reflection",
2795
+ lambda: build_description(
2796
+ title_level1013(),
2797
+ "The solution to this one is just a bit longer. Build it up slowly. Good luck!",
2798
+ ),
2799
+ lambda: "Don't try to solve this in one go. Work out the pattern for the top route and check that works. Then move on to the next part...",
2800
+ lambda: "<b>Movement</b>"
2801
+ + "<br>my_van.move_forwards()"
2802
+ + "<br>my_van.turn_left()"
2803
+ + "<br>my_van.turn_right()",
2804
+ )
2805
+
2806
+ (
2807
+ title_level1014,
2808
+ description_level1014,
2809
+ hint_level1014,
2810
+ ) = (
2811
+ lambda: "Too many cows",
2812
+ lambda: build_description(
2813
+ title_level1014(),
2814
+ "This is a nice long straight road, but there are cows about!",
2815
+ ),
2816
+ lambda: "Make sure you sound the horn to get the cows off the road.",
2817
+ )
2818
+
2819
+ (
2820
+ title_level1015,
2821
+ description_level1015,
2822
+ hint_level1015,
2823
+ ) = (
2824
+ lambda: "Stepping it up",
2825
+ lambda: build_description(
2826
+ title_level1015(), "There are some bends in this road. Be careful!"
2827
+ ),
2828
+ lambda: "What do you need to count, how many times you move or how many times you move forwards?",
2829
+ )
2830
+
2831
+ (title_level1016, description_level1016, hint_level1016, commands_level1016) = (
2832
+ lambda: "Cows on the stairs",
2833
+ lambda: build_description(
2834
+ title_level1016(),
2835
+ "Oh no! The farmer seems to have let their cows out again. Be careful.",
2836
+ ),
2837
+ lambda: "Look for a pattern here...",
2838
+ lambda: '<div class="row">'
2839
+ + '<div class="large-4 columns">'
2840
+ + "<b>Movement</b>"
2841
+ + "<br>my_van.turn_left()"
2842
+ + "<br>my_van.turn_right()</div>"
2843
+ + "</div>"
2844
+ + '<div class="row">'
2845
+ + '<div class="large-4 columns">'
2846
+ + "<p><b>Animals</b>"
2847
+ + "<br>my_van.is_animal_crossing()"
2848
+ + "<br>my_van.sound_horn()</div>"
2849
+ + "</div>",
2850
+ )
2851
+
2852
+ (title_level1017, description_level1017, hint_level1017, commands_level1017) = (
2853
+ lambda: "Try stepping in Python!",
2854
+ lambda: build_description(
2855
+ title_level1017(),
2856
+ "Keep going, you're getting the hang of the Python code.",
2857
+ ),
2858
+ lambda: "So you are going forward unless...?",
2859
+ lambda: '<div class="row">'
2860
+ + '<div class="large-4 columns">'
2861
+ + "<b>Movement</b>"
2862
+ + "<br>my_van.move_forwards()"
2863
+ + "<br>my_van.turn_left()"
2864
+ + "<br>my_van.turn_right()</div>"
2865
+ + '<div class="large-4 columns">'
2866
+ + "<b>Position</b>"
2867
+ + "<br>my_van.is_road_left()</div>"
2868
+ + '<div class="large-4 columns"></div></div>',
2869
+ )
2870
+
2871
+ (title_level1018, description_level1018, hint_level1018, commands_level1018) = (
2872
+ lambda: "A long and winding road",
2873
+ lambda: build_description(title_level1018(), "Oh dear, you might get a bit dizzy!"),
2874
+ lambda: "What are you counting here, straight roads or bends?",
2875
+ lambda: '<div class="row">'
2876
+ + '<div class="large-4 columns">'
2877
+ + "<b>Movement</b>"
2878
+ + "<br>my_van.move_forwards()"
2879
+ + "<br>my_van.turn_left()</div>"
2880
+ + '<div class="large-4 columns">'
2881
+ + "<b>Position</b>"
2882
+ + "<br>my_van.is_road_left()</div>"
2883
+ + '<div class="large-4 columns"></div></div>',
2884
+ )
2885
+
2886
+ (
2887
+ title_level1019,
2888
+ description_level1019,
2889
+ hint_level1019,
2890
+ ) = (
2891
+ lambda: "Try this level... or <b>else</b>!",
2892
+ lambda: build_description(
2893
+ title_level1019(),
2894
+ "Have you noticed that there are more roads ahead than turns? Try checking if there is a road ahead and then otherwise making the turns you need...",
2895
+ ),
2896
+ lambda: "Remember to use if..else",
2897
+ )
2898
+
2899
+ (title_level1020, description_level1020, hint_level1020, commands_level1020) = (
2900
+ lambda: "Now try one in Python!",
2901
+ lambda: build_description(
2902
+ title_level1020(), "Use if..else in Python for this level"
2903
+ ),
2904
+ lambda: "Don't get distracted by the other roads. Look for a pattern you can repeat.",
2905
+ lambda: '<div class="row">'
2906
+ + '<div class="large-4 columns">'
2907
+ + "<b>Movement</b>"
2908
+ + "<br>my_van.turn_left()"
2909
+ + "<br>my_van.turn_right()</div>"
2910
+ + '<div class="large-4 columns">'
2911
+ + "<b>Position</b>"
2912
+ + "<br>my_van.is_road_left()</div>"
2913
+ + '<div class="large-4 columns"></div></div>',
2914
+ )
2915
+
2916
+ (title_level1021, description_level1021, hint_level1021, commands_level1021) = (
2917
+ lambda: "What if there are multiple houses?",
2918
+ lambda: build_description(
2919
+ title_level1021(),
2920
+ "This is a really busy road. Make sure that you don't miss any of the houses.",
2921
+ ),
2922
+ lambda: "Did you get the last house? Think about what value the loop counter will have at that point in your code...",
2923
+ lambda: '<div class="row">'
2924
+ + '<div class="large-4 columns">'
2925
+ + "<b>Movement</b>"
2926
+ + "<br>my_van.move_forwards()"
2927
+ + "<br>my_van.turn_left()"
2928
+ + "<br>my_van.turn_right()"
2929
+ + "<br>my_van.deliver()</div>"
2930
+ + '<div class="large-4 columns">'
2931
+ + "<b>Position</b>"
2932
+ + "<br>my_van.is_road_left()</div>"
2933
+ + '<div class="large-4 columns"></div></div>',
2934
+ )
2935
+
2936
+ (
2937
+ title_level1022,
2938
+ description_level1022,
2939
+ hint_level1022,
2940
+ ) = (
2941
+ lambda: "Count and check",
2942
+ lambda: build_description(
2943
+ title_level1022(), "There are lots of turns here, don't get distracted."
2944
+ ),
2945
+ lambda: "Think about the order of the questions you ask using your if and elif statements.",
2946
+ )
2947
+
2948
+ (
2949
+ title_level1023,
2950
+ description_level1023,
2951
+ hint_level1023,
2952
+ ) = (
2953
+ lambda: "Another twisty trip",
2954
+ lambda: build_description(title_level1023(), "Don't go the long way around!"),
2955
+ lambda: "Think carefully about the order in which you ask questions in your if..else if block",
2956
+ )
2957
+
2958
+ (title_level1024, description_level1024, hint_level1024, commands_level1024) = (
2959
+ lambda: "Give Python a go!",
2960
+ lambda: build_description(
2961
+ title_level1024(), "Look carefully for the shortest route."
2962
+ ),
2963
+ lambda: "Think carefully about the order in which you ask questions in your if..elif statements.",
2964
+ lambda: '<div class="row">'
2965
+ + '<div class="large-4 columns">'
2966
+ + "<b>Movement</b>"
2967
+ + "<br>my_van.move_forwards()"
2968
+ + "<br>my_van.turn_left()"
2969
+ + "<br>my_van.turn_right()</div>"
2970
+ + '<div class="large-4 columns">'
2971
+ + "<b>Position</b>"
2972
+ + "<br>my_van.is_road_forward()"
2973
+ + "<br>my_van.is_road_left()</div>"
2974
+ + '<div class="large-4 columns"></div></div>',
2975
+ )
2976
+
2977
+ (title_level1025, description_level1025, hint_level1025, commands_level1025) = (
2978
+ lambda: "Now we've added a traffic light",
2979
+ lambda: build_description(
2980
+ title_level1025(), "Look carefully for the shortest route."
2981
+ ),
2982
+ lambda: "Think carefully about the order in which you ask questions in your if..elif statements. Don't forget the traffic lights.",
2983
+ lambda: '<div class="row">'
2984
+ + '<div class="large-4 columns">'
2985
+ + "<b>Movement</b>"
2986
+ + "<br>my_van.move_forwards()"
2987
+ + "<br>my_van.turn_left()"
2988
+ + "<br>my_van.turn_right()"
2989
+ + "<br>my_van.wait()</div>"
2990
+ + '<div class="large-4 columns">'
2991
+ + "<b>Position</b>"
2992
+ + "<br>my_van.is_road_forward()"
2993
+ + "<br>my_van.is_road_left()"
2994
+ + "<br>my_van.at_red_traffic_light()</div>"
2995
+ + '<div class="large-4 columns"></div></div>',
2996
+ )
2997
+
2998
+ (
2999
+ title_level1026,
3000
+ description_level1026,
3001
+ hint_level1026,
3002
+ ) = (
3003
+ lambda: title_level85(),
3004
+ lambda: description_level85(),
3005
+ lambda: hint_level85(),
3006
+ )
3007
+
3008
+ (
3009
+ title_level1027,
3010
+ description_level1027,
3011
+ hint_level1027,
3012
+ ) = (
3013
+ lambda: "Full steam ahead",
3014
+ lambda: build_description(
3015
+ title_level1027(), "Just keep going until you get there..."
3016
+ ),
3017
+ lambda: "You might find that the solution to this level is quite familiar...",
3018
+ )
3019
+
3020
+ (
3021
+ title_level1028,
3022
+ description_level1028,
3023
+ hint_level1028,
3024
+ ) = (
3025
+ lambda: "Another staircase...",
3026
+ lambda: build_description(
3027
+ title_level1028(),
3028
+ "Well done, you did it! Now have a go at using the <b>Repeat while</b> block on a road with lots of turns.",
3029
+ ),
3030
+ lambda: "This is another route you have seen before. Last time you counted how many times your instructions were repeated. This time, your program is going to repeat your commands until you reach the destination. What do you need to repeat?",
3031
+ )
3032
+
3033
+ (
3034
+ title_level1029,
3035
+ description_level1029,
3036
+ hint_level1029,
3037
+ ) = (
3038
+ lambda: title_level1010(),
3039
+ lambda: description_level1010(),
3040
+ lambda: hint_level1010(),
3041
+ )
3042
+
3043
+ (title_level1030, description_level1030, hint_level1030, commands_level1030) = (
3044
+ lambda: title_level84(),
3045
+ lambda: build_description(
3046
+ title_level1030(),
3047
+ "Well done, you did it! Now have a go at coding with Repeats in Python only.",
3048
+ ),
3049
+ lambda: hint_level84(),
3050
+ lambda: '<div class="row">'
3051
+ + '<div class="large-4 columns">'
3052
+ + "<b>Movement</b>"
3053
+ + "<br>my_van.turn_left()"
3054
+ + "<br>my_van.turn_right()</div>"
3055
+ + '<div class="large-4 columns">'
3056
+ + "<b>Position</b>"
3057
+ + "<br>my_van.at_destination()</div>"
3058
+ + '<div class="large-4 columns"></div></div>',
3059
+ )
3060
+
3061
+ (
3062
+ title_level1031,
3063
+ description_level1031,
3064
+ hint_level1031,
3065
+ ) = (
3066
+ lambda: title_level34(),
3067
+ lambda: description_level34(),
3068
+ lambda: hint_level34(),
3069
+ )
3070
+
3071
+ (
3072
+ title_level1032,
3073
+ description_level1032,
3074
+ hint_level1032,
3075
+ ) = (
3076
+ lambda: "Something isn't <b>right</b>",
3077
+ lambda: build_description(
3078
+ title_level1032(),
3079
+ "You don't have a right turn block here, so plan your route carefully.",
3080
+ ),
3081
+ lambda: "Think carefully about the order in which you ask questions in your if-statement here...",
3082
+ )
3083
+
3084
+ (title_level1033, description_level1033, hint_level1033, commands_level1033) = (
3085
+ lambda: "Looking both ways",
3086
+ lambda: build_description(title_level1033(), "Can you find the shortest route?"),
3087
+ lambda: "In this level, you want to check for a left turn first. If there is no left turn, turn right. Keep in mind what that looks like in Python.",
3088
+ lambda: '<div class="row">'
3089
+ + '<div class="large-4 columns">'
3090
+ + "<b>Movement</b>"
3091
+ + "<br>my_van.turn_left()"
3092
+ + "<br>my_van.turn_right()</div>"
3093
+ + '<div class="large-4 columns">'
3094
+ + "<b>Position</b>"
3095
+ + "<br>my_van.is_road_left()"
3096
+ + "<br>my_van.at_destination()</div>"
3097
+ + '<div class="large-4 columns"></div></div>',
3098
+ )
3099
+
3100
+ (title_level1034, description_level1034, hint_level1034, commands_level1034) = (
3101
+ lambda: "The pond is nice but out of the way",
3102
+ lambda: build_description(
3103
+ title_level1034(),
3104
+ "Can you find the shortest route? Don't take the scenic route.",
3105
+ ),
3106
+ lambda: "Just look for the simplest route to the house.",
3107
+ lambda: '<div class="row">'
3108
+ + '<div class="large-4 columns">'
3109
+ + "<b>Movement</b>"
3110
+ + "<br>my_van.move_forwards()"
3111
+ + "<br>my_van.turn_right()</div>"
3112
+ + '<div class="large-4 columns">'
3113
+ + "<b>Position</b>"
3114
+ + "<br>my_van.is_road_right()"
3115
+ + "<br>my_van.at_destination()</div>"
3116
+ + '<div class="large-4 columns"></div></div>',
3117
+ )
3118
+
3119
+ (
3120
+ title_level1035,
3121
+ description_level1035,
3122
+ hint_level1035,
3123
+ ) = (
3124
+ lambda: title_level99(),
3125
+ lambda: build_description(
3126
+ title_level99(),
3127
+ "Now try using what you have just learnt to solve this level. You could also try using the if, elif and else statements.",
3128
+ ),
3129
+ lambda: hint_level99(),
3130
+ )
3131
+
3132
+ (
3133
+ title_level1036,
3134
+ description_level1036,
3135
+ hint_level1036,
3136
+ ) = (
3137
+ lambda: title_level38(),
3138
+ lambda: description_level38(),
3139
+ lambda: hint_level38(),
3140
+ )
3141
+
3142
+ (title_level1037, description_level1037, hint_level1037, commands_level1037) = (
3143
+ lambda: title_level100(),
3144
+ lambda: build_description(
3145
+ title_level100(),
3146
+ "Practice your new Python skills on this road to get the van to the destination.",
3147
+ ),
3148
+ lambda: hint_level100(),
3149
+ lambda: commands_level100(),
3150
+ )
3151
+
3152
+ (title_level1038, description_level1038, hint_level1038, commands_level1038) = (
3153
+ lambda: title_level39(),
3154
+ lambda: description_level39(),
3155
+ lambda: hint_level39(),
3156
+ lambda: '<div class="row">'
3157
+ + '<div class="large-4 columns">'
3158
+ + "<b>Movement</b>"
3159
+ + "<br>my_van.move_forwards()"
3160
+ + "<br>my_van.turn_around()"
3161
+ + "<br>my_van.turn_right()</div>"
3162
+ + '<div class="large-4 columns">'
3163
+ + "<b>Position</b>"
3164
+ + "<br>my_van.at_destination()"
3165
+ + "<br>my_van.is_road_forward()"
3166
+ + "<br>my_van.at_dead_end()</div>"
3167
+ + '<div class="large-4 columns"></div></div>'
3168
+ + '<div class="row">'
3169
+ + '<div class="large-4 columns">'
3170
+ + "<p><b>Animals</b>"
3171
+ + "<br>my_van.is_animal_crossing()"
3172
+ + "<br>my_van.sound_horn()</div>"
3173
+ + "</div>",
3174
+ )
3175
+
3176
+ (title_level1039, description_level1039, hint_level1039, commands_level1039) = (
3177
+ lambda: title_level47(),
3178
+ lambda: build_description(
3179
+ title_level47(),
3180
+ "Put your knowledge to test. Create an algorithm to lead the van to the house. Don't forget to turn and avoid the cows.",
3181
+ ),
3182
+ lambda: hint_level47(),
3183
+ lambda: '<div class="row">'
3184
+ + '<div class="large-4 columns">'
3185
+ + "<b>Movement</b>"
3186
+ + "<br>my_van.move_forwards()"
3187
+ + "<br>my_van.turn_left()</div>"
3188
+ + '<div class="large-4 columns">'
3189
+ + "<b>Position</b>"
3190
+ + "<br>my_van.at_destination()"
3191
+ + "<br>my_van.is_road_forward()</div>"
3192
+ + '<div class="large-4 columns"></div></div>'
3193
+ + '<div class="row">'
3194
+ + '<div class="large-4 columns">'
3195
+ + "<p><b>Animals</b>"
3196
+ + "<br>my_van.is_animal_crossing()"
3197
+ + "<br>my_van.sound_horn()</div>"
3198
+ + "</div>",
3199
+ )
3200
+
3201
+ (title_level1040, description_level1040, hint_level1040, commands_level1040) = (
3202
+ lambda: title_level48(),
3203
+ lambda: description_level48(),
3204
+ lambda: hint_level48(),
3205
+ lambda: '<div class="row">'
3206
+ + '<div class="large-4 columns">'
3207
+ + "<b>Movement</b>"
3208
+ + "<br>my_van.move_forwards()"
3209
+ + "<br>my_van.turn_around()"
3210
+ + "<br>my_van.turn_left()"
3211
+ + "<br>my_van.turn_right()"
3212
+ + "<br>my_van.wait()"
3213
+ + "<br>my_van.deliver()</div>"
3214
+ + '<div class="large-4 columns">'
3215
+ + "<b>Position</b>"
3216
+ + "<br>my_van.at_red_traffic_light()"
3217
+ + "<br>my_van.at_destination()"
3218
+ + "<br>my_van.is_road_forward()"
3219
+ + "<br>my_van.is_road_left()"
3220
+ + "<br>my_van.is_road_right()"
3221
+ + "<br>my_van.at_dead_end()</div>"
3222
+ + '<div class="large-4 columns"></div></div>',
3223
+ )
3224
+
3225
+ (
3226
+ title_level1041,
3227
+ description_level1041,
3228
+ hint_level1041,
3229
+ ) = (
3230
+ lambda: title_level83(),
3231
+ lambda: description_level83(),
3232
+ lambda: hint_level83(),
3233
+ )
3234
+
3235
+ (title_level1042, description_level1042, hint_level1042, commands_level1042) = (
3236
+ lambda: title_level95(),
3237
+ lambda: build_description(
3238
+ title_level95(),
3239
+ "Now try to use a <b>repeat</b> loop to solve this level. Look back at level 41 to see what this could look like in Python.",
3240
+ ),
3241
+ lambda: hint_level95(),
3242
+ lambda: commands_level95(),
3243
+ )
3244
+
3245
+ (title_level1043, description_level1043, hint_level1043, commands_level1043) = (
3246
+ lambda: title_level96(),
3247
+ lambda: build_description(
3248
+ title_level96(),
3249
+ "Now try to use a <b>repeat</b> loop to solve this level. Look back at level 41 to see what this could look like in Python. This time you could use 2 loops, 1 for each straight piece of road.",
3250
+ ),
3251
+ lambda: hint_level96(),
3252
+ lambda: commands_level96(),
3253
+ )
3254
+
3255
+ (
3256
+ title_level1044,
3257
+ description_level1044,
3258
+ hint_level1044,
3259
+ ) = (
3260
+ lambda: title_level84(),
3261
+ lambda: description_level84(),
3262
+ lambda: hint_level84(),
3263
+ )
3264
+
3265
+ (title_level1045, description_level1045, hint_level1045, commands_level1045) = (
3266
+ lambda: title_level97(),
3267
+ lambda: build_description(
3268
+ title_level97(),
3269
+ "Now try to use a loop within a loop, known as a 'nested loop'. Look back at level 44 to see what this could look like in Python.",
3270
+ ),
3271
+ lambda: hint_level97(),
3272
+ lambda: commands_level97(),
3273
+ )
3274
+
3275
+ (title_level1046, description_level1046, hint_level1046, commands_level1046) = (
3276
+ lambda: title_level106(),
3277
+ lambda: description_level106(),
3278
+ lambda: hint_level106(),
3279
+ lambda: commands_level106(),
3280
+ )
3281
+
3282
+ (title_level1047, description_level1047, hint_level1047, commands_level1047) = (
3283
+ lambda: title_level107(),
3284
+ lambda: description_level107(),
3285
+ lambda: hint_level107(),
3286
+ lambda: commands_level107(),
3287
+ )
3288
+
3289
+ (title_level1048, description_level1048, hint_level1048, commands_level1048) = (
3290
+ lambda: title_level108(),
3291
+ lambda: description_level108(),
3292
+ lambda: hint_level108(),
3293
+ lambda: commands_level108(),
3294
+ )
3295
+
3296
+ (title_level1049, description_level1049, hint_level1049, commands_level1049) = (
3297
+ lambda: title_level109(),
3298
+ lambda: description_level109(),
3299
+ lambda: hint_level109(),
3300
+ lambda: commands_level109(),
3301
+ )
3302
+
3303
+ (
3304
+ title_level1050,
3305
+ description_level1050,
3306
+ hint_level1050,
3307
+ ) = (
3308
+ lambda: title_level61(),
3309
+ lambda: description_level61(),
3310
+ lambda: hint_level61(),
3311
+ )
3312
+
3313
+ (
3314
+ title_level1051,
3315
+ description_level1051,
3316
+ hint_level1051,
3317
+ ) = (
3318
+ lambda: title_level62(),
3319
+ lambda: description_level62(),
3320
+ lambda: hint_level62(),
3321
+ )
3322
+
3323
+ (title_level1052, description_level1052, hint_level1052, commands_level1052) = (
3324
+ lambda: title_level63(),
3325
+ lambda: description_level63(),
3326
+ lambda: hint_level63(),
3327
+ lambda: "<b>Movement</b>"
3328
+ + "<br>my_van.move_forwards()"
3329
+ + "<br>my_van.turn_left()"
3330
+ + "<br>my_van.turn_right()",
3331
+ )
3332
+
3333
+ (title_level1053, description_level1053, hint_level1053, commands_level1053) = (
3334
+ lambda: title_level64(),
3335
+ lambda: description_level64(),
3336
+ lambda: hint_level64(),
3337
+ lambda: "<b>Movement</b>"
3338
+ + "<br>my_van.move_forwards()"
3339
+ + "<br>my_van.turn_left()"
3340
+ + "<br>my_van.turn_right()",
3341
+ )
3342
+
3343
+ (title_level1054, description_level1054, hint_level1054, commands_level1054) = (
3344
+ lambda: title_level65(),
3345
+ lambda: description_level65(),
3346
+ lambda: hint_level65(),
3347
+ lambda: "<b>Movement</b>"
3348
+ + "<br>my_van.move_forwards()"
3349
+ + "<br>my_van.turn_left()"
3350
+ + "<br>my_van.turn_right()",
3351
+ )
3352
+
3353
+ (title_level1055, description_level1055, hint_level1055, commands_level1055) = (
3354
+ lambda: title_level66(),
3355
+ lambda: description_level66(),
3356
+ lambda: hint_level66(),
3357
+ lambda: "<b>Movement</b>"
3358
+ + "<br>my_van.move_forwards()"
3359
+ + "<br>my_van.turn_left()"
3360
+ + "<br>my_van.turn_right()",
3361
+ )
3362
+
3363
+ (title_level1056, description_level1056, hint_level1056, commands_level1056) = (
3364
+ lambda: title_level67(),
3365
+ lambda: description_level67(),
3366
+ lambda: hint_level67(),
3367
+ lambda: "<b>Movement</b>"
3368
+ + "<br>my_van.move_forwards()"
3369
+ + "<br>my_van.turn_left()"
3370
+ + "<br>my_van.turn_right()",
3371
+ )
3372
+
3373
+ (title_level1057, description_level1057, hint_level1057, commands_level1057) = (
3374
+ lambda: "Have a go at procedures",
3375
+ lambda: build_description(
3376
+ title_level1057(),
3377
+ "Try adding a procedure and watch what happens in Python.",
3378
+ ),
3379
+ lambda: hint_level90(),
3380
+ lambda: "<b>Movement</b>"
3381
+ + "<br>my_van.move_forwards()"
3382
+ + "<br>my_van.turn_left()"
3383
+ + "<br>my_van.turn_right()",
3384
+ )
3385
+
3386
+ (title_level1058, description_level1058, hint_level1058, commands_level1058) = (
3387
+ lambda: title_level91(),
3388
+ lambda: build_description(
3389
+ title_level1058(),
3390
+ "Try adding a procedure and watch what happens in Python.",
3391
+ ),
3392
+ lambda: hint_level91(),
3393
+ lambda: "<b>Movement</b>"
3394
+ + "<br>my_van.move_forwards()"
3395
+ + "<br>my_van.turn_left()"
3396
+ + "<br>my_van.turn_right()",
3397
+ )
3398
+
3399
+ (title_level1059, description_level1059, hint_level1059, commands_level1059) = (
3400
+ lambda: title_level101(),
3401
+ lambda: build_description(
3402
+ title_level101(),
3403
+ "Try defining your own procedure to solve this level. In Python procedures are generally called functions. Look back at the previous levels for examples of how to define a function in Python.",
3404
+ ),
3405
+ lambda: hint_level101(),
3406
+ lambda: commands_level101(),
3407
+ )
3408
+
3409
+ (title_level1060, description_level1060, hint_level1060, commands_level1060) = (
3410
+ lambda: title_level102(),
3411
+ lambda: description_level102(),
3412
+ lambda: hint_level102(),
3413
+ lambda: commands_level102(),
3414
+ )
3415
+
3416
+
3417
+ # Episode titles
2416
3418
  def get_episode_title(episode_id):
2417
3419
  episode_titles = {
2418
3420
  1: "Getting Started",
@@ -2426,6 +3428,19 @@ def get_episode_title(episode_id):
2426
3428
  9: "Blockly Brain Teasers",
2427
3429
  10: "Introduction to Python",
2428
3430
  11: "Python",
3431
+ 12: "Counted Loops Using While",
3432
+ 13: "Selection in a Loop",
3433
+ 14: "Indeterminate Loops",
3434
+ 15: "For Loops",
3435
+ 16: "Output, Operators, and Data",
3436
+ 17: "Variables, Input, and Casting",
3437
+ 18: "Selection",
3438
+ 19: "Complex Selection",
3439
+ 20: "String Manipulation",
3440
+ 21: "Lists",
3441
+ 22: "Procedures",
3442
+ 23: "2D Lists",
3443
+ 24: "Procedures and Functions",
2429
3444
  }
2430
3445
 
2431
3446
  return episode_titles[episode_id]