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
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
|
|
1
3
|
from .base_game_test import BaseGameTest
|
|
2
4
|
|
|
3
5
|
|
|
@@ -5,52 +7,58 @@ class TestPlayThrough(BaseGameTest):
|
|
|
5
7
|
def setUp(self):
|
|
6
8
|
self.login_once()
|
|
7
9
|
|
|
8
|
-
def _complete_episode(
|
|
10
|
+
def _complete_episode(
|
|
11
|
+
self, episode_number, level_number, from_python_den=False, **kwargs
|
|
12
|
+
):
|
|
9
13
|
page = self.go_to_episode(episode_number)
|
|
10
|
-
self.complete_and_check_level(
|
|
14
|
+
self.complete_and_check_level(
|
|
15
|
+
level_number, page, from_python_den, **kwargs
|
|
16
|
+
)
|
|
11
17
|
|
|
12
|
-
def _complete_level(self, level_number, **kwargs):
|
|
13
|
-
page = self.go_to_level(level_number)
|
|
14
|
-
self.complete_and_check_level(
|
|
18
|
+
def _complete_level(self, level_number, from_python_den=False, **kwargs):
|
|
19
|
+
page = self.go_to_level(level_number, from_python_den)
|
|
20
|
+
self.complete_and_check_level(
|
|
21
|
+
level_number, page, from_python_den, **kwargs
|
|
22
|
+
)
|
|
15
23
|
|
|
16
24
|
def test_episode_01(self):
|
|
17
|
-
self._complete_episode(1, 1)
|
|
25
|
+
self._complete_episode(1, 1, check_algorithm_score=False)
|
|
18
26
|
|
|
19
27
|
def test_level_001(self):
|
|
20
|
-
self._complete_level(1)
|
|
28
|
+
self._complete_level(1, check_algorithm_score=False)
|
|
21
29
|
|
|
22
30
|
def test_level_002(self):
|
|
23
|
-
self._complete_level(2)
|
|
31
|
+
self._complete_level(2, check_algorithm_score=False)
|
|
24
32
|
|
|
25
33
|
def test_level_003(self):
|
|
26
|
-
self._complete_level(3)
|
|
34
|
+
self._complete_level(3, check_algorithm_score=False)
|
|
27
35
|
|
|
28
36
|
def test_level_004(self):
|
|
29
|
-
self._complete_level(4)
|
|
37
|
+
self._complete_level(4, check_algorithm_score=False)
|
|
30
38
|
|
|
31
39
|
def test_level_005(self):
|
|
32
|
-
self._complete_level(5)
|
|
40
|
+
self._complete_level(5, check_algorithm_score=False)
|
|
33
41
|
|
|
34
42
|
def test_level_006(self):
|
|
35
|
-
self._complete_level(6)
|
|
43
|
+
self._complete_level(6, check_algorithm_score=False)
|
|
36
44
|
|
|
37
45
|
def test_level_007(self):
|
|
38
|
-
self._complete_level(7)
|
|
46
|
+
self._complete_level(7, check_algorithm_score=False)
|
|
39
47
|
|
|
40
48
|
def test_level_008(self):
|
|
41
|
-
self._complete_level(8)
|
|
49
|
+
self._complete_level(8, check_algorithm_score=False)
|
|
42
50
|
|
|
43
51
|
def test_level_009(self):
|
|
44
|
-
self._complete_level(9)
|
|
52
|
+
self._complete_level(9, check_algorithm_score=False)
|
|
45
53
|
|
|
46
54
|
def test_level_010(self):
|
|
47
|
-
self._complete_level(10)
|
|
55
|
+
self._complete_level(10, check_algorithm_score=False)
|
|
48
56
|
|
|
49
57
|
def test_level_011(self):
|
|
50
|
-
self._complete_level(11)
|
|
58
|
+
self._complete_level(11, check_algorithm_score=False)
|
|
51
59
|
|
|
52
60
|
def test_level_012(self):
|
|
53
|
-
self._complete_level(12,
|
|
61
|
+
self._complete_level(12, check_algorithm_score=False)
|
|
54
62
|
|
|
55
63
|
def test_episode_02(self):
|
|
56
64
|
self._complete_episode(2, 13)
|
|
@@ -71,7 +79,7 @@ class TestPlayThrough(BaseGameTest):
|
|
|
71
79
|
self._complete_level(17)
|
|
72
80
|
|
|
73
81
|
def test_level_018(self):
|
|
74
|
-
self._complete_level(18
|
|
82
|
+
self._complete_level(18)
|
|
75
83
|
|
|
76
84
|
def test_episode_03(self):
|
|
77
85
|
self._complete_episode(3, 19)
|
|
@@ -104,7 +112,7 @@ class TestPlayThrough(BaseGameTest):
|
|
|
104
112
|
self._complete_level(27)
|
|
105
113
|
|
|
106
114
|
def test_level_028(self):
|
|
107
|
-
self._complete_level(28
|
|
115
|
+
self._complete_level(28)
|
|
108
116
|
|
|
109
117
|
def test_episode_04(self):
|
|
110
118
|
self._complete_episode(4, 29)
|
|
@@ -119,7 +127,7 @@ class TestPlayThrough(BaseGameTest):
|
|
|
119
127
|
self._complete_level(31)
|
|
120
128
|
|
|
121
129
|
def test_level_032(self):
|
|
122
|
-
self._complete_level(32
|
|
130
|
+
self._complete_level(32)
|
|
123
131
|
|
|
124
132
|
def test_episode_05(self):
|
|
125
133
|
self._complete_episode(5, 33)
|
|
@@ -143,7 +151,7 @@ class TestPlayThrough(BaseGameTest):
|
|
|
143
151
|
self._complete_level(38)
|
|
144
152
|
|
|
145
153
|
def test_level_039(self):
|
|
146
|
-
self._complete_level(39)
|
|
154
|
+
self._complete_level(39, check_route_score=False)
|
|
147
155
|
|
|
148
156
|
def test_level_040(self):
|
|
149
157
|
self._complete_level(40)
|
|
@@ -155,7 +163,7 @@ class TestPlayThrough(BaseGameTest):
|
|
|
155
163
|
self._complete_level(42)
|
|
156
164
|
|
|
157
165
|
def test_level_043(self):
|
|
158
|
-
self._complete_level(43
|
|
166
|
+
self._complete_level(43)
|
|
159
167
|
|
|
160
168
|
def test_episode_06(self):
|
|
161
169
|
self._complete_episode(6, 44)
|
|
@@ -179,7 +187,7 @@ class TestPlayThrough(BaseGameTest):
|
|
|
179
187
|
self._complete_level(49)
|
|
180
188
|
|
|
181
189
|
def test_level_050(self):
|
|
182
|
-
self._complete_level(50
|
|
190
|
+
self._complete_level(50)
|
|
183
191
|
|
|
184
192
|
def test_episode_07(self):
|
|
185
193
|
self._complete_episode(7, 51, check_algorithm_score=False)
|
|
@@ -212,7 +220,7 @@ class TestPlayThrough(BaseGameTest):
|
|
|
212
220
|
self._complete_level(59, check_route_score=False)
|
|
213
221
|
|
|
214
222
|
def test_level_060(self):
|
|
215
|
-
self._complete_level(60,
|
|
223
|
+
self._complete_level(60, check_route_score=False)
|
|
216
224
|
|
|
217
225
|
def test_episode_08(self):
|
|
218
226
|
self._complete_episode(8, 61)
|
|
@@ -236,7 +244,7 @@ class TestPlayThrough(BaseGameTest):
|
|
|
236
244
|
self._complete_level(66)
|
|
237
245
|
|
|
238
246
|
def test_level_067(self):
|
|
239
|
-
self._complete_level(67
|
|
247
|
+
self._complete_level(67)
|
|
240
248
|
|
|
241
249
|
def test_episode_09(self):
|
|
242
250
|
self._complete_episode(9, 68, check_route_score=False)
|
|
@@ -275,100 +283,230 @@ class TestPlayThrough(BaseGameTest):
|
|
|
275
283
|
self._complete_level(78, check_route_score=False)
|
|
276
284
|
|
|
277
285
|
def test_level_079(self):
|
|
278
|
-
self._complete_level(79,
|
|
279
|
-
|
|
280
|
-
def test_episode_10(self):
|
|
281
|
-
self._complete_episode(10, 80, check_algorithm_score=False)
|
|
282
|
-
|
|
283
|
-
def test_level_080(self):
|
|
284
|
-
self._complete_level(80, check_algorithm_score=False)
|
|
285
|
-
|
|
286
|
-
def test_level_081(self):
|
|
287
|
-
self._complete_level(81, check_algorithm_score=False)
|
|
288
|
-
|
|
289
|
-
def test_level_082(self):
|
|
290
|
-
self._complete_level(82, check_algorithm_score=False)
|
|
291
|
-
|
|
292
|
-
def test_level_083(self):
|
|
293
|
-
self._complete_level(83, check_algorithm_score=False)
|
|
294
|
-
|
|
295
|
-
def test_level_084(self):
|
|
296
|
-
self._complete_level(84, check_algorithm_score=False)
|
|
297
|
-
|
|
298
|
-
def test_level_085(self):
|
|
299
|
-
self._complete_level(85, check_algorithm_score=False)
|
|
300
|
-
|
|
301
|
-
def test_level_086(self):
|
|
302
|
-
self._complete_level(86, check_algorithm_score=False)
|
|
303
|
-
|
|
304
|
-
def test_level_087(self):
|
|
305
|
-
self._complete_level(87, check_algorithm_score=False)
|
|
306
|
-
|
|
307
|
-
def test_level_088(self):
|
|
308
|
-
self._complete_level(88, check_algorithm_score=False)
|
|
309
|
-
|
|
310
|
-
def test_level_089(self):
|
|
311
|
-
self._complete_level(89, check_algorithm_score=False)
|
|
286
|
+
self._complete_level(79, final_level=True)
|
|
312
287
|
|
|
313
|
-
def
|
|
314
|
-
self.
|
|
288
|
+
def test_episode_12(self):
|
|
289
|
+
self._complete_episode(
|
|
290
|
+
12, 1, check_algorithm_score=False, from_python_den=True
|
|
291
|
+
)
|
|
315
292
|
|
|
316
|
-
def
|
|
317
|
-
self._complete_level(
|
|
293
|
+
def test_python_level_001(self):
|
|
294
|
+
self._complete_level(1, from_python_den=True)
|
|
318
295
|
|
|
319
|
-
def
|
|
320
|
-
self.
|
|
296
|
+
def test_python_level_002(self):
|
|
297
|
+
self._complete_level(2, from_python_den=True)
|
|
321
298
|
|
|
322
|
-
def
|
|
323
|
-
self._complete_level(
|
|
299
|
+
def test_python_level_003(self):
|
|
300
|
+
self._complete_level(3, from_python_den=True)
|
|
324
301
|
|
|
325
|
-
def
|
|
326
|
-
self._complete_level(
|
|
302
|
+
def test_python_level_004(self):
|
|
303
|
+
self._complete_level(
|
|
304
|
+
4, check_algorithm_score=False, from_python_den=True
|
|
305
|
+
)
|
|
327
306
|
|
|
328
|
-
def
|
|
329
|
-
self._complete_level(
|
|
307
|
+
def test_python_level_005(self):
|
|
308
|
+
self._complete_level(
|
|
309
|
+
5, check_algorithm_score=False, from_python_den=True
|
|
310
|
+
)
|
|
330
311
|
|
|
331
|
-
def
|
|
332
|
-
self._complete_level(
|
|
312
|
+
def test_python_level_006(self):
|
|
313
|
+
self._complete_level(
|
|
314
|
+
6, check_algorithm_score=False, from_python_den=True
|
|
315
|
+
)
|
|
333
316
|
|
|
334
|
-
def
|
|
335
|
-
self._complete_level(
|
|
317
|
+
def test_python_level_007(self):
|
|
318
|
+
self._complete_level(7, from_python_den=True)
|
|
336
319
|
|
|
337
|
-
def
|
|
338
|
-
self._complete_level(
|
|
320
|
+
def test_python_level_008(self):
|
|
321
|
+
self._complete_level(8, from_python_den=True)
|
|
339
322
|
|
|
340
|
-
def
|
|
341
|
-
self._complete_level(
|
|
323
|
+
def test_python_level_009(self):
|
|
324
|
+
self._complete_level(9, from_python_den=True)
|
|
342
325
|
|
|
343
|
-
def
|
|
344
|
-
self._complete_level(
|
|
326
|
+
def test_python_level_010(self):
|
|
327
|
+
self._complete_level(
|
|
328
|
+
10, check_algorithm_score=False, from_python_den=True
|
|
329
|
+
)
|
|
345
330
|
|
|
346
|
-
def
|
|
347
|
-
self._complete_level(
|
|
331
|
+
def test_python_level_011(self):
|
|
332
|
+
self._complete_level(
|
|
333
|
+
11, check_algorithm_score=False, from_python_den=True
|
|
334
|
+
)
|
|
348
335
|
|
|
349
|
-
def
|
|
350
|
-
self._complete_level(
|
|
336
|
+
def test_python_level_012(self):
|
|
337
|
+
self._complete_level(
|
|
338
|
+
12, check_algorithm_score=False, from_python_den=True
|
|
339
|
+
)
|
|
351
340
|
|
|
352
|
-
def
|
|
353
|
-
self._complete_level(
|
|
341
|
+
def test_python_level_013(self):
|
|
342
|
+
self._complete_level(
|
|
343
|
+
13, check_algorithm_score=False, from_python_den=True
|
|
344
|
+
)
|
|
354
345
|
|
|
355
|
-
def
|
|
356
|
-
self.
|
|
346
|
+
def test_episode_13(self):
|
|
347
|
+
self._complete_episode(13, 14, from_python_den=True)
|
|
357
348
|
|
|
358
|
-
def
|
|
359
|
-
self._complete_level(
|
|
349
|
+
def test_python_level_014(self):
|
|
350
|
+
self._complete_level(14, from_python_den=True)
|
|
360
351
|
|
|
361
|
-
def
|
|
362
|
-
self._complete_level(
|
|
352
|
+
def test_python_level_015(self):
|
|
353
|
+
self._complete_level(15, from_python_den=True)
|
|
363
354
|
|
|
364
|
-
def
|
|
365
|
-
self._complete_level(
|
|
355
|
+
def test_python_level_016(self):
|
|
356
|
+
self._complete_level(
|
|
357
|
+
16, check_algorithm_score=False, from_python_den=True
|
|
358
|
+
)
|
|
366
359
|
|
|
367
|
-
def
|
|
368
|
-
self._complete_level(
|
|
360
|
+
def test_python_level_017(self):
|
|
361
|
+
self._complete_level(
|
|
362
|
+
17, check_algorithm_score=False, from_python_den=True
|
|
363
|
+
)
|
|
369
364
|
|
|
370
|
-
def
|
|
371
|
-
self._complete_level(
|
|
365
|
+
def test_python_level_018(self):
|
|
366
|
+
self._complete_level(
|
|
367
|
+
18, check_algorithm_score=False, from_python_den=True
|
|
368
|
+
)
|
|
369
|
+
|
|
370
|
+
def test_python_level_019(self):
|
|
371
|
+
self._complete_level(19, from_python_den=True)
|
|
372
372
|
|
|
373
|
-
def
|
|
374
|
-
self._complete_level(
|
|
373
|
+
def test_python_level_020(self):
|
|
374
|
+
self._complete_level(
|
|
375
|
+
20, check_algorithm_score=False, from_python_den=True
|
|
376
|
+
)
|
|
377
|
+
|
|
378
|
+
def test_python_level_021(self):
|
|
379
|
+
self._complete_level(
|
|
380
|
+
21, check_algorithm_score=False, from_python_den=True
|
|
381
|
+
)
|
|
382
|
+
|
|
383
|
+
def test_python_level_022(self):
|
|
384
|
+
self._complete_level(22, from_python_den=True)
|
|
385
|
+
|
|
386
|
+
def test_python_level_023(self):
|
|
387
|
+
self._complete_level(23, from_python_den=True)
|
|
388
|
+
|
|
389
|
+
def test_python_level_024(self):
|
|
390
|
+
self._complete_level(
|
|
391
|
+
24, check_algorithm_score=False, from_python_den=True
|
|
392
|
+
)
|
|
393
|
+
|
|
394
|
+
def test_python_level_025(self):
|
|
395
|
+
self._complete_level(
|
|
396
|
+
25, check_algorithm_score=False, from_python_den=True
|
|
397
|
+
)
|
|
398
|
+
|
|
399
|
+
def test_episode_14(self):
|
|
400
|
+
self._complete_episode(14, 26, from_python_den=True)
|
|
401
|
+
|
|
402
|
+
def test_python_level_026(self):
|
|
403
|
+
self._complete_level(26, from_python_den=True)
|
|
404
|
+
|
|
405
|
+
def test_python_level_027(self):
|
|
406
|
+
self._complete_level(27, from_python_den=True)
|
|
407
|
+
|
|
408
|
+
def test_python_level_028(self):
|
|
409
|
+
self._complete_level(28, from_python_den=True)
|
|
410
|
+
|
|
411
|
+
def test_python_level_029(self):
|
|
412
|
+
self._complete_level(29, from_python_den=True)
|
|
413
|
+
|
|
414
|
+
def test_python_level_030(self):
|
|
415
|
+
self._complete_level(
|
|
416
|
+
30, check_algorithm_score=False, from_python_den=True
|
|
417
|
+
)
|
|
418
|
+
|
|
419
|
+
def test_python_level_031(self):
|
|
420
|
+
self._complete_level(31, from_python_den=True)
|
|
421
|
+
|
|
422
|
+
def test_python_level_032(self):
|
|
423
|
+
self._complete_level(32, from_python_den=True)
|
|
424
|
+
|
|
425
|
+
def test_python_level_033(self):
|
|
426
|
+
self._complete_level(
|
|
427
|
+
33, check_algorithm_score=False, from_python_den=True
|
|
428
|
+
)
|
|
429
|
+
|
|
430
|
+
def test_python_level_034(self):
|
|
431
|
+
self._complete_level(
|
|
432
|
+
34, check_algorithm_score=False, from_python_den=True
|
|
433
|
+
)
|
|
434
|
+
|
|
435
|
+
def test_python_level_035(self):
|
|
436
|
+
self._complete_level(35, from_python_den=True)
|
|
437
|
+
|
|
438
|
+
def test_python_level_036(self):
|
|
439
|
+
self._complete_level(36, from_python_den=True)
|
|
440
|
+
|
|
441
|
+
def test_python_level_037(self):
|
|
442
|
+
self._complete_level(
|
|
443
|
+
37, check_algorithm_score=False, from_python_den=True
|
|
444
|
+
)
|
|
445
|
+
|
|
446
|
+
@pytest.mark.skip(reason="this level's solution is currently flawed")
|
|
447
|
+
def test_python_level_038(self):
|
|
448
|
+
self._complete_level(
|
|
449
|
+
38, check_algorithm_score=False, from_python_den=True
|
|
450
|
+
)
|
|
451
|
+
|
|
452
|
+
def test_python_level_039(self):
|
|
453
|
+
self._complete_level(
|
|
454
|
+
39, check_algorithm_score=False, from_python_den=True
|
|
455
|
+
)
|
|
456
|
+
|
|
457
|
+
def test_python_level_040(self):
|
|
458
|
+
self._complete_level(
|
|
459
|
+
40,
|
|
460
|
+
check_algorithm_score=False,
|
|
461
|
+
from_python_den=True,
|
|
462
|
+
redirects=True,
|
|
463
|
+
)
|
|
464
|
+
|
|
465
|
+
def test_episode_15(self):
|
|
466
|
+
self._complete_episode(
|
|
467
|
+
15, 41, check_algorithm_score=False, from_python_den=True
|
|
468
|
+
)
|
|
469
|
+
|
|
470
|
+
def test_python_level_041(self):
|
|
471
|
+
self._complete_level(41, from_python_den=True)
|
|
472
|
+
|
|
473
|
+
def test_python_level_042(self):
|
|
474
|
+
self._complete_level(
|
|
475
|
+
42, check_algorithm_score=False, from_python_den=True
|
|
476
|
+
)
|
|
477
|
+
|
|
478
|
+
def test_python_level_043(self):
|
|
479
|
+
self._complete_level(
|
|
480
|
+
43, check_algorithm_score=False, from_python_den=True
|
|
481
|
+
)
|
|
482
|
+
|
|
483
|
+
def test_python_level_044(self):
|
|
484
|
+
self._complete_level(44, from_python_den=True)
|
|
485
|
+
|
|
486
|
+
def test_python_level_045(self):
|
|
487
|
+
self._complete_level(
|
|
488
|
+
45, check_algorithm_score=False, from_python_den=True
|
|
489
|
+
)
|
|
490
|
+
|
|
491
|
+
def test_python_level_046(self):
|
|
492
|
+
self._complete_level(
|
|
493
|
+
46, check_algorithm_score=False, from_python_den=True
|
|
494
|
+
)
|
|
495
|
+
|
|
496
|
+
def test_python_level_047(self):
|
|
497
|
+
self._complete_level(
|
|
498
|
+
47, check_algorithm_score=False, from_python_den=True
|
|
499
|
+
)
|
|
500
|
+
|
|
501
|
+
def test_python_level_048(self):
|
|
502
|
+
self._complete_level(
|
|
503
|
+
48, check_algorithm_score=False, from_python_den=True
|
|
504
|
+
)
|
|
505
|
+
|
|
506
|
+
def test_python_level_049(self):
|
|
507
|
+
self._complete_level(
|
|
508
|
+
49,
|
|
509
|
+
check_algorithm_score=False,
|
|
510
|
+
from_python_den=True,
|
|
511
|
+
final_level=True,
|
|
512
|
+
)
|
|
@@ -1,38 +1,69 @@
|
|
|
1
|
-
from time import sleep
|
|
2
|
-
from game.end_to_end_tests.base_game_test import BaseGameTest
|
|
3
|
-
from portal.tests.pageObjects.portal.base_page import BasePage
|
|
4
|
-
|
|
5
1
|
from selenium.webdriver.common.by import By
|
|
6
2
|
from selenium.webdriver.support import expected_conditions as EC
|
|
7
3
|
from selenium.webdriver.support.ui import WebDriverWait
|
|
8
|
-
|
|
4
|
+
|
|
5
|
+
from game.character import get_character
|
|
6
|
+
from game.end_to_end_tests.base_game_test import BaseGameTest
|
|
7
|
+
from game.models import Level
|
|
8
|
+
from game.theme import get_theme
|
|
9
9
|
|
|
10
10
|
DELAY_TIME = 10
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class TestPythonLevels(BaseGameTest):
|
|
14
14
|
def test_can_see_python_commands(self):
|
|
15
|
-
self.
|
|
15
|
+
self.go_to_level(4, from_python_den=True).check_python_commands()
|
|
16
16
|
|
|
17
17
|
def test_clear_console(self):
|
|
18
|
-
self.
|
|
18
|
+
self.go_to_level(4, from_python_den=True).write_to_then_clear_console()
|
|
19
19
|
|
|
20
20
|
def test_console_parse_error(self):
|
|
21
|
-
self.
|
|
21
|
+
self.go_to_level(4, from_python_den=True).run_parse_error_program()
|
|
22
22
|
|
|
23
23
|
def test_console_attribute_error(self):
|
|
24
|
-
self.
|
|
24
|
+
self.go_to_level(4, from_python_den=True).run_attribute_error_program()
|
|
25
25
|
|
|
26
26
|
def test_console_print(self):
|
|
27
|
-
self.
|
|
27
|
+
self.go_to_level(4, from_python_den=True).run_print_program()
|
|
28
28
|
|
|
29
29
|
def test_invalid_import(self):
|
|
30
|
-
self.
|
|
30
|
+
self.go_to_level(5, from_python_den=True).run_invalid_import_program()
|
|
31
31
|
|
|
32
32
|
def test_run_code(self):
|
|
33
|
-
self.go_to_level(
|
|
34
|
-
run_code = self.selenium.
|
|
33
|
+
self.go_to_level(4, from_python_den=True)
|
|
34
|
+
run_code = self.selenium.find_element(By.ID, "run-code-button")
|
|
35
35
|
run_code.click()
|
|
36
36
|
assert WebDriverWait(self.selenium, DELAY_TIME).until(
|
|
37
37
|
EC.presence_of_all_elements_located((By.ID, "myModal-lead"))
|
|
38
38
|
)
|
|
39
|
+
|
|
40
|
+
def test_animal_sound_horn(self):
|
|
41
|
+
grass = get_theme(name="grass")
|
|
42
|
+
|
|
43
|
+
van = get_character("Van")
|
|
44
|
+
|
|
45
|
+
animal_level = Level(
|
|
46
|
+
name="Animal commands",
|
|
47
|
+
anonymous=False,
|
|
48
|
+
blockly_enabled=False,
|
|
49
|
+
character=van,
|
|
50
|
+
cows='[{"minCows":1,"maxCows":1,"potentialCoordinates":[{"x":3,"y":4}],"type":"WHITE"}]',
|
|
51
|
+
default=False,
|
|
52
|
+
destinations="[[4,4]]",
|
|
53
|
+
fuel_gauge=False,
|
|
54
|
+
max_fuel=50,
|
|
55
|
+
model_solution="",
|
|
56
|
+
origin='{"coordinate":[2,4],"direction":"E"}',
|
|
57
|
+
path='[{"coordinate":[2,4],"connectedNodes":[1]},{"coordinate":[3,4],"connectedNodes":[0,2]},{"coordinate":[4,4],"connectedNodes":[1]}]',
|
|
58
|
+
python_enabled=True,
|
|
59
|
+
theme=grass,
|
|
60
|
+
threads=1,
|
|
61
|
+
traffic_lights="[]",
|
|
62
|
+
disable_algorithm_score=True,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
user_profile = self.login_once()
|
|
66
|
+
animal_level.owner = user_profile
|
|
67
|
+
animal_level.save()
|
|
68
|
+
|
|
69
|
+
self.run_animal_sound_horn_test(animal_level).assert_success()
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import random
|
|
2
|
+
import string
|
|
3
|
+
|
|
4
|
+
from game.end_to_end_tests.base_game_test import BaseGameTest
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class TestSavingWorkspace(BaseGameTest):
|
|
8
|
+
already_logged_on = False
|
|
9
|
+
user_profile = None
|
|
10
|
+
|
|
11
|
+
def test_save_and_load_workspace(self):
|
|
12
|
+
self.login_once()
|
|
13
|
+
level = 10
|
|
14
|
+
random_save_entry_name = "".join(
|
|
15
|
+
random.choice(string.ascii_uppercase + string.digits)
|
|
16
|
+
for _ in range(10)
|
|
17
|
+
)
|
|
18
|
+
return (
|
|
19
|
+
self.go_to_level(level)
|
|
20
|
+
.save_solution(random_save_entry_name)
|
|
21
|
+
.load_solution_by_name(random_save_entry_name)
|
|
22
|
+
)
|
game/forms.py
CHANGED
|
@@ -9,17 +9,24 @@ from .models import Episode
|
|
|
9
9
|
class ScoreboardForm(forms.Form):
|
|
10
10
|
def __init__(self, *args, **kwargs):
|
|
11
11
|
classes = kwargs.pop("classes")
|
|
12
|
+
language = kwargs.pop("language")
|
|
12
13
|
super(ScoreboardForm, self).__init__(*args, **kwargs)
|
|
13
14
|
classes_choices = [(c.id, c.name) for c in classes]
|
|
14
15
|
|
|
15
16
|
self.fields["classes"] = forms.MultipleChoiceField(
|
|
16
17
|
choices=classes_choices, widget=forms.CheckboxSelectMultiple()
|
|
17
18
|
)
|
|
19
|
+
|
|
20
|
+
episodes_range = (
|
|
21
|
+
range(1, 10) if language == "blockly" else range(12, 16)
|
|
22
|
+
)
|
|
23
|
+
|
|
18
24
|
# Each tuple in choices has two elements, id and name of each level
|
|
19
25
|
# First element is the actual value set on the model
|
|
20
|
-
# Second element is the string displayed on the
|
|
26
|
+
# Second element is the string displayed on the dropdown menu
|
|
21
27
|
episodes_choices = (
|
|
22
|
-
(episode.id, episode.name)
|
|
28
|
+
(episode.id, episode.name)
|
|
29
|
+
for episode in Episode.objects.filter(pk__in=episodes_range)
|
|
23
30
|
)
|
|
24
31
|
self.fields["episodes"] = forms.MultipleChoiceField(
|
|
25
32
|
choices=itertools.chain(episodes_choices),
|