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
@@ -8,36 +8,45 @@ ocargo.PathFinder = function(model) {
8
8
  this.destinations = model.map.destinations;
9
9
 
10
10
  this.pathScoreDisabled = DISABLE_ROUTE_SCORE;
11
+ this.algorithmScoreDisabled = DISABLE_ALGORITHM_SCORE;
11
12
  this.modelSolution = MODEL_SOLUTION;
12
13
 
14
+ const tooSimpleToGetAlgorithmScore = (LEVEL_ID < 13);
15
+
13
16
  if (!this.pathScoreDisabled) {
14
- this.maxScoreForPathLength = 10;
17
+ if (tooSimpleToGetAlgorithmScore) {
18
+ this.maxScoreForPathLength = 20;
19
+ } else {
20
+ this.maxScoreForPathLength = 10;
21
+ }
15
22
  } else {
16
23
  this.maxScoreForPathLength = 0;
17
24
  }
18
25
 
19
- this.maxScoreForNumberOfInstructions = this.modelSolution.length > 0 ? 10 : 0;
26
+ this.maxScoreForNumberOfInstructions = 0;
20
27
 
21
- this.maxScore = this.maxScoreForPathLength + this.maxScoreForNumberOfInstructions;
28
+ if (!this.algorithmScoreDisabled) {
29
+ this.maxScoreForNumberOfInstructions = 10;
30
+ }
22
31
 
32
+ this.maxScore = this.maxScoreForPathLength + this.maxScoreForNumberOfInstructions;
23
33
  this.optimalPath = getOptimalPath(this.nodes, this.destinations);
24
34
  };
25
35
 
