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
@@ -0,0 +1,23 @@
1
+ $(document).ready(function () {
2
+ let shadowRoot = $("editor-wc")[0].shadowRoot;
3
+
4
+ // Set editor height and margin
5
+ $(shadowRoot).find("#root").css("height", "100%");
6
+ $(shadowRoot).find(".proj-container").css("margin", "0 10px 0 0");
7
+
8
+ // Fix project bar height
9
+ $(shadowRoot).find(".project-bar").css("block-size", "auto");
10
+
11
+ // Focus on text output tab
12
+ $(shadowRoot).find(".react-tabs__tab-text").click();
13
+
14
+ // Remove visual output and split view tabs
15
+ $(shadowRoot).find("#react-tabs-4").hide();
16
+ $(shadowRoot).find(".output-view-toggle").hide();
17
+
18
+ // Make editor font size not small
19
+ $(shadowRoot).find(".editor").removeClass("editor--small");
20
+
21
+ // Ensure window doesn't scroll to bottom of page
22
+ window.scrollTo(0, 0);
23
+ });
@@ -6,10 +6,23 @@ ocargo.Game = function () {
6
6
  this.tabs = null
7
7
  this.failures = 0
8
8
  this.currentlySelectedTab = null
9
- this.isMuted = Cookies.get('muted') === 'true'
9
+
10
+ if (!hasFunctionalCookiesConsent()) {
11
+ deleteCookie('muted')
12
+ deleteCookie('preferredLanguage')
13
+ }
14
+ this.preferredLanguage = Cookies.get('preferredLanguage')
10
15
  }
11
16
 
