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
@@ -1,26 +1,27 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
3
  var ocargo = ocargo || {};
4
4
 
5
5
  ocargo.BlocklyControl = function () {
6
- this.blocklyCustomisations = new ocargo.BlocklyCustomisations();
7
- this.blocklyCustomisations.setupDoubleclick();
8
- this.blocklyCustomisations.setupLimitedBlocks();
9
- this.blocklyDiv = document.getElementById('blockly_holder');
10
- this.toolbox = document.getElementById('blockly_toolbox');
11
- Blockly.inject(this.blocklyDiv, {
12
- path: '/static/game/js/blockly/',
13
- toolbox: BLOCKLY_XML,
14
- trashcan: true,
15
- scrollbars: true,
16
- maxInstances: maxInstances
17
- });
18
-
19
- // Stop the flyout from closing automatically
20
- Blockly.Flyout.autoClose = false;
21
-
22
- this.blocklyCustomisations.addLimitedBlockListeners(Blockly.mainWorkspace);
23
- this.blocklyCustomisations.addClickListenerToStartBlock();
6
+ this.blocklyCustomisations = new ocargo.BlocklyCustomisations();
7
+ this.blocklyCustomisations.setupDoubleclick();
8
+ this.blocklyCustomisations.setupLimitedBlocks();
9
+ this.blocklyDiv = document.getElementById("blockly_holder");
10
+ this.toolbox = document.getElementById("blockly_toolbox");
11
+
12
+ Blockly.inject(this.blocklyDiv, {
13
+ path: "/static/game/js/blockly/",
14
+ toolbox: BLOCKLY_XML,
15
+ trashcan: true,
16
+ scrollbars: true,
17
+ maxInstances: maxInstances,
18
+ });
19
+
20
+ // Stop the flyout from closing automatically
21
+ Blockly.Flyout.autoClose = false;
22
+
23
+ this.blocklyCustomisations.addLimitedBlockListeners(Blockly.mainWorkspace);
24
+ this.blocklyCustomisations.addClickListenerToStartBlock();
24
25
  };
25
26
 
26
27
  ocargo.BlocklyControl.BLOCK_HEIGHT = 20;
@@ -33,166 +34,176 @@ ocargo.BlocklyControl.BLOCK_CHARACTER_WIDTH = 40;
33
34
  ocargo.BlocklyControl.prototype.incorrectBlock = null;
34
35
  ocargo.BlocklyControl.prototype.incorrectBlockColour = null;
35
36
 
