Skip to content

Commit

Permalink
Merge branch 'ocadotechnology:master' into Allow-for-cows-to-be-place…
Browse files Browse the repository at this point in the history
…d-on-a-non-road-square
  • Loading branch information
RaihanRasheedApurbo authored Oct 28, 2024
2 parents 5459985 + 3677c63 commit d8ff18f
Show file tree
Hide file tree
Showing 29 changed files with 521 additions and 304 deletions.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@ If applicable, add screenshots to help explain your problem.
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Good Places to Start**

_Link to a specific directory / file / line that would be a good place to
start working on this task. The more specific the better._

**Additional context**
Add any other context about the problem here.
7 changes: 5 additions & 2 deletions .github/ISSUE_TEMPLATE/new_task.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ about: A template for a new task

## Task Description



## Acceptance Criteria
- [ ] ...
- [ ] ...

## Good Places to Start

_Link to a specific directory / file / line that would be a good place to
start working on this task. The more specific the better._

### Analytics Requirements
- [ ] ...

Expand Down
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,46 @@

<!--next-version-placeholder-->

## v6.7.0 (2024-10-22)

### Feature

* Remove direct drive arrows ([#1743](https://github.com/ocadotechnology/rapid-router/issues/1743)) ([`203cf5a`](https://github.com/ocadotechnology/rapid-router/commit/203cf5a8cd0e4135d38e5ea58a4701c6dc48aa1c))

## v6.6.2 (2024-10-18)

### Fix

* Remove old Python levels redirect ([#1745](https://github.com/ocadotechnology/rapid-router/issues/1745)) ([`6cd8cd0`](https://github.com/ocadotechnology/rapid-router/commit/6cd8cd0aded4dbba4bfb459f6418b4087998ebd1))

## v6.6.1 (2024-10-17)

### Fix

* Link ([#1744](https://github.com/ocadotechnology/rapid-router/issues/1744)) ([`3475f19`](https://github.com/ocadotechnology/rapid-router/commit/3475f19b4256588485b6ef423ea0f75912fe3f7e))

## v6.6.0 (2024-10-03)

### Feature

* Rapid router 1732 ([#1737](https://github.com/ocadotechnology/rapid-router/issues/1737)) ([`8ac9fae`](https://github.com/ocadotechnology/rapid-router/commit/8ac9faeae2b4895407d3c3043f1d5ccf059011e4))

## v6.5.4 (2024-10-02)

### Fix

* Update Python Den level 15 model solution ([#1736](https://github.com/ocadotechnology/rapid-router/issues/1736)) ([`59fa7c1`](https://github.com/ocadotechnology/rapid-router/commit/59fa7c1de1a8d097301ff301336ef4349e982bde))

## v6.5.3 (2024-09-27)

### Fix

* Migrations ([#1735](https://github.com/ocadotechnology/rapid-router/issues/1735)) ([`559525a`](https://github.com/ocadotechnology/rapid-router/commit/559525a10f942ba5df9fae352bf2c8dd29496b0a))

### Documentation

* Add section to issue templates for code guidance ([#1734](https://github.com/ocadotechnology/rapid-router/issues/1734)) ([`bb7e7a2`](https://github.com/ocadotechnology/rapid-router/commit/bb7e7a2c9ca51eb599b31a9de4771f4525783655))

## v6.5.2 (2024-09-16)

### Fix
Expand Down
2 changes: 1 addition & 1 deletion game/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "6.5.2"
__version__ = "6.7.0"
1 change: 0 additions & 1 deletion game/end_to_end_tests/test_cow_crashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def setUpClass(cls):
cows='[{"minCows":"7","maxCows":"7","potentialCoordinates":[{"x":4,"y":4},{"x":2,"y":4},{"x":3,"y":7},{"x":4,"y":6},{"x":2,"y":6},{"x":3,"y":1},{"x":4,"y":2}],"type":"WHITE"}]',
default=False,
destinations="[[4,5]]",
direct_drive=True,
fuel_gauge=False,
max_fuel=50,
model_solution="[1]",
Expand Down
1 change: 0 additions & 1 deletion game/end_to_end_tests/test_python_levels.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def test_animal_sound_horn(self):
cows='[{"minCows":1,"maxCows":1,"potentialCoordinates":[{"x":3,"y":4}],"type":"WHITE"}]',
default=False,
destinations="[[4,4]]",
direct_drive=False,
fuel_gauge=False,
max_fuel=50,
model_solution="",
Expand Down
6 changes: 3 additions & 3 deletions game/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def youtube_link(url, border):

def play_button_icon_url():
return (
'<img src="/static/game/image/actions/go.svg" alt="Play button" '
'style="width: 4%;">'
'<img src="/static/game/image/icons/play.svg" alt="Play icon">'
'<b>Play</b>'
)


Expand Down Expand Up @@ -355,7 +355,7 @@ def description_level13():
f"Often there is more than one way to get to the house. The route that needs "
f"the fewest directions is usually best. <br> Help the van find the "
f"shortest route to the house. <br> You can press the {play_button_icon_url()} "
f"or <b>Play</b> buttons to start the van."
f"button to start the van."
)
return build_description(title_level13(), message)

Expand Down
3 changes: 3 additions & 0 deletions game/migrations/0001_squashed_0025_levels_ordering_pt1.py
Original file line number Diff line number Diff line change
Expand Up @@ -2874,6 +2874,7 @@ def create_level71():
level59.save()

episode9 = Episode(
pk=9,
name="Blockly Brain Teasers",
first_level=level68,
r_branchiness=0.5,
Expand Down Expand Up @@ -3555,6 +3556,7 @@ def add_levels_80_to_107(apps, schema_editor):
count += 1

blocklyAndPythonEpisode = Episode(
pk=10,
name="Introduction to Python",
first_level=level80,
r_branchiness=0.5,
Expand All @@ -3569,6 +3571,7 @@ def add_levels_80_to_107(apps, schema_editor):
blocklyAndPythonEpisode.save()

pythonOnlyEpisode = Episode(
pk=11,
name="Python",
first_level=level100,
r_branchiness=0.5,
Expand Down
13 changes: 10 additions & 3 deletions game/migrations/0100_reorder_python_levels.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django.apps.registry import Apps
from django.db import migrations
from django.db.models import F
from django.db.models import F, IntegerField, CharField
from django.db.models.functions import Cast


def adjust_python_den_episodes(apps: Apps, *args):
Expand Down Expand Up @@ -69,15 +70,21 @@ def rename_episode_12_levels(apps: Apps, *args):
Level = apps.get_model("game", "Level")

Level.objects.filter(default=True, name__in=range(110, 123)).update(
name=F("name") + 891
name=Cast(
Cast(F("name"), output_field=IntegerField()) + 891,
output_field=CharField()
)
)


def undo_rename_episode_12_levels(apps: Apps, *args):
Level = apps.get_model("game", "Level")

Level.objects.filter(default=True, name__in=range(1001, 1014)).update(
name=F("name") - 891
name=Cast(
Cast(F("name"), output_field=IntegerField()) - 891,
output_field=CharField()
)
)


Expand Down
26 changes: 26 additions & 0 deletions game/migrations/0103_level_1015_solution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from django.apps.registry import Apps
from django.db import migrations


def update_level_model_solution(apps: Apps, *args):
Level = apps.get_model("game", "Level")
level43 = Level.objects.get(name="1015", default=True)
level43.model_solution = "[11,12]"
level43.save()


def revert_level_model_solution(apps: Apps, *args):
Level = apps.get_model("game", "Level")
level43 = Level.objects.get(name="1015", default=True)
level43.model_solution = "[11]"
level43.save()


class Migration(migrations.Migration):
dependencies = [("game", "0102_reoder_episodes_13_14")]
operations = [
migrations.RunPython(
update_level_model_solution,
reverse_code=revert_level_model_solution,
)
]
17 changes: 17 additions & 0 deletions game/migrations/0104_remove_level_direct_drive.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 3.2.25 on 2024-10-15 07:54

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('game', '0103_level_1015_solution'),
]

operations = [
migrations.RemoveField(
model_name='level',
name='direct_drive',
),
]
1 change: 0 additions & 1 deletion game/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ class Level(models.Model):
)
fuel_gauge = models.BooleanField(default=True)
max_fuel = models.IntegerField(default=50)
direct_drive = models.BooleanField(default=False)
next_level = models.ForeignKey(
"self",
null=True,
Expand Down
46 changes: 6 additions & 40 deletions game/static/game/css/game.css
Original file line number Diff line number Diff line change
Expand Up @@ -321,21 +321,11 @@ div > .navigation_button_kurono {
cursor: col-resize;
}

/******************/
/** Direct drive **/
/******************/

#direct_drive {
width: 200px;
height: 95px;
position: absolute;
z-index: 7;
left: 50%;
bottom: 20px;
margin-left: 35px;
}
/**************/
/** Zoom pan **/
/**************/

.direct_drive_button {
.zoom_pan_button {
display: inline;
cursor: pointer;
background-repeat: no-repeat;
Expand All @@ -349,39 +339,15 @@ div > .navigation_button_kurono {
transition: background-size 0.3s;
}

.direct_drive_button:hover,
.direct_drive_button:focus
.zoom_pan_button:hover,
.zoom_pan_button:focus
{
background-color: rgba(240,240,240,0.3);
background-size: 50px 50px;
background-color: transparent;
outline: none;
}

#go {
left: 60px;
bottom: 0px;
background-image : url('/static/game/image/actions/go.svg');
}

#turnLeft {
left: 10px;
bottom: 0px;
background-image : url('/static/game/image/actions/left.svg');
}

#turnRight {
left: 110px;
bottom: 0px;
background-image : url('/static/game/image/actions/right.svg');
}

#moveForward {
left: 60px;
bottom: 50px;
background-image : url('/static/game/image/actions/forward.svg');
}

.blocklyWidgetDiv {
line-height: 1;
}
Expand Down
18 changes: 0 additions & 18 deletions game/static/game/image/actions/go.svg

This file was deleted.

53 changes: 52 additions & 1 deletion game/static/game/js/blockly/msg/js/bg.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,4 +433,55 @@ Blockly.Msg["VARIABLES_HUE"] = "330";
Blockly.Msg["TEXTS_HUE"] = "160";
Blockly.Msg["PROCEDURES_HUE"] = "290";
Blockly.Msg["COLOUR_HUE"] = "20";
Blockly.Msg["VARIABLES_DYNAMIC_HUE"] = "310";
Blockly.Msg["VARIABLES_DYNAMIC_HUE"] = "310";

Blockly.Msg["START_TITLE"] = "Начало";
Blockly.Msg["START_TOOLTIP"] = "Началото на програмата"
Blockly.Msg["MOVE_FORWARDS_TITLE"] = "Премести напред";
Blockly.Msg["MOVE_FORWARDS_TOOLTIP"] = "премества камиона напред";
Blockly.Msg["TURN_LEFT_TITLE"] = "Завий наляво";
Blockly.Msg["TURN_LEFT_TOOLTIP"] = "камионът прави ляв завой";
Blockly.Msg["TURN_RIGHT_TITLE"] = "Завий надясно";
Blockly.Msg["TURN_RIGHT_TOOLTIP"] = "камионът прави десен завой";
Blockly.Msg["TURN_AROUND_TITLE"] = "Завърти се наобратно";
Blockly.Msg["TURN_AROUND_TOOLTIP"] = "камионът ще се движи в противоположна посока";

Blockly.Msg["WAIT_TITLE"] = "Изчакай";
Blockly.Msg["WAIT_TOOLTIP"] = "камионът стои неподвижно";
Blockly.Msg["DELIVER_TITLE"] = "Достави";
Blockly.Msg["DELIVER_TOOLTIP"] = "доставя стоките от камиона";
Blockly.Msg["SOUND_HORN_TITLE"] = "Свирни";
Blockly.Msg["SOUND_HORN_TOOLTIP"] = "включва клаксон за да плаши кравите";

Blockly.Msg["ROAD_EXISTS_FORWARD_TITLE"] = "Има път направо";
Blockly.Msg["ROAD_EXISTS_LEFT_TITLE"] = "Има път наляво";
Blockly.Msg["ROAD_EXISTS_RIGHT_TITLE"] = "Има път надясно";
Blockly.Msg["TRAFFIC_LIGHT_RED_TITLE"] = "Червен светофар";
Blockly.Msg["TRAFFIC_LIGHT_GREEN_TITLE"] = "зелен светофар";
Blockly.Msg["DEAD_END_TITLE"] = "Път без изход";
Blockly.Msg["AT_DESTINATION_TITLE"] = "На адреса";
Blockly.Msg["COW_CROSSING_TITLE"] = "Крави";
Blockly.Msg["PIGEON_CROSSING_TITLE"] = "гълъби";

Blockly.Msg["CALL_PROC_TITLE"] = "Изпълни";
Blockly.Msg["CALL_PROC_TOOLTIP"] = "изпълнява процедура";
Blockly.Msg["DECLARE_PROC_TITLE"] = "Дефинирай";
Blockly.Msg["DECLARE_PROC_SUBTITLE"] = "прави";
Blockly.Msg["DECLARE_PROC_TOOLTIP"] = "декларира процедура";
Blockly.Msg["CONTROLS_REPEAT_WHILE_TITLE"] = "Повтори докато";
Blockly.Msg["CONTROLS_REPEAT_WHILE_SUBTITLE"] = "прави";
Blockly.Msg["CONTROLS_REPEAT_WHILE_TOOLTIP"] = "докато стойността е вярна, изпълнявай действията";
Blockly.Msg["CONTROLS_REPEAT_UNTIL_TITLE"] = "Повтори докато не";
Blockly.Msg["CONTROLS_REPEAT_UNTIL_SUBTITLE"] = "прави";
Blockly.Msg["CONTROLS_REPEAT_UNTIL_TOOLTIP"] = "изпълнявай действията, докато стойността не е вярна";

Blockly.Msg["VARIABLES_GET_TOOLTIP"] = "променлива";
Blockly.Msg["VARIABLES_SET_TITLE"] = "Задай на";
Blockly.Msg["VARIABLES_SET_SUBTITLE"] = "стойност";
Blockly.Msg["VARIABLES_SET_TOOLTIP"] = "задаване на стойност на променлива";
Blockly.Msg["VARIABLES_NUMERIC_SET_TOOLTIP"] = "задаване на числена стойност на променлива";
Blockly.Msg["VARIABLES_INCREMENT_TITLE"] = "Увеличи";
Blockly.Msg["VARIABLES_INCREMENT_SUBTITLE"] = "с";
Blockly.Msg["VARIABLES_INCREMENT_TOOLTIP"] = "увеличаване на променлива";
Blockly.Msg["NUMBER_TITLE"] = "Число";
Blockly.Msg["NUMBER_TOOLTIP"] = "число";
Loading

0 comments on commit d8ff18f

Please sign in to comment.