Skip to content

Commit

Permalink
fix: rename episodes and levels (#1581)
Browse files Browse the repository at this point in the history
* fix: rename episodes and levels

* feedback

* fix: remove whitespaces
  • Loading branch information
SKairinos authored Feb 15, 2024
1 parent 250a9c1 commit c9f01a7
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 28 deletions.
54 changes: 27 additions & 27 deletions game/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ def hint_level19():


def title_level20():
return "Use the <b>Repeat</b> block to make your sequence shorter and simpler"
return "Use the <b>repeat</b> block to make your sequence shorter and simpler"


def description_level20():
Expand Down Expand Up @@ -773,7 +773,7 @@ def hint_level31():


def title_level32():
return "Uh oh, it's <b>Until</b> fever!"
return "Uh oh, it's <b>until</b> fever!"


def description_level32():
Expand All @@ -790,7 +790,7 @@ def hint_level32():


def title_level33():
return "Now it's time to try the <b>If</b> block"
return "Now it's time to try the <b>if</b> block"


def description_level33():
Expand Down Expand Up @@ -819,7 +819,7 @@ def hint_level33():


def title_level34():
return "Multiple <b>If</b>s"
return "Multiple <b>if</b>s"


def description_level34():
Expand Down Expand Up @@ -868,7 +868,7 @@ def hint_level35():


def title_level36():
return "What else? If-else if-else, that's what!"
return "What else? <b>If-else</b>, that's what!"


def description_level36():
Expand Down Expand Up @@ -1226,7 +1226,7 @@ def hint_level51():


def title_level52():
return "A Bit more Tricky"
return "A bit more tricky"


def description_level52():
Expand Down Expand Up @@ -1265,7 +1265,7 @@ def hint_level53():


def title_level54():
return "Round and Round"
return "Round and round"


def description_level54():
Expand All @@ -1284,7 +1284,7 @@ def hint_level54():


def title_level55():
return "Wonky Fish!"
return "Wonky fish!"


def description_level55():
Expand All @@ -1300,7 +1300,7 @@ def hint_level55():


def title_level56():
return "Concrete Wasteland"
return "Concrete wasteland"


def description_level56():
Expand All @@ -1319,7 +1319,7 @@ def hint_level56():


def title_level57():
return "This is <b>not...</b> the same"
return "This is <b>not</b>... the same"


def description_level57():
Expand Down Expand Up @@ -1418,7 +1418,7 @@ def hint_level61():


def title_level62():
return "Lots of Traffic Lights!"
return "Lots of traffic lights!"


def description_level62():
Expand All @@ -1435,7 +1435,7 @@ def hint_level62():


def title_level63():
return "Wiggle Wiggle"
return "Wiggle wiggle"


def description_level63():
Expand All @@ -1456,7 +1456,7 @@ def hint_level63():


def title_level64():
return "Muddy Patterns with Phil"
return "Muddy patterns with Phil"


def description_level64():
Expand Down Expand Up @@ -1513,7 +1513,7 @@ def hint_level66():


def title_level67():
return "Crazy Farm"
return "Crazy farm"


def description_level67():
Expand Down Expand Up @@ -1596,7 +1596,7 @@ def hint_level71():


def title_level72():
return "Can Wes Find his lunch?"
return "Can Wes find his lunch?"


def description_level72():
Expand Down Expand Up @@ -1676,7 +1676,7 @@ def hint_level76():


def title_level77():
return "G Force"
return "G force"


def description_level77():
Expand Down Expand Up @@ -1710,7 +1710,7 @@ def hint_level78():


def title_level79():
return "Muddy Mayhem"
return "Muddy mayhem"


def description_level79():
Expand Down Expand Up @@ -1815,7 +1815,7 @@ def hint_level83():


def title_level84():
return "Repeat and watch"
return "<b>Repeat</b> and watch"


def description_level84():
Expand All @@ -1832,7 +1832,7 @@ def hint_level84():


def title_level85():
return "Looks easy but use repeat until and see what happens?"
return "Looks easy but use <b>repeat until</b> and see what happens?"


def description_level85():
Expand All @@ -1850,7 +1850,7 @@ def hint_level85():


def title_level86():
return "See what the if blocks looks like in Python"
return "See what the <b>if</b> blocks looks like in Python"


def description_level86():
Expand All @@ -1866,7 +1866,7 @@ def hint_level86():


def title_level87():
return "Don't forget to use else if"
return "Don't forget to use <b>else if</b>"


def description_level87():
Expand All @@ -1883,7 +1883,7 @@ def hint_level87():


def title_level88():
return "See what happens when you add Traffic lights"
return "See what happens when you add traffic lights"


def description_level88():
Expand Down Expand Up @@ -2172,7 +2172,7 @@ def hint_level100():


def title_level101():
return "Function or Junction?"
return "Function or junction?"


def description_level101():
Expand Down Expand Up @@ -2459,7 +2459,7 @@ def hint_level109():
description_level116,
hint_level116,
) = (
lambda: "In a while, crocodile!",
lambda: "In a <b>while</b>, crocodile!",
lambda: build_description(
title_level116(),
"This level may look easy, but this time you need to use a While Loop to deliver to the house."
Expand All @@ -2474,7 +2474,7 @@ def hint_level109():
description_level117,
hint_level117,
) = (
lambda: "Wiggle while you work",
lambda: "Wiggle <b>while</b> you work",
lambda: build_description(
title_level117(),
"This time it's a little harder. We've added the directions back in."
Expand Down Expand Up @@ -2886,8 +2886,8 @@ def get_episode_title(episode_id):
9: "Blockly Brain Teasers",
10: "Introduction to Python",
11: "Python",
12: "Sequencing and Counted Loops",
13: "Indeterminate WHILE Loops - coming soon",
12: "Counted Loops Using While",
13: "Indeterminate While Loops - coming soon",
14: "Selection in a Loop - coming soon",
15: "For Loops - coming soon",
}
Expand Down
35 changes: 35 additions & 0 deletions game/migrations/0088_rename_episodes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from django.apps.registry import Apps
from django.db import migrations


def rename_episodes(apps: Apps, *args):
Episode = apps.get_model("game", "Episode")

def update_episode_name(pk: int, name: str):
episode = Episode.objects.get(pk=pk)
episode.name = name
episode.save()

update_episode_name(pk=12, name="Counted Loops Using While")
update_episode_name(pk=13, name="Indeterminate While Loops - coming soon")


def undo_rename_episodes(apps: Apps, *args):
Episode = apps.get_model("game", "Episode")

def update_episode_name(pk: int, name: str):
episode = Episode.objects.get(pk=pk)
episode.name = name
episode.save()

update_episode_name(pk=12, name="Sequencing and Counted Loops")
update_episode_name(pk=13, name="Indeterminate WHILE Loops - coming soon")

class Migration(migrations.Migration):
dependencies = [("game", "0087_workspace_python_view_enabled")]
operations = [
migrations.RunPython(
rename_episodes,
reverse_code=undo_rename_episodes,
)
]
2 changes: 1 addition & 1 deletion game/templates/game/level_selection.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ <h4>Blockly levels</h4>
{% if episode.random_levels_enabled %}
<p>
<a href="{% url 'random_level_for_episode' episode.id %}">
Random: Try your hand at a random level.
Random: Try your hand at a random level
</a>
</p>
{% endif %}
Expand Down

0 comments on commit c9f01a7

Please sign in to comment.