Skip to content

Commit

Permalink
feat: Create levels 110-122 (#1509)
Browse files Browse the repository at this point in the history
* Improve RR admin models

* Add decor coordinates to list

* Update migration to include paths, destinations, origins, level types, blocks and decors

* Add level solutions, tests and counting of new blocks towards solution score

* Remove logs

* Merge branch 'master' into while_loop_levels

* Bulk actions

* Merge remote-tracking branch 'origin/while_loop_levels' into while_loop_levels

* Remove unnecessary code
  • Loading branch information
faucomte97 authored Nov 1, 2023
1 parent 7246232 commit 8b8d572
Show file tree
Hide file tree
Showing 9 changed files with 409 additions and 93 deletions.
57 changes: 29 additions & 28 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions game/admin.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from django.contrib import admin

from game.models import Level, Block, Episode, Workspace
from game.models import Level, Block, Episode, Workspace, LevelDecor


class LevelAdmin(admin.ModelAdmin):
search_fields = ["name"]
search_fields = ["name", "id", "owner__user__username", "owner__user__first_name"]
raw_id_fields = ["next_level", "locked_for_class"]
readonly_fields = ["owner"]
list_display = ["name", "id", "episode", "owner"]
Expand All @@ -14,7 +14,13 @@ class WorkspaceAdmin(admin.ModelAdmin):
raw_id_fields = ["owner"]


class LevelDecorAdmin(admin.ModelAdmin):
search_fields = ["level__name"]
list_display = ["id", "level", "x", "y", "decorName"]


admin.site.register(Level, LevelAdmin)
admin.site.register(Workspace, WorkspaceAdmin)
admin.site.register(Episode)
admin.site.register(Block)
admin.site.register(LevelDecor, LevelDecorAdmin)
45 changes: 44 additions & 1 deletion game/end_to_end_tests/test_play_through.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,4 +378,47 @@ def test_level_108(self):
self._complete_level(108, check_algorithm_score=False)

def test_level_109(self):
self._complete_level(109, check_algorithm_score=False, final_level=True)
self._complete_level(109, check_algorithm_score=False)

def test_episode_12(self):
self._complete_episode(12, 110, check_algorithm_score=False)

def test_level_110(self):
self._complete_level(110, check_algorithm_score=False)

def test_level_111(self):
self._complete_level(111, check_algorithm_score=False)

def test_level_112(self):
self._complete_level(112)

def test_level_113(self):
self._complete_level(113, check_algorithm_score=False)

def test_level_114(self):
self._complete_level(114, check_algorithm_score=False)

def test_level_115(self):
self._complete_level(115, check_algorithm_score=False)

def test_level_116(self):
self._complete_level(116)

def test_level_117(self):
self._complete_level(117)

def test_level_118(self):
self._complete_level(118)

def test_level_119(self):
self._complete_level(119, check_algorithm_score=False)

def test_level_120(self):
self._complete_level(120, check_algorithm_score=False)

def test_level_121(self):
self._complete_level(121, check_algorithm_score=False)

def test_level_122(self):
self._complete_level(122, check_algorithm_score=False, final_level=True)

2 changes: 1 addition & 1 deletion game/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -2422,7 +2422,7 @@ def hint_level109():
title_level114(),
"This route is just a bit longer. Make sure you type the Python code accurately!",
),
lambda: "The most common errors here are missing the round brackets at the end of the commands or mis-typing the commands, e.g. use my_van.move_fowards() and not my_van.move_foward()",
lambda: "The most common errors here are missing the round brackets at the end of the commands or mistyping the commands, e.g. use my_van.move_fowards() and not my_van.move_foward()",
)

(
Expand Down
Loading

0 comments on commit 8b8d572

Please sign in to comment.