26
36
  ocargo.PathFinder.prototype.getScore = function() {
27
- var routeCoins = {};
28
- var instrCoins = {};
29
- var performance= "";
37
+ let routeCoins = {};
38
+ let instrCoins = {};
39
+ let performance= "";
30
40
 
31
- var pathLengthScore = 0;
32
- if(!this.pathScoreDisabled){
41
+ let pathLengthScore = 0;
42
+ if (!this.pathScoreDisabled) {
33
43
  pathLengthScore = Math.max(0, this.getTravelledPathScore());
34
44
  routeCoins = this.getNumCoins(pathLengthScore, this.maxScoreForPathLength);
35
45
  }
36
46
 
37
- var totalScore = pathLengthScore;
47
+ let totalScore = pathLengthScore;
38
48
 
39
- if (this.modelSolution.length > 0) {
40
- // Then we're on a default level
49
+ if (!this.algorithmScoreDisabled) {
41
50
  var initInstrScore = this.getScoreForNumberOfInstructions();
42
51
  var instrScore = Math.max(0, initInstrScore);
43
52
 
@@ -52,7 +61,6 @@ ocargo.PathFinder.prototype.getScore = function() {
52
61
  instrCoins = this.getNumCoins(instrScore, this.maxScoreForNumberOfInstructions);
53
62
  }
54
63
 
55
-
56
64
  if (pathLengthScore < this.maxScoreForPathLength) {
57
65
  performance = "pathLonger";
58
66
  }
@@ -62,11 +70,11 @@ ocargo.PathFinder.prototype.getScore = function() {
62
70
  else if (initInstrScore < this.maxScoreForNumberOfInstructions) {
63
71
  performance = "algorithmLonger";
64
72
  }
65
- else if (totalScore === this.maxScore) {
73
+ else if (totalScore === this.maxScore) {
66
74
  performance = "scorePerfect";
67
75
  }
68
76
 
69
- var endLevelMsg = function(performance) {
77
+ const endLevelMsg = function(performance) {
70
78
  switch (performance){
71
79
  case 'pathLonger':
72
80
  return gettext('Try finding a shorter route to the destination.');
@@ -88,6 +96,7 @@ ocargo.PathFinder.prototype.getScore = function() {
88
96
  performance: performance,
89
97
  pathLengthScore: pathLengthScore,
90
98
  pathScoreDisabled: this.pathScoreDisabled,
99
+ algorithmScoreDisabled: this.algorithmScoreDisabled,
91
100
  maxScoreForPathLength: this.maxScoreForPathLength,
92
101
  instrScore: instrScore,
93
102
  maxScoreForNumberOfInstructions: this.maxScoreForNumberOfInstructions,
@@ -100,17 +109,17 @@ ocargo.PathFinder.prototype.getNumCoins = function(score, maxScore) {
100
109
  };
101
110
 
102
111
  ocargo.PathFinder.prototype.getTravelledPathScore = function() {
103
- var travelled = this.van.getDistanceTravelled();
104
- return this.maxScoreForPathLength - (travelled - this.optimalPath.length + 2);
112
+ const travelled = this.van.getDistanceTravelled();
113
+ const START_AND_END_BLOCKS = 2;
114
+ return this.maxScoreForPathLength - (travelled + START_AND_END_BLOCKS - this.optimalPath.length);
105
115
  };
106
116
 
107
117
  ocargo.PathFinder.prototype.getScoreForNumberOfInstructions = function() {
108
-
109
- var blocksUsed = ocargo.utils.isIOSMode() ? ocargo.game.mobileBlocks : ocargo.blocklyControl.activeBlocksCount();
110
- var algorithmScore = 0;
111
- var difference = this.maxScoreForNumberOfInstructions;
112
- for (var i = 0; i < this.modelSolution.length; i++) {
113
- var currDifference = blocksUsed - this.modelSolution[i];
118
+ const blocksUsed = ocargo.utils.isIOSMode() ? ocargo.game.mobileBlocks : ocargo.blocklyControl.activeBlocksCount();
119
+ let algorithmScore = 0;
120
+ let difference = this.maxScoreForNumberOfInstructions;
121
+ for (let i = 0; i < this.modelSolution.length; i++) {
122
+ let currDifference = blocksUsed - this.modelSolution[i];
114
123
  if (Math.abs(currDifference) < difference) {
115
124
  difference = Math.abs(currDifference);
116
125
  algorithmScore = this.maxScoreForNumberOfInstructions - currDifference;
@@ -120,13 +129,11 @@ ocargo.PathFinder.prototype.getScoreForNumberOfInstructions = function() {
120
129
  };
121
130
 
122
131
  ocargo.PathFinder.prototype.getLength = function(stack) {
123
-
124
- var total = 0;
125
- var i;
132
+ let total = 0;
126
133
  if (!stack) {
127
134
  return total;
128
135
  }
129
- for (i = 0; i < stack.length; i++) {
136
+ for (let i = 0; i < stack.length; i++) {
130
137
  if (stack[i].command === "While") {
131
138
  total += this.getLength(stack[i].block);
132
139
  }
@@ -139,16 +146,14 @@ ocargo.PathFinder.prototype.getLength = function(stack) {
139
146
  return total;
140
147
  };
141
148
 
142
-
143
-
144
149
  function getOptimalPath(nodes, destinations) {
145
150
  // Brute force Travelling Salesman implementation, using A* to determine the connection lengths
146
151
  // If the map size increases or lots of destinations are required, it may need to be rethought
147
- var hash = {};
152
+ let hash = {};
148
153
  function getPathBetweenNodes(node1, node2) {
149
- var key = '(' + node1.coordinate.x + ',' + node1.coordinate.y + '),(' + node2.coordinate.x +
154
+ const key = '(' + node1.coordinate.x + ',' + node1.coordinate.y + '),(' + node2.coordinate.x +
150
155
  ',' + node2.coordinate.y + ')';
151
- var solution;
156
+ let solution;
152
157
  if (key in hash) {
153
158
  solution = hash[key];
154
159
  }
@@ -160,13 +165,13 @@ function getOptimalPath(nodes, destinations) {
160
165
  }
161
166
 
162
167
  function getPermutationPath(start, permutation) {
163
- var fragPath = [getPathBetweenNodes(start, permutation[0], nodes)];
164
- for (var i = 1; i < permutation.length; i++) {
168
+ let fragPath = [getPathBetweenNodes(start, permutation[0], nodes)];
169
+ for (let i = 1; i < permutation.length; i++) {
165
170
  fragPath.push(getPathBetweenNodes(permutation[i-1], permutation[i], nodes));
166
171
  }
167
172
 
168
- var fullPath = [start];
169
- for (var i = 0; i < fragPath.length; i++) {
173
+ let fullPath = [start];
174
+ for (let i = 0; i < fragPath.length; i++) {
170
175
  if (!fragPath[i]) {
171
176
  return null;
172
177
  }
@@ -177,12 +182,12 @@ function getOptimalPath(nodes, destinations) {
177
182
  return fullPath;
178
183
  }
179
184
 
180
- var permutations = [];
185
+ let permutations = [];
181
186
  function permute(array, data) {
182
- var current;
183
- var currentPermutation = data || [];
187
+ let current;
188
+ let currentPermutation = data || [];
184
189
 
185
- for (var i = 0; i < array.length; i++) {
190
+ for (let i = 0; i < array.length; i++) {
186
191
  // Take node out
187
192
  current = array.splice(i, 1)[0];
188
193
  // Then the current permutation is complete so add it
@@ -196,26 +201,25 @@ function getOptimalPath(nodes, destinations) {
196
201
  }
197
202
  }
198
203
 
199
- var start = nodes[0];
200
- var bestScore = Number.POSITIVE_INFINITY;
201
- var bestPermutationPath = null;
202
- var destinationNodes = [];
204
+ let start = nodes[0];
205
+ let bestScore = Number.POSITIVE_INFINITY;
206
+ let bestPermutationPath = null;
207
+ let destinationNodes = [];
203
208
 
204
- for (var i = 0; i < destinations.length; i++) {
209
+ for (let i = 0; i < destinations.length; i++) {
205
210
  destinationNodes.push(destinations[i].node);
206
211
  }
207
212
  permute(destinationNodes);
208
213
 
209
- for (var i = 0; i < permutations.length; i++) {
210
- var permutation = permutations[i];
211
- var permutationPath = getPermutationPath(start, permutation, nodes);
214
+ for (let i = 0; i < permutations.length; i++) {
215
+ let permutation = permutations[i];
216
+ const permutationPath = getPermutationPath(start, permutation, nodes);
212
217
 
213
218
  if (permutationPath && permutationPath.length < bestScore) {
214
219
  bestScore = permutationPath.length;
215
220
  bestPermutationPath = permutationPath;
216
221
  }
217
222
  }
218
-
219
223
  return bestPermutationPath;
220
224
  }
221
225
 
@@ -226,21 +230,19 @@ function QueueLink(node, score) {
226
230
  }
227
231
 
228
232
  function PriorityQueue() {
229
- var head = null;
230
-
231
233
  this.push = function(node, score) {
232
234
  if (this.head == null) {
233
235
  this.head = new QueueLink(node, score);
234
236
  } else if (this.head.score > score) {
235
- var tmp = this.head;
237
+ let tmp = this.head;
236
238
  this.head = new QueueLink(node, score);
237
239
  this.head.next = tmp;
238
240
  } else {
239
- var i = this.head;
240
- var found = false;
241
+ let i = this.head;
242
+ let found = false;
241
243
  while (i.next != null && !found) {
242
244
  if (i.next.score > score) {
243
- var tmp = i.next;
245
+ let tmp = i.next;
244
246
  i.next = new QueueLink(node, score);
245
247
  i.next.next = tmp;
246
248
  found = true;
@@ -257,7 +259,7 @@ function PriorityQueue() {
257
259
  if (this.head == null) {
258
260
  return null;
259
261
  } else {
260
- var result = this.head.node;
262
+ const result = this.head.node;
261
263
  this.head = this.head.next;
262
264
  return result;
263
265
  }
@@ -269,12 +271,11 @@ function PriorityQueue() {
269
271
  }
270
272
 
271
273
  function aStar(origin, destination, nodes) {
272
-
273
- var end = destination; // Nodes already visited.
274
- var current;
275
- var start = origin;
276
- var closedSet = {}; // The neighbours yet to be evaluated.
277
- var openSet = new PriorityQueue();
274
+ const end = destination; // Nodes already visited.
275
+ let current;
276
+ const start = origin;
277
+ let closedSet = {}; // The neighbours yet to be evaluated.
278
+ let openSet = new PriorityQueue();
278
279
  openSet.push(start, 0);
279
280
 
280
281
  initialiseParents(nodes);
@@ -287,14 +288,14 @@ function aStar(origin, destination, nodes) {
287
288
  if (current === end) {
288
289
  return getNodeList(current);
289
290
  }
290
- for (var i = 0; i < current.connectedNodes.length; i++) {
291
- var neighbour = current.connectedNodes[i];
291
+ for (let i = 0; i < current.connectedNodes.length; i++) {
292
+ let neighbour = current.connectedNodes[i];
292
293
  if (Object.prototype.hasOwnProperty.call(closedSet, neighbour.id)) {
293
294
  continue;
294
295
  }
295
296
  closedSet[neighbour.id] = true;
296
297
  neighbour.parent = current;
297
- var score = distanceFromStart(neighbour) + heuristic(destination, neighbour);
298
+ const score = distanceFromStart(neighbour) + heuristic(destination, neighbour);
298
299
  openSet.push(neighbour, score);
299
300
  }
300
301
  }
@@ -302,21 +303,21 @@ function aStar(origin, destination, nodes) {
302
303
  return null;
303
304
 
304
305
  function heuristic(node1, node2) {
305
- var d1 = Math.abs(node2.coordinate.x - node1.coordinate.x);
306
- var d2 = Math.abs(node2.coordinate.y - node1.coordinate.y);
306
+ const d1 = Math.abs(node2.coordinate.x - node1.coordinate.x);
307
+ const d2 = Math.abs(node2.coordinate.y - node1.coordinate.y);
307
308
  return d1 + d2;
308
309
  }
309
310
 
310
311
  function initialiseParents(nodes) {
311
- for (var i = 0; i < nodes.length; i++) {
312
+ for (let i = 0; i < nodes.length; i++) {
312
313
  nodes[i].parent = null;
313
314
  nodes[i].id = i;
314
315
  }
315
316
  }
316
317
 
317
318
  function distanceFromStart(current) {
318
- var count = 0;
319
- var i = current;
319
+ let count = 0;
320
+ let i = current;
320
321
  while (i.parent != null) {
321
322
  count = count + 1;
322
323
  i = i.parent;
@@ -325,8 +326,8 @@ function aStar(origin, destination, nodes) {
325
326
  }
326
327
 
327
328
  function getNodeList(current) {
328
- var curr = current;
329
- var ret = [];
329
+ let curr = current;
330
+ let ret = [];
330
331
  while (curr !== start && curr !== null) {
331
332
  ret.push(curr);
332
333
  curr = curr.parent;
@@ -338,7 +339,7 @@ function aStar(origin, destination, nodes) {
338
339
  }
339
340
 
340
341
  function areDestinationsReachable(start, destinations, nodes) {
341
- for (var i = 0; i < destinations.length; i++) {
342
+ for (let i = 0; i < destinations.length; i++) {
342
343
  if (aStar(start, destinations[i], nodes) == null) {
343
344
  return false;
344
345
  }