12
17
  ocargo.Game.prototype.setup = function () {
18
+ document.getElementById("language_dropdown").value = this.preferredLanguage ?? navigator.language.toLowerCase()
19
+ gameUpdateBlockLanguage(this.preferredLanguage ?? navigator.language.toLowerCase())
20
+ this.isMuted = Cookies.get('muted') ?? false
21
+
22
+ if(new Date().getMonth() === 11) {
23
+ $("#paper").css('background-color', '#eef7ff')
24
+ }
25
+
13
26
  if (NIGHT_MODE_FEATURE_ENABLED) {
14
27
  if (NIGHT_MODE) {
15
28
  $('#paper').css('background-color', 'black')
@@ -20,6 +33,13 @@ ocargo.Game.prototype.setup = function () {
20
33
  }
21
34
  }
22
35
 
36
+
37
+ // Function being called when there is a change in game level.
38
+ ocargo.Game.prototype.onLevelChange = function() {
39
+ const currentLevelId = LEVEL_ID;
40
+ localStorage.setItem('currentEpisode', EPISODE);
41
+ }
42
+
23
43
  restoreCmsLogin()
24
44
  initCustomBlocks()
25
45
  ocargo.solutionLoaded = false
@@ -27,20 +47,21 @@ ocargo.Game.prototype.setup = function () {
27
47
  ocargo.pythonControl = new ocargo.PythonControl()
28
48
  ocargo.blocklyCompiler = new ocargo.BlocklyCompiler()
29
49
  ocargo.model = new ocargo.Model(
30
- PATH,
31
- ORIGIN,
32
- DESTINATIONS,
33
- TRAFFIC_LIGHTS,
34
- COWS,
35
- MAX_FUEL
50
+ PATH,
51
+ ORIGIN,
52
+ DESTINATIONS,
53
+ TRAFFIC_LIGHTS,
54
+ COWS,
55
+ MAX_FUEL
36
56
  )
57
+
37
58
  this.drawing = new ocargo.Drawing(ocargo.model.startingPosition())
38
59
  this.drawing.preloadRoadTiles()
39
60
  ocargo.animation = new ocargo.Animation(ocargo.model, DECOR, this.drawing)
40
61
  this.saving = new ocargo.Saving()
41
62
  this.sharing = new ocargo.Sharing(
42
- () => parseInt(LEVEL_ID),
43
- () => true
63
+ () => parseInt(LEVEL_ID),
64
+ () => true
44
65
  )
45
66
 
46
67
  // Setup the blockly workspace
@@ -52,7 +73,6 @@ ocargo.Game.prototype.setup = function () {
52
73
  this._setupConsoleSliderListeners()
53
74
  this._setupPythonViewSliderListeners()
54
75
  this._setupConsoleLogViewSliderListeners()
55
- this._setupDirectDriveListeners()
56
76
  this._setupFuelGauge(ocargo.model.map.nodes, BLOCKS)
57
77
  this._setupTabs()
58
78
 
@@ -68,20 +88,20 @@ ocargo.Game.prototype.setup = function () {
68
88
  // Setup blockly to python
69
89
  Blockly.Python.init(Blockly.getMainWorkspace())
70
90
  window.addEventListener(
71
- 'unload',
72
- function (event) {
73
- ocargo.pythonControl.teardown()
74
- ocargo.blocklyControl.teardown()
75
- }.bind(this)
91
+ 'unload',
92
+ function (event) {
93
+ ocargo.pythonControl.teardown()
94
+ ocargo.blocklyControl.teardown()
95
+ }.bind(this)
76
96
  )
77
97
 
78
98
  var loggedOutWarning = ''
79
99
  // Check if logged on
80
100
  if (USER_STATUS == 'UNTRACKED') {
81
101
  loggedOutWarning =
82
- '<br><span class="popup__text--warning">' +
83
- gettext("You are not logged in. Your progress won't be saved.") +
84
- '</span>'
102
+ '<br><span class="popup__text--warning">' +
103
+ gettext("You are not logged in. Your progress won't be saved.") +
104
+ '</span>'
85
105
  }
86
106
  // Start the popup
87
107
  var title = gettext('Try solving this one...')
@@ -92,8 +112,16 @@ ocargo.Game.prototype.setup = function () {
92
112
  } else if (DEFAULT_LEVEL) {
93
113
  titlePrefix = gettext('Level %(level_name)s')
94
114
  }
115
+
116
+ let adjusted_level_name = ''
117
+ if (LEVEL_NAME > 1000) {
118
+ adjusted_level_name = LEVEL_NAME - 1000
119
+ } else {
120
+ adjusted_level_name = LEVEL_NAME;
121
+ }
122
+
95
123
  if (titlePrefix) {
96
- title = interpolate(titlePrefix, { level_name: LEVEL_NAME }, true)
124
+ title = interpolate(titlePrefix, { level_name: adjusted_level_name }, true)
97
125
  } else {
98
126
  title = LEVEL_NAME
99
127
  }
@@ -102,26 +130,45 @@ ocargo.Game.prototype.setup = function () {
102
130
  var message
103
131
  if (NIGHT_MODE) {
104
132
  message =
105
- '<br>' +
106
- gettext(
107
- 'In Night Mode you can only see a very short distance. ' +
108
- "We've given you more blocks to help you find your way!"
109
- )
133
+ '<br>' +
134
+ gettext(
135
+ 'In Night Mode you can only see a very short distance. ' +
136
+ "We've given you more blocks to help you find your way!"
137
+ )
110
138
  } else {
111
139
  message = loggedOutWarning
112
140
  }
113
141
 
114
142
  this.drawing.enablePanning()
115
143
 
144
+ const showMascot = BLOCKLY_ENABLED && !PYTHON_VIEW_ENABLED && LEVEL_NAME <= 80; // show mascot on Blockly-only levels that are not above 80
145
+
146
+ const subtitle = SUBTITLE == "None" ? "" : "<b>" + SUBTITLE + "</b> <br> <br> ";
147
+ const next_button_html = NEXT_LEVEL_URL == "/pythonden/"
148
+ ? ocargo.button.episodeRedirectButtonHtml("next_button", NEXT_LEVEL_URL, gettext('Next episode'), NEXT_EPISODE)
149
+ : ocargo.button.dismissButtonHtml("next_button", gettext('Next level'))
116
150
  ocargo.Drawing.startPopup(
117
- title,
118
- LESSON,
119
- message,
120
- BLOCKLY_ENABLED && !PYTHON_VIEW_ENABLED, // show mascot on Blockly-only levels
121
- ocargo.button.dismissButtonHtml('play_button', gettext('Play'))
151
+ title,
152
+ subtitle + LESSON,
153
+ message,
154
+ showMascot,
155
+ [
156
+ ocargo.button.dismissButtonHtml("prev_button", gettext("Previous level")),
157
+ ocargo.button.dismissButtonHtml('play_button', gettext('Play')),
158
+ next_button_html
159
+ ]
122
160
  )
123
161
  }
124
162
 
163
+ // Script used to save and check for episode upon loading of the webpage
164
+ document.addEventListener("DOMContentLoaded", function() {
165
+ const dataElement = document.getElementById('data');
166
+ const currentEpisode = dataElement ? dataElement.getAttribute('data-episode') : null;
167
+ if (currentEpisode) {
168
+ localStorage.setItem('currentEpisode', currentEpisode);
169
+ }
170
+ });
171
+
125
172
  ocargo.Game.prototype.clearWorkspaceNameInputInSaveTab = function () {
126
173
  $('#workspaceNameInput').val('')
127
174
  }
@@ -141,6 +188,18 @@ ocargo.Game.prototype.reset = function () {
141
188
  }
142
189
 
143
190
  ocargo.Game.prototype.runProgramAndPrepareAnimation = function (blocks) {
191
+ if (window.location.href.startsWith("https://www.codeforlife.education")) {
192
+ if (window.location.href.includes("/pythonden/")) {
193
+ gtag("event", "python-den:level:play", {
194
+ levelId: LEVEL_NAME - 1000,
195
+ });
196
+ } else if (window.location.href.includes("/rapidrouter/")) {
197
+ gtag("event", "rapid-router:level:play", {
198
+ levelId: LEVEL_NAME,
199
+ });
200
+ }
201
+ }
202
+
144
203
  this.reset()
145
204
  let code = ocargo.pythonControl.getCode()
146
205
  ocargo.event.sendEvent('PlayButtonPressed', {
@@ -212,10 +271,12 @@ ocargo.Game.prototype.sendAttempt = function (score) {
212
271
  return /^(GET|HEAD|OPTIONS|TRACE)$/.test(method)
213
272
  }
214
273
 
215
- // hack scores so that it works for demo and python TODO implement max scores and remove this!!
216
- if (PYTHON_ENABLED) {
217
- score *= 2
218
- }
274
+ // TODO: Remove below - keeping it for now as a reminder that we need to
275
+ // implement some kind of algorithm score for Python levels.
276
+ // // hack scores so that it works for demo and python TODO implement max scores and remove this!!
277
+ // if (PYTHON_ENABLED) {
278
+ // score *= 2
279
+ // }
219
280
 
220
281
  // Check that we should actually be sending an attempt - either if only blockly is enabled
221
282
  // or if python is enabled and we're on the python tab (assumes they don't change tab quickly...)
@@ -254,13 +315,18 @@ ocargo.Game.prototype.sendAttempt = function (score) {
254
315
 
255
316
  ocargo.Game.prototype.registerFailure = function () {
256
317
  this.failures += 1
257
- return this.failures >= 3
318
+ return this.failures >= 1
258
319
  }
259
320
 
260
321
  ocargo.Game.prototype._setupFuelGauge = function (nodes, blocks) {
261
322
  if (FUEL_GAUGE) {
262
- document.getElementById('fuelGauge').style.visibility = 'visible'
323
+ if (CHARACTER_NAME == "Electric van") {
324
+ document.getElementById("electricFuelGauge").style.visibility = "visible"
325
+ } else {
326
+ document.getElementById("fuelGauge").style.visibility = "visible"
327
+ }
263
328
 
329
+ // TODO: Investigate these for loops - are they necessary?
264
330
  for (var i = 0; i < blocks.length; i++) {
265
331
  if (blocks[i].type === 'turn_around' || blocks[i].type === 'wait') {
266
332
  return
@@ -275,44 +341,6 @@ ocargo.Game.prototype._setupFuelGauge = function (nodes, blocks) {
275
341
  }
276
342
  }
277
343
 
278
- ocargo.Game.prototype._setupDirectDriveListeners = function () {
279
- var manoeuvreCallback = function () {
280
- this.drawing.scrollToShowCharacter()
281
- this.onStopControls()
282
- }.bind(this)
283
-
284
- $('#moveForward').click(
285
- function () {
286
- if (ocargo.model.reasonForTermination != 'CRASH') {
287
- this.onPlayControls()
288
- ocargo.blocklyControl.addBlockToEndOfProgram('move_forwards')
289
- this.drawing.moveForward(manoeuvreCallback)
290
- }
291
- }.bind(this)
292
- )
293
- $('#turnLeft').click(
294
- function () {
295
- if (ocargo.model.reasonForTermination != 'CRASH') {
296
- this.onPlayControls()
297
- ocargo.blocklyControl.addBlockToEndOfProgram('turn_left')
298
- this.drawing.turnLeft(manoeuvreCallback)
299
- }
300
- }.bind(this)
301
- )
302
- $('#turnRight').click(
303
- function () {
304
- if (ocargo.model.reasonForTermination != 'CRASH') {
305
- this.onPlayControls()
306
- ocargo.blocklyControl.addBlockToEndOfProgram('turn_right')
307
- this.drawing.turnRight(manoeuvreCallback)
308
- }
309
- }.bind(this)
310
- )
311
- $('#go').click(function () {
312
- $('#play_radio').trigger('click')
313
- })
314
- }
315
-
316
344
  ocargo.Game.prototype._setupConsoleSliderListeners = function () {
317
345
  let tabsWidth = $('#tabs').width()
318
346
 
@@ -359,7 +387,6 @@ ocargo.Game.prototype._setupConsoleSliderListeners = function () {
359
387
  $('#consoleSlider').css('left', consoleSliderPosition + '%')
360
388
  $('#paper').css('width', 100 - consoleSliderPosition + '%')
361
389
  $('#tab_panes').css('width', consoleSliderPosition + '%')
362
- $('#direct_drive').css('left', consoleSliderPosition + '%')
363
390
 
364
391
  ocargo.blocklyControl.redrawBlockly()
365
392
  }
@@ -392,6 +419,7 @@ ocargo.Game.prototype._setupConsoleLogViewSliderListeners = function () {
392
419
  let moveEvents = ['mousemove', 'touchmove']
393
420
  let endEvents = ['mouseup', 'touchend', 'touchcancel']
394
421
 
422
+ let codeWindow = $("#code").next()
395
423
  let slider = $('#consoleLogSlider')
396
424
  let wrapper = $('#wrapper')
397
425
  let halfSliderHeight = slider.height()
@@ -412,15 +440,19 @@ ocargo.Game.prototype._setupConsoleLogViewSliderListeners = function () {
412
440
  let containerHeight = slider.parent().height()
413
441
 
414
442
  pythonSliderPosition *= 100.0 / containerHeight
443
+ let codeWindowHeight = pythonSliderPosition
415
444
 
416
445
  if (pythonSliderPosition > 75) {
417
446
  pythonSliderPosition = 75
447
+ codeWindowHeight = 75
418
448
  }
419
- if (pythonSliderPosition < 0) {
420
- pythonSliderPosition = 0
449
+ if (pythonSliderPosition < 30) {
450
+ pythonSliderPosition = 30
451
+ codeWindowHeight = 30
421
452
  }
422
453
 
423
454
  slider.css('top', pythonSliderPosition + '%')
455
+ codeWindow.css("height", `100%`)
424
456
  $('#editor').css('height', pythonSliderPosition + '%')
425
457
 
426
458
  ocargo.blocklyControl.redrawBlockly()
@@ -509,8 +541,6 @@ const buttonTransit = (buttonElementId, state) => {
509
541
  ocargo.Game.prototype.onPlayControls = function () {
510
542
  this.disallowCodeChanges()
511
543
 
512
- document.getElementById('direct_drive').style.visibility = 'hidden'
513
-
514
544
  this.tabs.play.transitTo('running')
515
545
  buttonTransit("run-code-button", "running")
516
546
  this.tabs.step.disable()
@@ -525,8 +555,6 @@ ocargo.Game.prototype.onPlayControls = function () {
525
555
  ocargo.Game.prototype.onStepControls = function () {
526
556
  this.disallowCodeChanges()
527
557
 
528
- document.getElementById('direct_drive').style.visibility = 'hidden'
529
-
530
558
  this.tabs.play.transitTo('paused')
531
559
  buttonTransit("run-code-button", "paused")
532
560
  this.tabs.step.disable()
@@ -540,9 +568,8 @@ ocargo.Game.prototype.onStepControls = function () {
540
568
  ocargo.Game.prototype.onFastControls = function () {
541
569
  this.disallowCodeChanges()
542
570
 
543
- document.getElementById('direct_drive').style.visibility = 'hidden'
544
-
545
571
  this.tabs.play.transitTo('running')
572
+ buttonTransit("run-code-button", "running")
546
573
  this.tabs.fast.transitTo('fast')
547
574
  this.tabs.step.disable()
548
575
 
@@ -555,8 +582,6 @@ ocargo.Game.prototype.onFastControls = function () {
555
582
  ocargo.Game.prototype.onSlowControls = function () {
556
583
  this.disallowCodeChanges()
557
584
 
558
- document.getElementById('direct_drive').style.visibility = 'hidden'
559
-
560
585
  this.tabs.play.transitTo('running')
561
586
  buttonTransit("run-code-button", "running")
562
587
  this.tabs.fast.transitTo('slow')
@@ -590,6 +615,7 @@ ocargo.Game.prototype.isInPythonWorkspace = function () {
590
615
 
591
616
  ocargo.Game.prototype._setupTabs = function () {
592
617
  this.tabs = []
618
+
593
619
  this.tabs.blockly = new ocargo.Tab(
594
620
  $('#blockly_radio'),
595
621
  $('#blockly_radio + label'),
@@ -742,9 +768,6 @@ ocargo.Game.prototype.onPauseControls = function () {
742
768
  ocargo.Game.prototype.onStopControls = function () {
743
769
  this.allowCodeChanges()
744
770
 
745
- // TODO make this hidden unless blocks are clear or something...
746
- document.getElementById('direct_drive').style.visibility = 'visible'
747
-
748
771
  this.tabs.play.transitTo('readyToPlay')
749
772
  buttonTransit("run-code-button", "readyToPlay")
750
773
  this.tabs.fast.transitTo('slow')
@@ -799,9 +822,9 @@ ocargo.Game.prototype._setupPythonTab = function () {
799
822
  $('#consoleOutput').text('')
800
823
  }.bind(this)
801
824
  )
802
-
825
+ // --------- Commands for popup ---------------------------------------------------
803
826
  var leadMsg =
804
- '<p>' +
827
+ '<p style="font-size: 20px;">' +
805
828
  interpolate(
806
829
  gettext(
807
830
  'Run the following commands on the van object %(var_name)s, e.g. %(example)s'
@@ -810,52 +833,8 @@ ocargo.Game.prototype._setupPythonTab = function () {
810
833
  true
811
834
  ) +
812
835
  '</p>' +
813
- '<div class="row">' +
814
- '<div class="large-4 columns">' +
815
- '<p><b>' +
816
- gettext('Movement') +
817
- '</b>' +
818
- '<br>my_van.move_forwards()' +
819
- '<br>my_van.turn_left()' +
820
- '<br>my_van.turn_right()' +
821
- '<br>my_van.turn_around()' +
822
- '<br>my_van.wait()</p>' +
823
- '</div>' +
824
- '<div class="large-4 columns">' +
825
- '<p><b>' +
826
- gettext('Position') +
827
- '</b>' +
828
- '<br>my_van.at_dead_end()' +
829
- '<br>my_van.at_destination()' +
830
- '<br>my_van.at_red_traffic_light()' +
831
- '<br>my_van.at_green_traffic_light()' +
832
- '<br>my_van.at_traffic_light(c)' +
833
- '<br><i>' +
834
- interpolate(
835
- gettext("where %(arg_name)s is '%(red_color)s' or '%(green_color)s'"),
836
- { arg_name: 'c', red_color: 'RED', green_color: 'GREEN' },
837
- true
838
- ) +
839
- '</i></p>' +
840
- '</div>' +
841
- '<div class="large-4 columns">' +
842
- '<p>' +
843
- '<br>my_van.is_road_forward()' +
844
- '<br>my_van.is_road_left()' +
845
- '<br>my_van.is_road_right()' +
846
- '<br>my_van.is_road(d)' +
847
- '<br><i>' +
848
- interpolate(
849
- gettext(
850
- "where %(arg_name)s is '%(forward)s', '%(left)s', or '%(right)s'"
851
- ),
852
- { arg_name: 'd', forward: 'FORWARD', left: 'LEFT', right: 'RIGHT' },
853
- true
854
- ) +
855
- '</i></p>' +
856
- '</div>' +
857
- '</div>'
858
-
836
+ COMMANDS
837
+ // -----------------------------------------------------------------------------
859
838
  $('#van_commands_help').click(
860
839
  function (e) {
861
840
  ocargo.Drawing.startPopup(gettext('Python Commands'), leadMsg, '')
@@ -1179,13 +1158,13 @@ ocargo.Game.prototype._setupSaveTab = function () {
1179
1158
  break
1180
1159
  }
1181
1160
  }
1182
-
1183
1161
  var workspace = {
1184
1162
  name: newName,
1185
1163
  contents: ocargo.blocklyControl.serialize(),
1186
1164
  python_contents: ocargo.pythonControl.getCode(),
1187
1165
  blockly_enabled: BLOCKLY_ENABLED,
1188
- python_enabled: PYTHON_ENABLED
1166
+ python_enabled: PYTHON_ENABLED,
1167
+ python_view_enabled: PYTHON_VIEW_ENABLED
1189
1168
  }
1190
1169
 
1191
1170
  this.saving.saveWorkspace(
@@ -1317,6 +1296,7 @@ ocargo.Game.prototype._populateTable = function (tableName, workspaces) {
1317
1296
  .attr({ value: workspace.id })
1318
1297
  .appendTo(table)
1319
1298
  $('<td></td>')
1299
+ .attr({ id: workspace.name })
1320
1300
  .text(workspace.name)
1321
1301
  .appendTo(row)
1322
1302
  }
@@ -1343,13 +1323,42 @@ function restoreCmsLogin () {
1343
1323
  }
1344
1324
 
1345
1325
  function hasFunctionalCookiesConsent() {
1346
- return OnetrustActiveGroups && OnetrustActiveGroups.split(',').includes('CL003')
1326
+ try {
1327
+ return OnetrustActiveGroups.split(',').includes('C0003')
1328
+ } catch (e) {
1329
+ console.error(e)
1330
+ }
1331
+ return false
1347
1332
  }
1348
1333
 
1349
1334
  function setMutedCookie(mute) {
1350
1335
  if (hasFunctionalCookiesConsent()) {
1351
- Cookies.set('muted', mute.toString(), { path: Urls.levels() })
1336
+ if (mute) {
1337
+ Cookies.set('muted', true)
1338
+ }
1339
+ else {
1340
+ deleteCookie('muted')
1341
+ }
1342
+ }
1343
+ }
1344
+
1345
+ function deleteCookie(name) {
1346
+ // Set cookie expiry to yesterday, browser will remove the cookie.
1347
+ // https://www.quirksmode.org/js/cookies.html
1348
+ Cookies.set(name, "", { expires: -1 })
1349
+ }
1350
+
1351
+ function gameUpdateBlockLanguage (language_code) {
1352
+ loadLanguage("/static/game/js/blockly/msg/js/", language_code, function() {
1353
+ reloadWorkspace(Blockly.mainWorkspace);
1354
+ });
1355
+ }
1356
+
1357
+ function gameUpdateBlockLanguageAndCookie (language_code) {
1358
+ if (hasFunctionalCookiesConsent()) {
1359
+ Cookies.set("preferredLanguage", language_code)
1352
1360
  }
1361
+ gameUpdateBlockLanguage(language_code)
1353
1362
  }
1354
1363
 
1355
1364
  $(document).ready(function () {