36
- ocargo.BlocklyControl.prototype.prepare = function(blocks) {
37
- try {
38
- return {
39
- success:true,
40
- program: blocks? ocargo.blocklyCompiler.mobileCompile(blocks) : ocargo.blocklyCompiler.compile()
41
- };
42
- } catch (error) {
43
- return {
44
- success:false,
45
- error: gettext('Your program doesn\'t look quite right...') + "<br><br>" + gettext(error)
46
- };
47
- }
37
+ ocargo.BlocklyControl.prototype.prepare = function (blocks) {
38
+ try {
39
+ return {
40
+ success: true,
41
+ program: blocks
42
+ ? ocargo.blocklyCompiler.mobileCompile(blocks)
43
+ : ocargo.blocklyCompiler.compile(),
44
+ };
45
+ } catch (error) {
46
+ return {
47
+ success: false,
48
+ error:
49
+ gettext("Your program doesn't look quite right...") +
50
+ "<br><br>" +
51
+ gettext(error),
52
+ };
53
+ }
48
54
  };
49
55
 
50
- ocargo.BlocklyControl.prototype.redrawBlockly = function() {
51
- Blockly.svgResize(Blockly.mainWorkspace);
56
+ ocargo.BlocklyControl.prototype.redrawBlockly = function () {
57
+ Blockly.svgResize(Blockly.mainWorkspace);
52
58
  };
53
59
 
54
60
  ocargo.BlocklyControl.prototype.clearIncorrectBlock = function () {
55
- this.incorrectBlock = null;
56
- }
61
+ this.incorrectBlock = null;
62
+ };
57
63
 
58
64
  function wasGameStarted(blocks) {
59
- let gameStarted = false;
60
- for (let block of blocks) {
61
- if (block.type == 'start') gameStarted = true;
62
- }
63
- return gameStarted;
65
+ let gameStarted = false;
66
+ for (let block of blocks) {
67
+ if (block.type == "start") gameStarted = true;
68
+ }
69
+ return gameStarted;
64
70
  }
65
71
 
66
- ocargo.BlocklyControl.prototype.reset = function() {
72
+ ocargo.BlocklyControl.prototype.reset = function () {
73
+ let allBlocks = Blockly.mainWorkspace.getAllBlocks();
67
74
 
68
- let allBlocks = Blockly.mainWorkspace.getAllBlocks()
69
-
70
- for (let block of allBlocks) {
71
- if (block.type != 'start') block.dispose(true)
72
- }
75
+ for (let block of allBlocks) {
76
+ if (block.type != "start") block.dispose(true);
77
+ }
73
78
 
74
- // Each time a game starts the clear function is called.
75
- // Therefore a simple check is preformed to see if the level
76
- // has a start button, if not then create a start button
77
- if (!wasGameStarted(allBlocks)) {
78
- let startBlock = this.createBlock('start');
79
- startBlock.moveBy(30+(i%2)*200,30+Math.floor(i/2)*100);
80
- }
79
+ // Each time a game starts the clear function is called.
80
+ // Therefore a simple check is preformed to see if the level
81
+ // has a start button, if not then create a start button
82
+ if (!wasGameStarted(allBlocks)) {
83
+ let startBlock = this.createBlock("start");
84
+ // Generate the first block on the (100, 100) position
85
+ startBlock.moveBy(100, 100);
86
+ }
81
87
 
82
- this.clearIncorrectBlock();
88
+ this.clearIncorrectBlock();
83
89
  };
84
90
 
85
- ocargo.BlocklyControl.prototype.deserialize = function(text) {
86
- try {
87
- var oldXml = Blockly.Xml.workspaceToDom(Blockly.mainWorkspace);
88
-
89
- var newXml = Blockly.Xml.textToDom(text);
90
- Blockly.mainWorkspace.clear();
91
- Blockly.Xml.domToWorkspace(newXml, Blockly.mainWorkspace);
92
- var legal = this.removeIllegalBlocks();
93
-
94
- if (!legal) {
95
- ocargo.Drawing.startPopup(
96
- gettext('Loading workspace'),
97
- "",
98
- gettext('Sorry, this workspace has blocks in it that aren\'t allowed in this level!'),
99
- true
100
- );
101
- Blockly.mainWorkspace.clear();
102
- Blockly.Xml.domToWorkspace(oldXml, Blockly.mainWorkspace);
103
- }
104
- } catch (e) {
105
- console.log(e);
106
- this.reset();
91
+ ocargo.BlocklyControl.prototype.deserialize = function (text) {
92
+ try {
93
+ var oldXml = Blockly.Xml.workspaceToDom(Blockly.mainWorkspace);
94
+
95
+ var newXml = Blockly.Xml.textToDom(text);
96
+ Blockly.mainWorkspace.clear();
97
+ Blockly.Xml.domToWorkspace(newXml, Blockly.mainWorkspace);
98
+ var legal = this.removeIllegalBlocks();
99
+
100
+ if (!legal) {
101
+ ocargo.Drawing.startPopup(
102
+ gettext("Loading workspace"),
103
+ "",
104
+ gettext(
105
+ "Sorry, this workspace has blocks in it that aren't allowed in this level!"
106
+ ),
107
+ true
108
+ );
109
+ Blockly.mainWorkspace.clear();
110
+ Blockly.Xml.domToWorkspace(oldXml, Blockly.mainWorkspace);
107
111
  }
112
+ } catch (e) {
113
+ console.log(e);
114
+ this.reset();
115
+ }
108
116
  };
109
117
 
110
- ocargo.BlocklyControl.prototype.serialize = function() {
111
- var xml = Blockly.Xml.workspaceToDom(Blockly.mainWorkspace);
112
- return Blockly.Xml.domToText(xml);
118
+ ocargo.BlocklyControl.prototype.serialize = function () {
119
+ var xml = Blockly.Xml.workspaceToDom(Blockly.mainWorkspace);
120
+ return Blockly.Xml.domToText(xml);
113
121
  };
114
122
 
115
- ocargo.BlocklyControl.prototype.removeIllegalBlocks = function() {
116
- // Buggy blockly doesn't serialise properly on Safari.
117
- var isSafari = navigator.userAgent.indexOf('Safari') !== -1 &&
118
- navigator.userAgent.indexOf('Chrome') === -1;
119
-
120
- var blocks = Blockly.mainWorkspace.getAllBlocks();
121
- blocks.sort(function(a, b) {
122
- return a.id - b.id;
123
- });
124
-
125
- var startCount = 1;
126
- var clean = true;
127
-
128
- for (var i = 0; i < blocks.length; i++) {
129
- var block = blocks[i];
130
-
131
- if (block.type !== 'start') {
132
- var found = false;
133
- for (var j = 0; j < BLOCKS.length; j++) {
134
- if (BLOCKS[j].type == block.type) {
135
- found = true;
136
- break;
137
- }
138
- }
139
-
140
- if (!found) {
141
- clean = false;
142
- block.dispose();
143
- }
144
- } else {
145
- startCount--;
146
- if (isSafari && startCount < 0) {
147
- block.dispose();
148
- }
123
+ ocargo.BlocklyControl.prototype.removeIllegalBlocks = function () {
124
+ // Buggy blockly doesn't serialise properly on Safari.
125
+ var isSafari =
126
+ navigator.userAgent.indexOf("Safari") !== -1 &&
127
+ navigator.userAgent.indexOf("Chrome") === -1;
128
+
129
+ var blocks = Blockly.mainWorkspace.getAllBlocks();
130
+ blocks.sort(function (a, b) {
131
+ return a.id - b.id;
132
+ });
133
+
134
+ var startCount = 1;
135
+ var clean = true;
136
+
137
+ for (var i = 0; i < blocks.length; i++) {
138
+ var block = blocks[i];
139
+
140
+ if (block.type !== "start") {
141
+ var found = false;
142
+ for (var j = 0; j < BLOCKS.length; j++) {
143
+ if (BLOCKS[j].type == block.type) {
144
+ found = true;
145
+ break;
149
146
  }
147
+ }
148
+
149
+ if (!found) {
150
+ clean = false;
151
+ block.dispose();
152
+ }
153
+ } else {
154
+ startCount--;
155
+ if (isSafari && startCount < 0) {
156
+ block.dispose();
157
+ }
150
158
  }
151
- if (startCount > 0) {
152
- this.reset();
153
- return true;
154
- }
155
- return clean;
159
+ }
160
+ if (startCount > 0) {
161
+ this.reset();
162
+ return true;
163
+ }
164
+ return clean;
156
165
  };
157
166
 
158
- ocargo.BlocklyControl.prototype.setCodeChangesAllowed = function(changesAllowed) {
159
- this.blocklyDiv.style.pointerEvents = changesAllowed ? "" : "none";
167
+ ocargo.BlocklyControl.prototype.setCodeChangesAllowed = function (
168
+ changesAllowed
169
+ ) {
170
+ this.blocklyDiv.style.pointerEvents = changesAllowed ? "" : "none";
160
171
  };
161
172
 
162
- ocargo.BlocklyControl.prototype.loadPreviousAttempt = function() {
163
- function decodeHTML(text) {
164
- var e = document.createElement('div');
165
- e.innerHTML = text;
166
- return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue;
167
- }
168
- // Use the user's last attempt if available
169
- if (WORKSPACE) {
170
- this.deserialize(decodeHTML(WORKSPACE));
171
- }
173
+ ocargo.BlocklyControl.prototype.loadPreviousAttempt = function () {
174
+ function decodeHTML(text) {
175
+ var e = document.createElement("div");
176
+ e.innerHTML = text;
177
+ return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue;
178
+ }
179
+ // Use the user's last attempt if available
180
+ if (WORKSPACE) {
181
+ this.deserialize(decodeHTML(WORKSPACE));
182
+ }
172
183
 
173
- this.redrawBlockly();
184
+ this.redrawBlockly();
174
185
  };
175
186
 
176
- ocargo.BlocklyControl.prototype.createBlock = function(blockType) {
177
- var block = Blockly.mainWorkspace.newBlock(blockType)
178
- // var block = Blockly.Block.obtain(Blockly.mainWorkspace, blockType);
179
- block.initSvg();
180
- block.render();
181
- return block;
187
+ ocargo.BlocklyControl.prototype.createBlock = function (blockType) {
188
+ var block = Blockly.mainWorkspace.newBlock(blockType);
189
+ // var block = Blockly.Block.obtain(Blockly.mainWorkspace, blockType);
190
+ block.initSvg();
191
+ block.render();
192
+ return block;
182
193
  };
183
194
 
184
- ocargo.BlocklyControl.prototype.addBlockToEndOfProgram = function(blockType) {
185
- var blockToAdd = this.createBlock(blockType);
195
+ ocargo.BlocklyControl.prototype.addBlockToEndOfProgram = function (blockType) {
196
+ var blockToAdd = this.createBlock(blockType);
186
197
 
187
- var block = this.startBlock();
188
- while (block.nextConnection.targetBlock()) {
189
- block = block.nextConnection.targetBlock();
190
- }
198
+ var block = this.startBlock();
199
+ while (block.nextConnection.targetBlock()) {
200
+ block = block.nextConnection.targetBlock();
201
+ }
191
202
 
192
- block.nextConnection.connect(blockToAdd.previousConnection);
203
+ block.nextConnection.connect(blockToAdd.previousConnection);
193
204
  };
194
205
 
195
- ocargo.BlocklyControl.prototype.disconnectedStartBlock = function() {
206
+ ocargo.BlocklyControl.prototype.disconnectedStartBlock = function () {
196
207
  var emptyStart = this.startBlock().getChildren().length == 0;
197
208
  if (emptyStart) {
198
209
  if (this.totalBlocksCount() > 1) {
@@ -205,110 +216,121 @@ ocargo.BlocklyControl.prototype.disconnectedStartBlock = function() {
205
216
  }
206
217
  };
207
218
 
208
- ocargo.BlocklyControl.prototype.startBlock = function() {
209
- return Blockly.mainWorkspace.getTopBlocks().filter(function (block) {
210
- return block.type === 'start';
211
- })[0];
219
+ ocargo.BlocklyControl.prototype.startBlock = function () {
220
+ return Blockly.mainWorkspace.getTopBlocks().filter(function (block) {
221
+ return block.type === "start";
222
+ })[0];
212
223
  };
213
224
 
214
- ocargo.BlocklyControl.prototype.procedureBlocks = function() {
215
- return Blockly.mainWorkspace.getTopBlocks().filter(function (block) {
216
- return block.type === 'declare_proc';
217
- });
225
+ ocargo.BlocklyControl.prototype.procedureBlocks = function () {
226
+ return Blockly.mainWorkspace.getTopBlocks().filter(function (block) {
227
+ return block.type === "declare_proc";
228
+ });
218
229
  };
219
230
 
220
- ocargo.BlocklyControl.prototype.onEventDoBlocks = function() {
221
- // find and return all top blocks that are event handler blocks
222
- var startBlocks = [];
223
- Blockly.mainWorkspace.getTopBlocks().forEach(function (block) {
224
- if (block.type === 'declare_event') {
225
- startBlocks.push(block);
226
- }
227
- });
228
- return startBlocks;
231
+ ocargo.BlocklyControl.prototype.onEventDoBlocks = function () {
232
+ // find and return all top blocks that are event handler blocks
233
+ var startBlocks = [];
234
+ Blockly.mainWorkspace.getTopBlocks().forEach(function (block) {
235
+ if (block.type === "declare_event") {
236
+ startBlocks.push(block);
237
+ }
238
+ });
239
+ return startBlocks;
229
240
  };
230
241
 
231
- ocargo.BlocklyControl.prototype.totalBlocksCount = function() {
232
- return Blockly.mainWorkspace.getAllBlocks().length;
242
+ ocargo.BlocklyControl.prototype.totalBlocksCount = function () {
243
+ return Blockly.mainWorkspace.getAllBlocks().length;
233
244
  };
234
245
 
235
- ocargo.BlocklyControl.prototype.activeBlocksCount = function() {
236
- var startBlock = this.startBlock();
237
- var procedureBlocks = this.procedureBlocks();
238
- var eventBlocks = this.onEventDoBlocks();
239
- var n = 0;
240
- var i;
241
-
242
- n += count(startBlock.nextConnection.targetBlock());
246
+ ocargo.BlocklyControl.prototype.activeBlocksCount = function () {
247
+ var startBlock = this.startBlock();
248
+ var procedureBlocks = this.procedureBlocks();
249
+ var eventBlocks = this.onEventDoBlocks();
250
+ var n = 0;
251
+ var i;
243
252
 
244
- // 1 includes the procedure declaration block
245
- for (i = 0; i < procedureBlocks.length; i++) {
246
- n += 1 + count(procedureBlocks[i].inputList[1].connection.targetBlock());
247
- }
253
+ n += count(startBlock.nextConnection.targetBlock());
248
254
 
249
- // 1 includes the on-event-do block
250
- for (i = 0; i < eventBlocks.length; i++) {
251
- n += 1 + count(eventBlocks[i].inputList[1].connection.targetBlock());
252
- }
255
+ // 1 includes the procedure declaration block
256
+ for (i = 0; i < procedureBlocks.length; i++) {
257
+ n += 1 + count(procedureBlocks[i].inputList[1].connection.targetBlock());
258
+ }
253
259
 
254
- return n;
260
+ // 1 includes the on-event-do block
261
+ for (i = 0; i < eventBlocks.length; i++) {
262
+ n += 1 + count(eventBlocks[i].inputList[1].connection.targetBlock());
263
+ }
255
264
 
265
+ return n;
256
266
 
257
- function count(block) {
258
- if (!block) {
259
- return 0;
260
- }
267
+ function count(block) {
268
+ if (!block) {
269
+ return 0;
270
+ }
261
271
 
262
- var n = 1;
263
-
264
- if (block.type === 'controls_repeat_until' || block.type === 'controls_repeat_while' ||
265
- block.type === 'controls_whileUntil') {
266
- var conditionBlock = block.inputList[0].connection.targetBlock();
267
- n += count(conditionBlock);
268
- var bodyBlock = block.inputList[1].connection.targetBlock();
269
- n += count(bodyBlock);
270
- var nextBlock = block.nextConnection.targetBlock();
271
- n += count(nextBlock);
272
- } else if (block.type === 'controls_repeat') {
273
- var bodyBlock = block.inputList[1].connection.targetBlock();
274
- n += count(bodyBlock);
275
- var nextBlock = block.nextConnection.targetBlock();
276
- n += count(nextBlock);
277
- } else if (block.type === 'controls_if') {
278
- var elseCount = block.elseCount_ || 0;
279
-
280
- for (var i = 0; i < block.inputList.length - elseCount; i++) {
281
- var input = block.inputList[i];
282
- if (input.name.indexOf('IF') === 0) {
283
- var conditionBlock = input.connection.targetBlock();
284
- n += count(conditionBlock);
285
- } else if (input.name.indexOf('DO') === 0) {
286
- var bodyBlock = input.connection.targetBlock();
287
- n += count(bodyBlock);
288
- }
289
- }
290
-
291
- if (elseCount === 1) {
292
- var elseBlock = block.inputList[block.inputList.length - 1]
293
- .connection.targetBlock();
294
- n += count(elseBlock);
295
- }
296
-
297
- var nextBlock = block.nextConnection.targetBlock();
298
- n += count(nextBlock);
299
- } else if (block.type === 'call_proc' || block.type === 'move_forwards' ||
300
- block.type === 'turn_left' || block.type === 'turn_right' ||
301
- block.type === 'turn_around' || block.type === 'wait' ||
302
- block.type === 'deliver') {
303
- var nextBlock = block.nextConnection.targetBlock();
304
- n += count(nextBlock);
305
- } else if (block.type === 'logic_negate') {
306
- var conditionBlock = block.inputList[0].connection.targetBlock();
307
- n += count(conditionBlock);
272
+ var n = 1;
273
+
274
+ if (
275
+ block.type === "controls_repeat_until" ||
276
+ block.type === "controls_repeat_while" ||
277
+ block.type === "controls_whileUntil"
278
+ ) {
279
+ var conditionBlock = block.inputList[0].connection.targetBlock();
280
+ n += count(conditionBlock);
281
+ var bodyBlock = block.inputList[1].connection.targetBlock();
282
+ n += count(bodyBlock);
283
+ var nextBlock = block.nextConnection.targetBlock();
284
+ n += count(nextBlock);
285
+ } else if (block.type === "controls_repeat") {
286
+ var bodyBlock = block.inputList[1].connection.targetBlock();
287
+ n += count(bodyBlock);
288
+ var nextBlock = block.nextConnection.targetBlock();
289
+ n += count(nextBlock);
290
+ } else if (block.type === "controls_if") {
291
+ var elseCount = block.elseCount_ || 0;
292
+
293
+ for (var i = 0; i < block.inputList.length - elseCount; i++) {
294
+ var input = block.inputList[i];
295
+ if (input.name.indexOf("IF") === 0) {
296
+ var conditionBlock = input.connection.targetBlock();
297
+ n += count(conditionBlock);
298
+ } else if (input.name.indexOf("DO") === 0) {
299
+ var bodyBlock = input.connection.targetBlock();
300
+ n += count(bodyBlock);
308
301
  }
309
-
310
- return n;
302
+ }
303
+
304
+ if (elseCount === 1) {
305
+ var elseBlock =
306
+ block.inputList[block.inputList.length - 1].connection.targetBlock();
307
+ n += count(elseBlock);
308
+ }
309
+
310
+ var nextBlock = block.nextConnection.targetBlock();
311
+ n += count(nextBlock);
312
+ } else if (
313
+ block.type === "call_proc" ||
314
+ block.type === "move_forwards" ||
315
+ block.type === "turn_left" ||
316
+ block.type === "turn_right" ||
317
+ block.type === "turn_around" ||
318
+ block.type === "wait" ||
319
+ block.type === "deliver" ||
320
+ block.type === "variables_numeric_set" ||
321
+ block.type === "variables_increment"
322
+ ) {
323
+ var nextBlock = block.nextConnection.targetBlock();
324
+ n += count(nextBlock);
325
+ } else if (block.type === "logic_negate" || block.type === "logic_compare") {
326
+ var conditionBlock = block.inputList[0].connection.targetBlock();
327
+ n += count(conditionBlock);
328
+ } else if (block.type === "variables_get" || block.type === "math_number") {
329
+ n++
311
330
  }
331
+
332
+ return n;
333
+ }
312
334
  };
313
335
 
314
336
  /************************/
@@ -316,90 +338,101 @@ ocargo.BlocklyControl.prototype.activeBlocksCount = function() {
316
338
  /************************/
317
339
 
318
340
  // Define custom select methods that select a block and its inputs
319
- ocargo.BlocklyControl.prototype.setBlockSelected = function(block, selected) {
320
- if (!block instanceof Blockly.BlockSvg) {
321
- return;
322
- }
341
+ ocargo.BlocklyControl.prototype.setBlockSelected = function (block, selected) {
342
+ if (!block instanceof Blockly.BlockSvg) {
343
+ return;
344
+ }
323
345
 
324
- block.inputList.forEach(function(input) {
325
- if (input.connection && input.type !== Blockly.NEXT_STATEMENT) {
326
- var targetBlock = input.connection.targetBlock();
327
- if (targetBlock) {
328
- this.setBlockSelected(targetBlock, selected);
329
- }
346
+ block.inputList.forEach(
347
+ function (input) {
348
+ if (input.connection && input.type !== Blockly.NEXT_STATEMENT) {
349
+ var targetBlock = input.connection.targetBlock();
350
+ if (targetBlock) {
351
+ this.setBlockSelected(targetBlock, selected);
330
352
  }
331
- }.bind(this));
332
-
333
- if (selected) {
334
- block.addSelect();
335
- } else {
336
- block.removeSelect();
337
- }
338
- };
353
+ }
354
+ }.bind(this)
355
+ );
339
356
 
340
- ocargo.BlocklyControl.prototype.clearAllSelections = function() {
341
- Blockly.mainWorkspace.getAllBlocks().forEach(function (block) {
342
- if(!block.keepHighlighting){
343
- this.setBlockSelected(block, false);
344
- }
345
- }.bind(this));
357
+ if (selected) {
358
+ block.addSelect();
359
+ } else {
360
+ block.removeSelect();
361
+ }
346
362
  };
347
363
 
348
- ocargo.BlocklyControl.prototype.highlightIncorrectBlock = function(incorrectBlock) {
349
- var frequency = 300;
350
- var repeats = 3;
351
-
352
- this.incorrectBlock = incorrectBlock;
353
- this.incorrectBlockColour = incorrectBlock.getColour();
354
-
355
- this.incorrectBlock.setColour(0);
356
- for (var i = 0; i < repeats; i++) {
357
- window.setTimeout(function () {
358
- if (this.incorrectBlock) {
359
- this.setBlockSelected(incorrectBlock, true);
360
- }
361
- }.bind(this), 2 * i * frequency);
362
- window.setTimeout(function () {
363
- if (this.incorrectBlock) {
364
- this.setBlockSelected(incorrectBlock, false);
365
- }
366
- }.bind(this), (2 * i + 1) * frequency);
367
- }
364
+ ocargo.BlocklyControl.prototype.clearAllSelections = function () {
365
+ Blockly.mainWorkspace.getAllBlocks().forEach(
366
+ function (block) {
367
+ if (!block.keepHighlighting) {
368
+ this.setBlockSelected(block, false);
369
+ }
370
+ }.bind(this)
371
+ );
368
372
  };
369
373
 
370
- ocargo.BlocklyControl.tryCatchSilently = function (f) {
371
- return function() {
372
- try {
373
- f();
374
- } catch (e) {
375
- // Nothing
374
+ ocargo.BlocklyControl.prototype.highlightIncorrectBlock = function (
375
+ incorrectBlock
376
+ ) {
377
+ var frequency = 300;
378
+ var repeats = 3;
379
+
380
+ this.incorrectBlock = incorrectBlock;
381
+ this.incorrectBlockColour = incorrectBlock.getColour();
382
+
383
+ this.incorrectBlock.setColour(0);
384
+ for (var i = 0; i < repeats; i++) {
385
+ window.setTimeout(
386
+ function () {
387
+ if (this.incorrectBlock) {
388
+ this.setBlockSelected(incorrectBlock, true);
376
389
  }
377
- };
390
+ }.bind(this),
391
+ 2 * i * frequency
392
+ );
393
+ window.setTimeout(
394
+ function () {
395
+ if (this.incorrectBlock) {
396
+ this.setBlockSelected(incorrectBlock, false);
397
+ }
398
+ }.bind(this),
399
+ (2 * i + 1) * frequency
400
+ );
401
+ }
378
402
  };
379
403
 
380
- ocargo.BlocklyControl.prototype.resetIncorrectBlock = function() {
381
- if (this.incorrectBlock) {
382
- this.incorrectBlock.setColour(this.incorrectBlockColour);
404
+ ocargo.BlocklyControl.tryCatchSilently = function (f) {
405
+ return function () {
406
+ try {
407
+ f();
408
+ } catch (e) {
409
+ // Nothing
383
410
  }
411
+ };
384
412
  };
385
413
 
386
-
387
- ocargo.BlockHandler = function(id) {
388
- this.id = id;
389
- this.selectedBlock = null;
414
+ ocargo.BlocklyControl.prototype.resetIncorrectBlock = function () {
415
+ if (this.incorrectBlock) {
416
+ this.incorrectBlock.setColour(this.incorrectBlockColour);
417
+ }
390
418
  };
391
419
 
392
- ocargo.BlockHandler.prototype.selectBlock = function(block) {
393
- if (block) {
394
- this.deselectCurrent();
395
- this.setBlockSelected(block, true);
396
- this.selectedBlock = block;
397
- }
420
+ ocargo.BlockHandler = function (id) {
421
+ this.id = id;
422
+ this.selectedBlock = null;
398
423
  };
399
424
 
400
- ocargo.BlockHandler.prototype.deselectCurrent = function() {
401
- if (this.selectedBlock) {
402
- this.setBlockSelected(this.selectedBlock, false);
403
- this.selectedBlock = null;
404
- }
425
+ ocargo.BlockHandler.prototype.selectBlock = function (block) {
426
+ if (block) {
427
+ this.deselectCurrent();
428
+ this.setBlockSelected(block, true);
429
+ this.selectedBlock = block;
430
+ }
405
431
  };
432
+
433
+ ocargo.BlockHandler.prototype.deselectCurrent = function () {
434
+ if (this.selectedBlock) {
435
+ this.setBlockSelected(this.selectedBlock, false);
436
+ this.selectedBlock = null;
437
+ }
438
+ };