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.
- example_project/rapid_router_test_settings.py +164 -0
- example_project/settings.py +152 -0
- example_project/urls.py +15 -0
- example_project/{example_project/wsgi.py → wsgi.py} +2 -1
- game/__init__.py +1 -1
- game/admin.py +43 -4
- game/app_settings.py +3 -7
- game/character.py +26 -18
- game/decor.py +172 -97
- game/end_to_end_tests/base_game_test.py +44 -33
- game/end_to_end_tests/editor_page.py +17 -2
- game/end_to_end_tests/game_page.py +127 -45
- game/end_to_end_tests/selenium_test_case.py +1 -20
- game/end_to_end_tests/test_cow_crashes.py +3 -5
- game/end_to_end_tests/test_language_dropdown.py +14 -0
- game/end_to_end_tests/test_level_editor.py +290 -0
- game/end_to_end_tests/test_level_failures.py +1 -1
- game/end_to_end_tests/test_level_selection.py +79 -0
- game/end_to_end_tests/test_play_through.py +240 -102
- game/end_to_end_tests/test_python_levels.py +44 -13
- game/end_to_end_tests/test_saving_workspace.py +22 -0
- game/forms.py +9 -2
- game/level_management.py +38 -29
- game/messages.py +1218 -203
- game/migrations/0001_squashed_0025_levels_ordering_pt1.py +19 -1
- game/migrations/0026_levels_pt2.py +13 -2
- game/migrations/0032_cannot_turn_left_level.py +13 -2
- game/migrations/0033_recursion_level.py +13 -2
- game/migrations/0034_joes_level.py +13 -2
- game/migrations/0035_disable_route_score_level_70.py +0 -2
- game/migrations/0036_level_score_73.py +0 -2
- game/migrations/0037_level_score_79.py +0 -2
- game/migrations/0038_level_score_40.py +0 -1
- game/migrations/0042_level_score_73.py +0 -2
- game/migrations/0048_add_cow_field_and_blocks.py +0 -2
- game/migrations/0049_level_score_34.py +0 -2
- game/migrations/0050_level_score_40.py +0 -2
- game/migrations/0051_level_score_49.py +0 -1
- game/migrations/0076_level_locked_for_class.py +19 -0
- game/migrations/0077_alter_level_next_level.py +52 -0
- game/migrations/0078_add_block_types.py +23 -0
- game/migrations/0079_populate_block_type_add_cow_blocks.py +60 -0
- game/migrations/0080_level_disable_algorithm_score.py +18 -0
- game/migrations/0081_first_12_levels_no_algo_score.py +29 -0
- game/migrations/0082_level_43_solution.py +16 -0
- game/migrations/0083_add_cows_to_existing_levels.py +195 -0
- game/migrations/0084_alter_block_block_type.py +18 -0
- game/migrations/0085_add_new_blocks.py +53 -0
- game/migrations/0086_loop_levels.py +482 -0
- game/migrations/0087_workspace_python_view_enabled.py +18 -0
- game/migrations/0088_rename_episodes.py +35 -0
- game/migrations/0089_episodes_in_development.py +30 -0
- game/migrations/0090_add_missing_model_solutions.py +144 -0
- game/migrations/0091_disable_algo_score_if_no_model_solution.py +46 -0
- game/migrations/0092_disable_algo_score_in_custom_levels.py +28 -0
- game/migrations/0093_alter_level_character_name.py +18 -0
- game/migrations/0094_add_hint_lesson_subtitle_to_levels.py +28 -0
- game/migrations/0095_level_commands.py +18 -0
- game/migrations/0096_alter_level_commands.py +18 -0
- game/migrations/0097_add_python_den_levels.py +1515 -0
- game/migrations/0098_add_episode_link_fields.py +44 -0
- game/migrations/0099_python_episodes_links.py +103 -0
- game/migrations/0100_reorder_python_levels.py +179 -0
- game/migrations/0101_rename_episodes.py +45 -0
- game/migrations/0102_reoder_episodes_13_14.py +136 -0
- game/migrations/0103_level_1015_solution.py +26 -0
- game/migrations/0104_remove_level_direct_drive.py +17 -0
- game/migrations/0105_delete_invalid_attempts.py +18 -0
- game/migrations/0106_fields_to_snake_case.py +48 -0
- game/migrations/0107_rename_worksheet_link_episode_student_worksheet_link.py +18 -0
- game/migrations/0108_episode_indy_worksheet_link.py +18 -0
- game/migrations/0109_create_episodes_23_and_24.py +99 -0
- game/migrations/0110_remove_episode_indy_worksheet_link_and_more.py +100 -0
- game/migrations/0111_create_worksheets.py +149 -0
- game/migrations/0112_worksheet_locked_classes.py +21 -0
- game/migrations/0113_level_needs_approval.py +18 -0
- game/migrations/0114_default_and_non_student_levels_no_approval.py +31 -0
- game/migrations/0115_level_level__default_does_not_need_approval.py +22 -0
- game/migrations/0116_update_worksheet_video_links.py +68 -0
- game/migrations/0117_update_solutions_to_if_else.py +61 -0
- game/models.py +157 -16
- game/permissions.py +34 -19
- game/python_den_urls.py +26 -0
- game/random_road.py +43 -127
- game/serializers.py +12 -17
- game/static/django_reverse_js/js/reverse.js +171 -0
- game/static/game/css/LilitaOne-Regular.ttf +0 -0
- game/static/game/css/backgrounds.css +14 -10
- game/static/game/css/dataTables.custom.css +4 -2
- game/static/game/css/dataTables.jqueryui.css +561 -320
- game/static/game/css/editor.css +47 -0
- game/static/game/css/game.css +43 -49
- game/static/game/css/game_screen.css +116 -53
- game/static/game/css/jquery.dataTables.css +455 -251
- game/static/game/css/level_editor.css +10 -1
- game/static/game/css/level_selection.css +32 -3
- game/static/game/css/level_share.css +6 -5
- game/static/game/css/skulpt/codemirror.css +1 -0
- game/static/game/image/Python_Den_hero_student.png +0 -0
- game/static/game/image/Python_levels_page.svg +1954 -0
- game/static/game/image/characters/front_view/Electric_van.svg +448 -0
- game/static/game/image/characters/top_view/Electric_van.svg +448 -0
- game/static/game/image/characters/top_view/Sleigh.svg +436 -0
- game/static/game/image/decor/city/solar_panel.svg +1200 -0
- game/static/game/image/decor/farm/solar_panel.svg +86 -0
- game/static/game/image/decor/grass/solar_panel.svg +86 -0
- game/static/game/image/decor/snow/barn.svg +1788 -0
- game/static/game/image/decor/snow/cfc.svg +1050 -147
- game/static/game/image/decor/snow/crops.svg +7370 -0
- game/static/game/image/decor/snow/hospital.svg +1220 -0
- game/static/game/image/decor/snow/house1.svg +971 -0
- game/static/game/image/decor/snow/house2.svg +1574 -0
- game/static/game/image/decor/snow/school.svg +1071 -0
- game/static/game/image/decor/snow/shop.svg +3211 -0
- game/static/game/image/decor/snow/solar_panel.svg +173 -0
- game/static/game/image/electric_van.svg +448 -0
- game/static/game/image/icons/add_house.svg +26 -0
- game/static/game/image/icons/delete_house.svg +26 -0
- game/static/game/image/icons/description.svg +1 -0
- game/static/game/image/icons/hint.svg +1 -0
- game/static/game/image/icons/if_else.svg +3 -0
- game/static/game/image/icons/python.svg +1 -1
- game/static/game/image/if_else_example.png +0 -0
- game/static/game/image/pigeon.svg +684 -0
- game/static/game/image/python_den_header.svg +19 -0
- game/static/game/js/animation.js +84 -28
- game/static/game/js/blockly/msg/js/bg.js +52 -1
- game/static/game/js/blockly/msg/js/ca.js +52 -1
- game/static/game/js/blockly/msg/js/en-gb.js +52 -1
- game/static/game/js/blockly/msg/js/en.js +52 -1
- game/static/game/js/blockly/msg/js/es.js +52 -1
- game/static/game/js/blockly/msg/js/fr.js +52 -1
- game/static/game/js/blockly/msg/js/hi.js +52 -1
- game/static/game/js/blockly/msg/js/it.js +52 -1
- game/static/game/js/blockly/msg/js/pl.js +52 -1
- game/static/game/js/blockly/msg/js/pt-br.js +52 -1
- game/static/game/js/blockly/msg/js/ru.js +52 -1
- game/static/game/js/blockly/msg/js/ur.js +52 -1
- game/static/game/js/blocklyCompiler.js +550 -392
- game/static/game/js/blocklyControl.js +335 -302
- game/static/game/js/blocklyCustomBlocks.js +691 -458
- game/static/game/js/blocklyCustomisations.js +3 -1
- game/static/game/js/button.js +12 -0
- game/static/game/js/cow.js +15 -130
- game/static/game/js/drawing.js +313 -201
- game/static/game/js/editor.js +23 -0
- game/static/game/js/game.js +148 -139
- game/static/game/js/jquery.dataTables.min.js +3 -159
- game/static/game/js/level_editor.js +823 -448
- game/static/game/js/level_moderation.js +33 -2
- game/static/game/js/level_selection.js +62 -25
- game/static/game/js/loadLanguages.js +21 -0
- game/static/game/js/map.js +106 -36
- game/static/game/js/model.js +55 -107
- game/static/game/js/pathFinder.js +73 -72
- game/static/game/js/program.js +184 -193
- game/static/game/js/pythonControl.js +14 -1
- game/static/game/js/scoreboard.js +0 -37
- game/static/game/js/scoreboardSharedLevels.js +48 -0
- game/static/game/js/sharing.js +22 -10
- game/static/game/js/skulpt/codemirror.js +5 -4
- game/static/game/js/skulpt/skulpt-stdlib.js +1 -1
- game/static/game/js/sound.js +52 -5
- game/static/game/js/van.js +0 -7
- game/static/game/raphael_image/characters/top_view/Electric_van.svg +448 -0
- game/static/game/raphael_image/characters/top_view/Sleigh.svg +436 -0
- game/static/game/raphael_image/decor/city/solar_panel.svg +1200 -0
- game/static/game/raphael_image/decor/farm/solar_panel.svg +86 -0
- game/static/game/raphael_image/decor/grass/solar_panel.svg +86 -0
- game/static/game/raphael_image/decor/snow/barn.svg +1788 -0
- game/static/game/raphael_image/decor/snow/cfc.svg +1050 -147
- game/static/game/raphael_image/decor/snow/crops.svg +7370 -0
- game/static/game/raphael_image/decor/snow/hospital.svg +1220 -0
- game/static/game/raphael_image/decor/snow/house1.svg +971 -0
- game/static/game/raphael_image/decor/snow/house2.svg +1574 -0
- game/static/game/raphael_image/decor/snow/school.svg +1071 -0
- game/static/game/raphael_image/decor/snow/shop.svg +3211 -0
- game/static/game/raphael_image/decor/snow/solar_panel.svg +173 -0
- game/static/game/raphael_image/pigeon.svg +685 -0
- game/static/game/raphael_image/sleigh_wreckage.svg +430 -0
- game/static/game/sass/game.scss +22 -6
- game/static/game/sound/clown_horn.mp3 +0 -0
- game/static/game/sound/clown_horn.ogg +0 -0
- game/static/game/sound/electric_van_starting.mp3 +0 -0
- game/static/game/sound/electric_van_starting.ogg +0 -0
- game/static/game/sound/pigeon.mp3 +0 -0
- game/static/game/sound/pigeon.ogg +0 -0
- game/static/game/sound/sleigh_bells.mp3 +0 -0
- game/static/game/sound/sleigh_bells.ogg +0 -0
- game/static/game/sound/sleigh_crash.mp3 +0 -0
- game/static/game/sound/sleigh_crash.ogg +0 -0
- game/templates/game/base.html +35 -15
- game/templates/game/basenonav.html +23 -17
- game/templates/game/game.html +236 -111
- game/templates/game/level_editor.html +353 -275
- game/templates/game/level_moderation.html +19 -6
- game/templates/game/level_selection.html +75 -62
- game/templates/game/python_den_level_selection.html +291 -0
- game/templates/game/python_den_worksheet.html +101 -0
- game/templates/game/scoreboard.html +88 -65
- game/tests/test_level_editor.py +210 -35
- game/tests/test_level_moderation.py +6 -20
- game/tests/test_level_selection.py +332 -11
- game/tests/test_python_den_worksheet.py +85 -0
- game/tests/test_scoreboard.py +258 -66
- game/tests/utils/level.py +43 -3
- game/tests/utils/teacher.py +2 -2
- game/theme.py +21 -21
- game/urls.py +125 -78
- game/views/language_code_conversions.py +90 -0
- game/views/level.py +201 -63
- game/views/level_editor.py +109 -48
- game/views/level_moderation.py +29 -6
- game/views/level_selection.py +179 -56
- game/views/level_solutions.py +600 -106
- game/views/scoreboard.py +181 -66
- game/views/worksheet.py +25 -0
- rapid_router-7.6.8.dist-info/METADATA +174 -0
- {rapid_router-5.4.1.dist-info → rapid_router-7.6.8.dist-info}/RECORD +222 -242
- {rapid_router-5.4.1.dist-info → rapid_router-7.6.8.dist-info}/WHEEL +1 -1
- rapid_router-7.6.8.dist-info/licenses/LICENSE.md +3 -0
- example_project/example_project/__init__.py +0 -1
- example_project/example_project/settings.py +0 -54
- example_project/example_project/urls.py +0 -16
- example_project/manage.py +0 -10
- game/autoconfig.py +0 -59
- game/csp_config.py +0 -23
- game/locale/ar_SA/LC_MESSAGES/django.mo +0 -0
- game/locale/ar_SA/LC_MESSAGES/django.po +0 -405
- game/locale/ar_SA/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/ar_SA/LC_MESSAGES/djangojs.po +0 -743
- game/locale/bg_BG/LC_MESSAGES/django.mo +0 -0
- game/locale/bg_BG/LC_MESSAGES/django.po +0 -405
- game/locale/bg_BG/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/bg_BG/LC_MESSAGES/djangojs.po +0 -739
- game/locale/ca_ES/LC_MESSAGES/django.mo +0 -0
- game/locale/ca_ES/LC_MESSAGES/django.po +0 -405
- game/locale/ca_ES/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/ca_ES/LC_MESSAGES/djangojs.po +0 -740
- game/locale/cs_CZ/LC_MESSAGES/django.mo +0 -0
- game/locale/cs_CZ/LC_MESSAGES/django.po +0 -405
- game/locale/cs_CZ/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/cs_CZ/LC_MESSAGES/djangojs.po +0 -741
- game/locale/cy_GB/LC_MESSAGES/django.mo +0 -0
- game/locale/cy_GB/LC_MESSAGES/django.po +0 -405
- game/locale/cy_GB/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/cy_GB/LC_MESSAGES/djangojs.po +0 -743
- game/locale/de_DE/LC_MESSAGES/django.mo +0 -0
- game/locale/de_DE/LC_MESSAGES/django.po +0 -405
- game/locale/de_DE/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/de_DE/LC_MESSAGES/djangojs.po +0 -739
- game/locale/el_GR/LC_MESSAGES/django.mo +0 -0
- game/locale/el_GR/LC_MESSAGES/django.po +0 -405
- game/locale/el_GR/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/el_GR/LC_MESSAGES/djangojs.po +0 -739
- game/locale/en_GB/LC_MESSAGES/django.mo +0 -0
- game/locale/en_GB/LC_MESSAGES/django.po +0 -405
- game/locale/en_GB/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/en_GB/LC_MESSAGES/djangojs.po +0 -739
- game/locale/es_ES/LC_MESSAGES/django.mo +0 -0
- game/locale/es_ES/LC_MESSAGES/django.po +0 -405
- game/locale/es_ES/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/es_ES/LC_MESSAGES/djangojs.po +0 -739
- game/locale/fi_FI/LC_MESSAGES/django.mo +0 -0
- game/locale/fi_FI/LC_MESSAGES/django.po +0 -405
- game/locale/fi_FI/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/fi_FI/LC_MESSAGES/djangojs.po +0 -739
- game/locale/fr_FR/LC_MESSAGES/django.mo +0 -0
- game/locale/fr_FR/LC_MESSAGES/django.po +0 -405
- game/locale/fr_FR/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/fr_FR/LC_MESSAGES/djangojs.po +0 -739
- game/locale/gu_IN/LC_MESSAGES/django.mo +0 -0
- game/locale/gu_IN/LC_MESSAGES/django.po +0 -405
- game/locale/gu_IN/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/gu_IN/LC_MESSAGES/djangojs.po +0 -739
- game/locale/hi_IN/LC_MESSAGES/django.mo +0 -0
- game/locale/hi_IN/LC_MESSAGES/django.po +0 -405
- game/locale/hi_IN/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/hi_IN/LC_MESSAGES/djangojs.po +0 -739
- game/locale/id_ID/LC_MESSAGES/django.mo +0 -0
- game/locale/id_ID/LC_MESSAGES/django.po +0 -405
- game/locale/id_ID/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/id_ID/LC_MESSAGES/djangojs.po +0 -738
- game/locale/it_IT/LC_MESSAGES/django.mo +0 -0
- game/locale/it_IT/LC_MESSAGES/django.po +0 -405
- game/locale/it_IT/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/it_IT/LC_MESSAGES/djangojs.po +0 -739
- game/locale/ja_JP/LC_MESSAGES/django.mo +0 -0
- game/locale/ja_JP/LC_MESSAGES/django.po +0 -405
- game/locale/ja_JP/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/ja_JP/LC_MESSAGES/djangojs.po +0 -738
- game/locale/lol_US/LC_MESSAGES/django.mo +0 -0
- game/locale/lol_US/LC_MESSAGES/django.po +0 -405
- game/locale/lol_US/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/lol_US/LC_MESSAGES/djangojs.po +0 -739
- game/locale/nb_NO/LC_MESSAGES/django.mo +0 -0
- game/locale/nb_NO/LC_MESSAGES/django.po +0 -405
- game/locale/nb_NO/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/nb_NO/LC_MESSAGES/djangojs.po +0 -739
- game/locale/nl_NL/LC_MESSAGES/django.mo +0 -0
- game/locale/nl_NL/LC_MESSAGES/django.po +0 -405
- game/locale/nl_NL/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/nl_NL/LC_MESSAGES/djangojs.po +0 -739
- game/locale/pl_PL/LC_MESSAGES/django.mo +0 -0
- game/locale/pl_PL/LC_MESSAGES/django.po +0 -405
- game/locale/pl_PL/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/pl_PL/LC_MESSAGES/djangojs.po +0 -741
- game/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
- game/locale/pt_BR/LC_MESSAGES/django.po +0 -405
- game/locale/pt_BR/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/pt_BR/LC_MESSAGES/djangojs.po +0 -739
- game/locale/pt_PT/LC_MESSAGES/django.mo +0 -0
- game/locale/pt_PT/LC_MESSAGES/django.po +0 -405
- game/locale/pt_PT/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/pt_PT/LC_MESSAGES/djangojs.po +0 -739
- game/locale/ro_RO/LC_MESSAGES/django.mo +0 -0
- game/locale/ro_RO/LC_MESSAGES/django.po +0 -405
- game/locale/ro_RO/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/ro_RO/LC_MESSAGES/djangojs.po +0 -740
- game/locale/ru_RU/LC_MESSAGES/django.mo +0 -0
- game/locale/ru_RU/LC_MESSAGES/django.po +0 -405
- game/locale/ru_RU/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/ru_RU/LC_MESSAGES/djangojs.po +0 -741
- game/locale/sv_SE/LC_MESSAGES/django.mo +0 -0
- game/locale/sv_SE/LC_MESSAGES/django.po +0 -405
- game/locale/sv_SE/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/sv_SE/LC_MESSAGES/djangojs.po +0 -739
- game/locale/tl_PH/LC_MESSAGES/django.mo +0 -0
- game/locale/tl_PH/LC_MESSAGES/django.po +0 -405
- game/locale/tl_PH/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/tl_PH/LC_MESSAGES/djangojs.po +0 -739
- game/locale/tlh_AA/LC_MESSAGES/django.mo +0 -0
- game/locale/tlh_AA/LC_MESSAGES/django.po +0 -405
- game/locale/tlh_AA/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/tlh_AA/LC_MESSAGES/djangojs.po +0 -739
- game/locale/tr_TR/LC_MESSAGES/django.mo +0 -0
- game/locale/tr_TR/LC_MESSAGES/django.po +0 -405
- game/locale/tr_TR/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/tr_TR/LC_MESSAGES/djangojs.po +0 -740
- game/locale/ur_IN/LC_MESSAGES/django.mo +0 -0
- game/locale/ur_IN/LC_MESSAGES/django.po +0 -405
- game/locale/ur_IN/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/ur_IN/LC_MESSAGES/djangojs.po +0 -739
- game/locale/ur_PK/LC_MESSAGES/django.mo +0 -0
- game/locale/ur_PK/LC_MESSAGES/django.po +0 -405
- game/locale/ur_PK/LC_MESSAGES/djangojs.mo +0 -0
- game/locale/ur_PK/LC_MESSAGES/djangojs.po +0 -739
- game/static/game/image/actions/go.svg +0 -18
- game/static/game/image/icons/destination.svg +0 -9
- game/static/game/js/pqselect.min.js +0 -9
- game/static/game/js/widget-scroller.js +0 -906
- rapid_router-5.4.1.dist-info/LICENSE.md +0 -577
- rapid_router-5.4.1.dist-info/METADATA +0 -24
- {rapid_router-5.4.1.dist-info → rapid_router-7.6.8.dist-info}/top_level.txt +0 -0
game/decor.py
CHANGED
|
@@ -3,15 +3,18 @@
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
from builtins import object
|
|
6
|
+
|
|
6
7
|
from rest_framework.reverse import reverse
|
|
8
|
+
|
|
7
9
|
from game.theme import get_theme, get_all_themes
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
class Decor(object):
|
|
11
|
-
def __init__(self, pk, name, url, width, height, theme, z_index):
|
|
13
|
+
def __init__(self, pk, name, url, xmas_url, width, height, theme, z_index):
|
|
12
14
|
self.id = self.pk = pk
|
|
13
15
|
self.name = name
|
|
14
16
|
self.url = url
|
|
17
|
+
self.xmas_url = xmas_url
|
|
15
18
|
self.width = width
|
|
16
19
|
self.height = height
|
|
17
20
|
self.theme = theme
|
|
@@ -19,297 +22,369 @@ class Decor(object):
|
|
|
19
22
|
|
|
20
23
|
|
|
21
24
|
DECOR_DATA = {
|
|
22
|
-
(
|
|
25
|
+
("tree1", "grass"): Decor(
|
|
23
26
|
z_index=4,
|
|
24
|
-
name=
|
|
25
|
-
url=
|
|
27
|
+
name="tree1",
|
|
28
|
+
url="decor/grass/tree1.svg",
|
|
29
|
+
xmas_url="decor/snow/tree1.svg",
|
|
26
30
|
height=100,
|
|
27
31
|
width=100,
|
|
28
32
|
theme=get_theme("grass"),
|
|
29
33
|
pk=1,
|
|
30
34
|
),
|
|
31
|
-
(
|
|
35
|
+
("tree2", "grass"): Decor(
|
|
32
36
|
z_index=4,
|
|
33
|
-
name=
|
|
34
|
-
url=
|
|
37
|
+
name="tree2",
|
|
38
|
+
url="decor/grass/tree2.svg",
|
|
39
|
+
xmas_url="decor/snow/tree2.svg",
|
|
35
40
|
height=100,
|
|
36
41
|
width=100,
|
|
37
42
|
theme=get_theme("grass"),
|
|
38
43
|
pk=2,
|
|
39
44
|
),
|
|
40
|
-
(
|
|
45
|
+
("bush", "grass"): Decor(
|
|
41
46
|
z_index=3,
|
|
42
|
-
name=
|
|
43
|
-
url=
|
|
47
|
+
name="bush",
|
|
48
|
+
url="decor/grass/bush.svg",
|
|
49
|
+
xmas_url="decor/snow/bush.svg",
|
|
44
50
|
height=50,
|
|
45
51
|
width=50,
|
|
46
52
|
theme=get_theme("grass"),
|
|
47
53
|
pk=3,
|
|
48
54
|
),
|
|
49
|
-
(
|
|
55
|
+
("house", "grass"): Decor(
|
|
50
56
|
z_index=1,
|
|
51
|
-
name=
|
|
52
|
-
url=
|
|
57
|
+
name="house",
|
|
58
|
+
url="decor/grass/house.svg",
|
|
59
|
+
xmas_url="decor/snow/house.svg",
|
|
53
60
|
height=50,
|
|
54
61
|
width=50,
|
|
55
62
|
theme=get_theme("grass"),
|
|
56
63
|
pk=4,
|
|
57
64
|
),
|
|
58
|
-
(
|
|
65
|
+
("cfc", "grass"): Decor(
|
|
59
66
|
z_index=1,
|
|
60
|
-
name=
|
|
67
|
+
name="cfc",
|
|
61
68
|
# FUTURE: add external branding option
|
|
62
|
-
url=
|
|
69
|
+
url="decor/grass/cfc.svg",
|
|
70
|
+
xmas_url="decor/snow/cfc.svg",
|
|
63
71
|
height=107,
|
|
64
72
|
width=100,
|
|
65
73
|
theme=get_theme("grass"),
|
|
66
74
|
pk=5,
|
|
67
75
|
),
|
|
68
|
-
(
|
|
76
|
+
("pond", "grass"): Decor(
|
|
69
77
|
z_index=2,
|
|
70
|
-
name=
|
|
71
|
-
url=
|
|
78
|
+
name="pond",
|
|
79
|
+
url="decor/grass/pond.svg",
|
|
80
|
+
xmas_url="decor/snow/pond.svg",
|
|
72
81
|
height=100,
|
|
73
82
|
width=150,
|
|
74
83
|
theme=get_theme("grass"),
|
|
75
84
|
pk=6,
|
|
76
85
|
),
|
|
77
|
-
(
|
|
86
|
+
("tree1", "snow"): Decor(
|
|
78
87
|
z_index=4,
|
|
79
|
-
name=
|
|
80
|
-
url=
|
|
88
|
+
name="tree1",
|
|
89
|
+
url="decor/snow/tree1.svg",
|
|
90
|
+
xmas_url="decor/snow/tree1.svg",
|
|
81
91
|
height=100,
|
|
82
92
|
width=100,
|
|
83
93
|
theme=get_theme("snow"),
|
|
84
94
|
pk=7,
|
|
85
95
|
),
|
|
86
|
-
(
|
|
96
|
+
("tree2", "snow"): Decor(
|
|
87
97
|
z_index=4,
|
|
88
|
-
name=
|
|
89
|
-
url=
|
|
98
|
+
name="tree2",
|
|
99
|
+
url="decor/snow/tree2.svg",
|
|
100
|
+
xmas_url="decor/snow/tree2.svg",
|
|
90
101
|
height=100,
|
|
91
102
|
width=100,
|
|
92
103
|
theme=get_theme("snow"),
|
|
93
104
|
pk=8,
|
|
94
105
|
),
|
|
95
|
-
(
|
|
106
|
+
("bush", "snow"): Decor(
|
|
96
107
|
z_index=3,
|
|
97
|
-
name=
|
|
98
|
-
url=
|
|
108
|
+
name="bush",
|
|
109
|
+
url="decor/snow/bush.svg",
|
|
110
|
+
xmas_url="decor/snow/bush.svg",
|
|
99
111
|
height=50,
|
|
100
112
|
width=50,
|
|
101
113
|
theme=get_theme("snow"),
|
|
102
114
|
pk=9,
|
|
103
115
|
),
|
|
104
|
-
(
|
|
116
|
+
("house", "snow"): Decor(
|
|
105
117
|
z_index=1,
|
|
106
|
-
name=
|
|
107
|
-
url=
|
|
118
|
+
name="house",
|
|
119
|
+
url="decor/snow/house.svg",
|
|
120
|
+
xmas_url="decor/snow/house.svg",
|
|
108
121
|
height=50,
|
|
109
122
|
width=50,
|
|
110
123
|
theme=get_theme("snow"),
|
|
111
124
|
pk=10,
|
|
112
125
|
),
|
|
113
|
-
(
|
|
126
|
+
("cfc", "snow"): Decor(
|
|
114
127
|
z_index=1,
|
|
115
|
-
name=
|
|
128
|
+
name="cfc",
|
|
116
129
|
# FUTURE: add external branding option
|
|
117
|
-
url=
|
|
130
|
+
url="decor/snow/cfc.svg",
|
|
131
|
+
xmas_url="decor/snow/cfc.svg",
|
|
118
132
|
height=107,
|
|
119
133
|
width=100,
|
|
120
134
|
theme=get_theme("snow"),
|
|
121
135
|
pk=11,
|
|
122
136
|
),
|
|
123
|
-
(
|
|
137
|
+
("pond", "snow"): Decor(
|
|
124
138
|
z_index=2,
|
|
125
|
-
name=
|
|
126
|
-
url=
|
|
139
|
+
name="pond",
|
|
140
|
+
url="decor/snow/pond.svg",
|
|
141
|
+
xmas_url="decor/snow/pond.svg",
|
|
127
142
|
height=100,
|
|
128
143
|
width=150,
|
|
129
144
|
theme=get_theme("snow"),
|
|
130
145
|
pk=12,
|
|
131
146
|
),
|
|
132
|
-
(
|
|
147
|
+
("tile1", "grass"): Decor(
|
|
133
148
|
z_index=0,
|
|
134
|
-
name=
|
|
135
|
-
url=
|
|
149
|
+
name="tile1",
|
|
150
|
+
url="decor/grass/tile1.svg",
|
|
151
|
+
xmas_url="decor/snow/tile1.svg",
|
|
136
152
|
height=100,
|
|
137
153
|
width=100,
|
|
138
154
|
theme=get_theme("grass"),
|
|
139
155
|
pk=13,
|
|
140
156
|
),
|
|
141
|
-
(
|
|
157
|
+
("tile1", "snow"): Decor(
|
|
142
158
|
z_index=0,
|
|
143
|
-
name=
|
|
144
|
-
url=
|
|
159
|
+
name="tile1",
|
|
160
|
+
url="decor/snow/tile1.svg",
|
|
161
|
+
xmas_url="decor/snow/tile1.svg",
|
|
145
162
|
height=100,
|
|
146
163
|
width=100,
|
|
147
164
|
theme=get_theme("snow"),
|
|
148
165
|
pk=14,
|
|
149
166
|
),
|
|
150
|
-
(
|
|
167
|
+
("tile2", "snow"): Decor(
|
|
151
168
|
z_index=0,
|
|
152
|
-
name=
|
|
153
|
-
url=
|
|
169
|
+
name="tile2",
|
|
170
|
+
url="decor/snow/tile2.svg",
|
|
171
|
+
xmas_url="decor/snow/tile2.svg",
|
|
154
172
|
height=100,
|
|
155
173
|
width=100,
|
|
156
174
|
theme=get_theme("snow"),
|
|
157
175
|
pk=15,
|
|
158
176
|
),
|
|
159
|
-
(
|
|
177
|
+
("house", "farm"): Decor(
|
|
160
178
|
z_index=1,
|
|
161
|
-
name=
|
|
162
|
-
url=
|
|
179
|
+
name="house",
|
|
180
|
+
url="decor/farm/house1.svg",
|
|
181
|
+
xmas_url="decor/snow/house1.svg",
|
|
163
182
|
height=224,
|
|
164
183
|
width=184,
|
|
165
184
|
theme=get_theme("farm"),
|
|
166
185
|
pk=16,
|
|
167
186
|
),
|
|
168
|
-
(
|
|
187
|
+
("cfc", "farm"): Decor(
|
|
169
188
|
z_index=1,
|
|
170
|
-
name=
|
|
171
|
-
url=
|
|
189
|
+
name="cfc",
|
|
190
|
+
url="decor/farm/cfc.svg",
|
|
191
|
+
xmas_url="decor/snow/barn.svg",
|
|
172
192
|
height=301,
|
|
173
193
|
width=332,
|
|
174
194
|
theme=get_theme("farm"),
|
|
175
195
|
pk=17,
|
|
176
196
|
),
|
|
177
|
-
(
|
|
197
|
+
("bush", "farm"): Decor(
|
|
178
198
|
z_index=3,
|
|
179
|
-
name=
|
|
180
|
-
url=
|
|
199
|
+
name="bush",
|
|
200
|
+
url="decor/farm/bush.svg",
|
|
201
|
+
xmas_url="decor/snow/bush.svg",
|
|
181
202
|
height=30,
|
|
182
203
|
width=50,
|
|
183
204
|
theme=get_theme("farm"),
|
|
184
205
|
pk=18,
|
|
185
206
|
),
|
|
186
|
-
(
|
|
207
|
+
("tree1", "farm"): Decor(
|
|
187
208
|
z_index=4,
|
|
188
|
-
name=
|
|
189
|
-
url=
|
|
209
|
+
name="tree1",
|
|
210
|
+
url="decor/farm/tree1.svg",
|
|
211
|
+
xmas_url="decor/snow/tree1.svg",
|
|
190
212
|
height=100,
|
|
191
213
|
width=100,
|
|
192
214
|
theme=get_theme("farm"),
|
|
193
215
|
pk=19,
|
|
194
216
|
),
|
|
195
|
-
(
|
|
217
|
+
("tree2", "farm"): Decor(
|
|
196
218
|
z_index=4,
|
|
197
|
-
name=
|
|
198
|
-
url=
|
|
219
|
+
name="tree2",
|
|
220
|
+
url="decor/farm/house2.svg",
|
|
221
|
+
xmas_url="decor/snow/house.svg",
|
|
199
222
|
height=88,
|
|
200
223
|
width=65,
|
|
201
224
|
theme=get_theme("farm"),
|
|
202
225
|
pk=20,
|
|
203
226
|
),
|
|
204
|
-
(
|
|
227
|
+
("pond", "farm"): Decor(
|
|
205
228
|
z_index=2,
|
|
206
|
-
name=
|
|
207
|
-
url=
|
|
229
|
+
name="pond",
|
|
230
|
+
url="decor/farm/crops.svg",
|
|
231
|
+
xmas_url="decor/snow/crops.svg",
|
|
208
232
|
height=100,
|
|
209
233
|
width=150,
|
|
210
234
|
theme=get_theme("farm"),
|
|
211
235
|
pk=21,
|
|
212
236
|
),
|
|
213
|
-
(
|
|
237
|
+
("tile1", "farm"): Decor(
|
|
214
238
|
z_index=0,
|
|
215
|
-
name=
|
|
216
|
-
url=
|
|
239
|
+
name="tile1",
|
|
240
|
+
url="decor/farm/tile1.svg",
|
|
241
|
+
xmas_url="decor/snow/tile1.svg",
|
|
217
242
|
height=337,
|
|
218
243
|
width=194,
|
|
219
244
|
theme=get_theme("farm"),
|
|
220
245
|
pk=22,
|
|
221
246
|
),
|
|
222
|
-
(
|
|
247
|
+
("tile1", "city"): Decor(
|
|
223
248
|
z_index=0,
|
|
224
|
-
name=
|
|
225
|
-
url=
|
|
249
|
+
name="tile1",
|
|
250
|
+
url="decor/city/pavementTile.png",
|
|
251
|
+
xmas_url="decor/snow/tile1.svg",
|
|
226
252
|
height=100,
|
|
227
253
|
width=100,
|
|
228
254
|
theme=get_theme("city"),
|
|
229
255
|
pk=23,
|
|
230
256
|
),
|
|
231
|
-
(
|
|
257
|
+
("house", "city"): Decor(
|
|
232
258
|
z_index=1,
|
|
233
|
-
name=
|
|
234
|
-
url=
|
|
259
|
+
name="house",
|
|
260
|
+
url="decor/city/house.svg",
|
|
261
|
+
xmas_url="decor/snow/house2.svg",
|
|
235
262
|
height=50,
|
|
236
263
|
width=50,
|
|
237
264
|
theme=get_theme("city"),
|
|
238
265
|
pk=24,
|
|
239
266
|
),
|
|
240
|
-
(
|
|
267
|
+
("bush", "city"): Decor(
|
|
241
268
|
z_index=3,
|
|
242
|
-
name=
|
|
243
|
-
url=
|
|
269
|
+
name="bush",
|
|
270
|
+
url="decor/city/bush.svg",
|
|
271
|
+
xmas_url="decor/snow/bush.svg",
|
|
244
272
|
height=50,
|
|
245
273
|
width=50,
|
|
246
274
|
theme=get_theme("city"),
|
|
247
275
|
pk=25,
|
|
248
276
|
),
|
|
249
|
-
(
|
|
277
|
+
("tree1", "city"): Decor(
|
|
250
278
|
z_index=4,
|
|
251
|
-
name=
|
|
252
|
-
url=
|
|
279
|
+
name="tree1",
|
|
280
|
+
url="decor/city/shop.svg",
|
|
281
|
+
xmas_url="decor/snow/shop.svg",
|
|
253
282
|
height=70,
|
|
254
283
|
width=70,
|
|
255
284
|
theme=get_theme("city"),
|
|
256
285
|
pk=26,
|
|
257
286
|
),
|
|
258
|
-
(
|
|
287
|
+
("tree2", "city"): Decor(
|
|
259
288
|
z_index=4,
|
|
260
|
-
name=
|
|
261
|
-
url=
|
|
289
|
+
name="tree2",
|
|
290
|
+
url="decor/city/school.svg",
|
|
291
|
+
xmas_url="decor/snow/school.svg",
|
|
262
292
|
height=100,
|
|
263
293
|
width=100,
|
|
264
294
|
theme=get_theme("city"),
|
|
265
295
|
pk=27,
|
|
266
296
|
),
|
|
267
|
-
(
|
|
297
|
+
("pond", "city"): Decor(
|
|
268
298
|
z_index=2,
|
|
269
|
-
name=
|
|
270
|
-
url=
|
|
299
|
+
name="pond",
|
|
300
|
+
url="decor/city/hospital.svg",
|
|
301
|
+
xmas_url="decor/snow/hospital.svg",
|
|
271
302
|
height=157,
|
|
272
303
|
width=140,
|
|
273
304
|
theme=get_theme("city"),
|
|
274
305
|
pk=28,
|
|
275
306
|
),
|
|
276
|
-
(
|
|
307
|
+
("cfc", "city"): Decor(
|
|
277
308
|
z_index=1,
|
|
278
|
-
name=
|
|
309
|
+
name="cfc",
|
|
279
310
|
# FUTURE: add external branding option
|
|
280
|
-
url=
|
|
311
|
+
url="decor/grass/cfc.svg",
|
|
312
|
+
xmas_url="decor/snow/cfc.svg",
|
|
281
313
|
height=107,
|
|
282
314
|
width=100,
|
|
283
315
|
theme=get_theme("city"),
|
|
284
316
|
pk=29,
|
|
285
317
|
),
|
|
286
|
-
(
|
|
318
|
+
("tile2", "grass"): Decor(
|
|
287
319
|
z_index=0,
|
|
288
|
-
name=
|
|
289
|
-
url=
|
|
320
|
+
name="tile2",
|
|
321
|
+
url="decor/snow/tile2.svg",
|
|
322
|
+
xmas_url="decor/snow/tile2.svg",
|
|
290
323
|
height=100,
|
|
291
324
|
width=100,
|
|
292
325
|
theme=get_theme("grass"),
|
|
293
326
|
pk=30,
|
|
294
327
|
),
|
|
295
|
-
(
|
|
328
|
+
("tile2", "farm"): Decor(
|
|
296
329
|
z_index=0,
|
|
297
|
-
name=
|
|
298
|
-
url=
|
|
330
|
+
name="tile2",
|
|
331
|
+
url="decor/snow/tile2.svg",
|
|
332
|
+
xmas_url="decor/snow/tile2.svg",
|
|
299
333
|
height=100,
|
|
300
334
|
width=100,
|
|
301
335
|
theme=get_theme("farm"),
|
|
302
336
|
pk=31,
|
|
303
337
|
),
|
|
304
|
-
(
|
|
338
|
+
("tile2", "city"): Decor(
|
|
305
339
|
z_index=0,
|
|
306
|
-
name=
|
|
307
|
-
url=
|
|
340
|
+
name="tile2",
|
|
341
|
+
url="decor/snow/tile2.svg",
|
|
342
|
+
xmas_url="decor/snow/tile2.svg",
|
|
308
343
|
height=100,
|
|
309
344
|
width=100,
|
|
310
345
|
theme=get_theme("city"),
|
|
311
346
|
pk=32,
|
|
312
347
|
),
|
|
348
|
+
("solar_panel", "grass"): Decor(
|
|
349
|
+
z_index=4,
|
|
350
|
+
name="solar_panel",
|
|
351
|
+
url="decor/grass/solar_panel.svg",
|
|
352
|
+
xmas_url="decor/snow/tree1.svg",
|
|
353
|
+
height=100,
|
|
354
|
+
width=100,
|
|
355
|
+
theme=get_theme("grass"),
|
|
356
|
+
pk=33
|
|
357
|
+
),
|
|
358
|
+
("solar_panel", "farm"): Decor(
|
|
359
|
+
z_index=4,
|
|
360
|
+
name="solar_panel",
|
|
361
|
+
url="decor/farm/solar_panel.svg",
|
|
362
|
+
xmas_url="decor/snow/tree1.svg",
|
|
363
|
+
height=100,
|
|
364
|
+
width=100,
|
|
365
|
+
theme=get_theme("farm"),
|
|
366
|
+
pk=34
|
|
367
|
+
),
|
|
368
|
+
("solar_panel", "snow"): Decor(
|
|
369
|
+
z_index=4,
|
|
370
|
+
name="solar_panel",
|
|
371
|
+
url="decor/snow/solar_panel.svg",
|
|
372
|
+
xmas_url="decor/snow/solar_panel.svg",
|
|
373
|
+
height=100,
|
|
374
|
+
width=100,
|
|
375
|
+
theme=get_theme("snow"),
|
|
376
|
+
pk=35
|
|
377
|
+
),
|
|
378
|
+
("solar_panel", "city"): Decor(
|
|
379
|
+
z_index=4,
|
|
380
|
+
name="solar_panel",
|
|
381
|
+
url="decor/city/solar_panel.svg",
|
|
382
|
+
xmas_url="decor/snow/solar_panel.svg",
|
|
383
|
+
height=100,
|
|
384
|
+
width=100,
|
|
385
|
+
theme=get_theme("city"),
|
|
386
|
+
pk=36
|
|
387
|
+
)
|
|
313
388
|
}
|
|
314
389
|
|
|
315
390
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import socket
|
|
3
|
+
import time
|
|
3
4
|
from builtins import str
|
|
4
5
|
|
|
5
|
-
import time
|
|
6
6
|
from common.models import UserProfile
|
|
7
7
|
from common.tests.utils.classes import create_class_directly
|
|
8
8
|
from common.tests.utils.organisation import create_organisation_directly
|
|
9
9
|
from common.tests.utils.student import create_school_student_directly
|
|
10
10
|
from common.tests.utils.teacher import signup_teacher_directly
|
|
11
|
-
from django.core.management import call_command
|
|
12
11
|
from django.urls import reverse
|
|
12
|
+
from portal.tests.pageObjects.portal.base_page import BasePage
|
|
13
13
|
from portal.tests.pageObjects.portal.home_page import HomePage
|
|
14
14
|
|
|
15
15
|
from game.models import Workspace
|
|
@@ -43,15 +43,17 @@ class BaseGameTest(SeleniumTestCase):
|
|
|
43
43
|
else:
|
|
44
44
|
break
|
|
45
45
|
|
|
46
|
-
def _complete_level(self, level_number, **kwargs):
|
|
47
|
-
page = self.go_to_level(level_number)
|
|
48
|
-
self.complete_and_check_level(level_number, page, **kwargs)
|
|
46
|
+
def _complete_level(self, level_number, from_python_den=False, **kwargs):
|
|
47
|
+
page = self.go_to_level(level_number, from_python_den)
|
|
48
|
+
(self.complete_and_check_level(level_number, page, from_python_den, **kwargs))
|
|
49
49
|
|
|
50
50
|
def complete_and_check_level(
|
|
51
51
|
self,
|
|
52
52
|
level_number,
|
|
53
53
|
page,
|
|
54
|
+
from_python_den=False,
|
|
54
55
|
next_episode=None,
|
|
56
|
+
redirects=False,
|
|
55
57
|
check_algorithm_score=True,
|
|
56
58
|
check_route_score=True,
|
|
57
59
|
final_level=False,
|
|
@@ -60,33 +62,56 @@ class BaseGameTest(SeleniumTestCase):
|
|
|
60
62
|
if check_algorithm_score:
|
|
61
63
|
page.assert_algorithm_score(10)
|
|
62
64
|
if check_route_score:
|
|
63
|
-
|
|
65
|
+
if level_number < 13 and not from_python_den:
|
|
66
|
+
page.assert_route_score(20)
|
|
67
|
+
else:
|
|
68
|
+
page.assert_route_score(10)
|
|
64
69
|
if final_level:
|
|
65
70
|
return page
|
|
66
71
|
if next_episode is None:
|
|
67
|
-
|
|
68
|
-
|
|
72
|
+
if redirects:
|
|
73
|
+
page.next_level_redirected(from_python_den)
|
|
74
|
+
else:
|
|
75
|
+
page.next_level(from_python_den)
|
|
76
|
+
page.assert_level_number(level_number + 1, from_python_den)
|
|
69
77
|
else:
|
|
70
78
|
page.next_episode()
|
|
71
|
-
page.assert_episode_number(next_episode)
|
|
79
|
+
page.assert_episode_number(next_episode, from_python_den)
|
|
72
80
|
return page
|
|
73
81
|
|
|
82
|
+
def go_to_reverse(self, url_reverse):
|
|
83
|
+
path = reverse(url_reverse)
|
|
84
|
+
self._go_to_path(path)
|
|
85
|
+
return BasePage(self.selenium)
|
|
86
|
+
|
|
74
87
|
def go_to_homepage(self):
|
|
75
88
|
path = reverse("home")
|
|
76
89
|
self._go_to_path(path)
|
|
77
90
|
return HomePage(self.selenium)
|
|
78
91
|
|
|
79
|
-
def go_to_level(self, level_name):
|
|
80
|
-
|
|
92
|
+
def go_to_level(self, level_name, from_python_den=False):
|
|
93
|
+
viewname = (
|
|
94
|
+
"play_python_default_level" if from_python_den else "play_default_level"
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
path = reverse(viewname, kwargs={"level_name": str(level_name)})
|
|
81
98
|
self._go_to_path(path)
|
|
82
|
-
self.selenium.execute_script("ocargo.animation.FAST_ANIMATION_DURATION = 1;")
|
|
83
99
|
|
|
84
100
|
return GamePage(self.selenium)
|
|
85
101
|
|
|
102
|
+
def go_to_level_without_dismissing_dialog(self, level_name, from_python_den=False):
|
|
103
|
+
viewname = (
|
|
104
|
+
"play_python_default_level" if from_python_den else "play_default_level"
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
path = reverse(viewname, kwargs={"level_name": str(level_name)})
|
|
108
|
+
self._go_to_path(path)
|
|
109
|
+
|
|
110
|
+
return BasePage(self.selenium)
|
|
111
|
+
|
|
86
112
|
def go_to_custom_level(self, level):
|
|
87
113
|
path = reverse("play_custom_level", kwargs={"levelId": str(level.id)})
|
|
88
114
|
self._go_to_path(path)
|
|
89
|
-
self.selenium.execute_script("ocargo.animation.FAST_ANIMATION_DURATION = 1;")
|
|
90
115
|
|
|
91
116
|
return GamePage(self.selenium)
|
|
92
117
|
|
|
@@ -96,9 +121,11 @@ class BaseGameTest(SeleniumTestCase):
|
|
|
96
121
|
return EditorPage(self.selenium)
|
|
97
122
|
|
|
98
123
|
def go_to_episode(self, episodeId):
|
|
99
|
-
|
|
124
|
+
if int(episodeId) > 9:
|
|
125
|
+
path = reverse("start_python_episode", kwargs={"episodeId": str(episodeId)})
|
|
126
|
+
else:
|
|
127
|
+
path = reverse("start_episode", kwargs={"episodeId": str(episodeId)})
|
|
100
128
|
self._go_to_path(path)
|
|
101
|
-
self.selenium.execute_script("ocargo.animation.FAST_ANIMATION_DURATION = 1;")
|
|
102
129
|
|
|
103
130
|
return GamePage(self.selenium)
|
|
104
131
|
|
|
@@ -123,23 +150,8 @@ class BaseGameTest(SeleniumTestCase):
|
|
|
123
150
|
self.go_to_level(level).load_solution(workspace_id).run_crashing_program()
|
|
124
151
|
)
|
|
125
152
|
|
|
126
|
-
def
|
|
127
|
-
return self.
|
|
128
|
-
|
|
129
|
-
def run_clear_console_test(self, level):
|
|
130
|
-
return self.go_to_level(level).write_to_then_clear_console()
|
|
131
|
-
|
|
132
|
-
def run_console_parse_error_test(self, level):
|
|
133
|
-
return self.go_to_level(level).run_parse_error_program()
|
|
134
|
-
|
|
135
|
-
def run_console_attribute_error_test(self, level):
|
|
136
|
-
return self.go_to_level(level).run_attribute_error_program()
|
|
137
|
-
|
|
138
|
-
def run_console_print_test(self, level):
|
|
139
|
-
return self.go_to_level(level).run_print_program()
|
|
140
|
-
|
|
141
|
-
def run_invalid_import_test(self, level):
|
|
142
|
-
return self.go_to_level(level).run_invalid_import_program()
|
|
153
|
+
def run_animal_sound_horn_test(self, level):
|
|
154
|
+
return self.go_to_custom_level(level).run_animal_sound_horn_program()
|
|
143
155
|
|
|
144
156
|
def running_out_of_instructions_test(self, level, workspace_file):
|
|
145
157
|
user_profile = self.login_once()
|
|
@@ -221,7 +233,6 @@ class BaseGameTest(SeleniumTestCase):
|
|
|
221
233
|
@classmethod
|
|
222
234
|
def setUpClass(cls):
|
|
223
235
|
super().setUpClass()
|
|
224
|
-
call_command("collectstatic", "--noinput")
|
|
225
236
|
|
|
226
237
|
@classmethod
|
|
227
238
|
def tearDownClass(cls):
|
|
@@ -16,8 +16,23 @@ class EditorPage(BasePage):
|
|
|
16
16
|
|
|
17
17
|
def dismiss_dialog(self, button_id):
|
|
18
18
|
self.wait_for_element_to_be_clickable((By.ID, button_id), wait_seconds=15)
|
|
19
|
-
self.browser.
|
|
19
|
+
self.browser.find_element(By.ID, button_id).click()
|
|
20
20
|
self.wait_for_element_to_be_invisible((By.ID, button_id), wait_seconds=15)
|
|
21
21
|
|
|
22
22
|
def go_to_code_tab(self):
|
|
23
|
-
self.browser.
|
|
23
|
+
self.browser.find_element(By.ID, "blocks_tab").click()
|
|
24
|
+
|
|
25
|
+
def go_to_scenery_tab(self):
|
|
26
|
+
self.browser.find_element(By.ID, "scenery_tab").click()
|
|
27
|
+
|
|
28
|
+
def go_to_character_tab(self):
|
|
29
|
+
self.browser.find_element(By.ID, "character_tab").click()
|
|
30
|
+
|
|
31
|
+
def go_to_description_tab(self):
|
|
32
|
+
self.browser.find_element(By.ID, "description_tab").click()
|
|
33
|
+
|
|
34
|
+
def go_to_hint_tab(self):
|
|
35
|
+
self.browser.find_element(By.ID, "hint_tab").click()
|
|
36
|
+
|
|
37
|
+
def go_to_save_tab(self):
|
|
38
|
+
self.browser.find_element(By.ID, "save_tab").click()
|