Skip to content

Commit

Permalink
Merge branch 'master' into 1662-remove-direct-drive-arrows
Browse files Browse the repository at this point in the history
  • Loading branch information
razvan-pro authored Oct 22, 2024
2 parents f5e4859 + f802605 commit 2fc4aeb
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 81 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

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

## 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
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.6.0"
__version__ = "6.6.2"
18 changes: 0 additions & 18 deletions game/static/game/js/level_selection.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@
/* global showPopupConfirmation */

$(function() {
setupCoins();
});

function goToPythonDen() {
window.location.href = window.location.href.replace("rapidrouter", "pythonden");
}

function movedToPythonDenPopup() {
let title = "Python Den";
let text = `
<div class='popup-text'>
<p>We have migrated all Python levels to the new Python Den.</p>
<p>Click "Confirm" to continue your journey!</p>
</div>`;
let confirmHandler = "goToPythonDen()";

showPopupConfirmation(title, text, confirmHandler);
}

function setupCoins() {
for(var i = 0; i < EPISODES.length; i++) {
var episode = EPISODES[i];
Expand Down
1 change: 1 addition & 0 deletions game/templates/game/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
var PATH = {{request.path}}
</script>

<script type='text/javascript' src="{% static 'django_reverse_js/js/reverse.js' %}"></script>
<script type='text/javascript' src="{% static 'game/js/foundation/vendor/js.cookie.min.js' %}"></script>
<script type='text/javascript' src="{% url 'rapid-router/javascript-catalog' %}"></script>
<script type='text/javascript' src="{% static 'game/js/jquery.touchy.min.js' %}"></script>
Expand Down
2 changes: 1 addition & 1 deletion game/templates/game/level_moderation.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ <h4>Level moderation</h5>
<td><small>{{level.name}}</small></td>
<td><small>{{level.shared_with}}</small></td>
<td class="text-center">
<button class="button button--small button--primary play" value={{level.id}}>Play</button>
<a class="button button--small button--primary play" href="{% url 'play_custom_level' level.id %}">Play</a>
</td>
<td class="text-center">
<button class="button button--small button--primary--danger button--icon delete" value={{level.id}}>
Expand Down
50 changes: 2 additions & 48 deletions game/templates/game/level_selection.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@

{% block content %}
<div class="container background">
{% include "portal/partials/popup.html" %}
<div id="episodes">
<div class="panel-intro">
<h4>Blockly levels</h4>
The first set of levels use Blockly to slowly introduce you to Python. You can read more about Blockly
The first set of levels use Blockly to slowly introduce you to
core programming concepts. You can read more about Blockly
<a href="https://code-for-life.gitbook.io/rapid-router/blockly-guide" target="_blank">here</a>.
</div>
{% for episode in blocklyEpisodes %}
Expand Down Expand Up @@ -123,52 +123,6 @@ <h4>Blockly levels</h4>
</div>
{% endfor %}

<div class="panel-intro">
<h4>Python levels</h4>
The next set of levels introduce you to coding directly with Python. You can read more about Python
<a href="https://code-for-life.gitbook.io/rapid-router/python-guide" target="_blank">here</a>.
</div>
{% for episode in oldPythonEpisodes %}
<div class="panel">
<div class="panel-header bg--{{ episode.difficulty }}" id="episode-{{episode.id}}">
<p class="episode-title" data-toggle="collapse" data-target="#collapse-{{episode.id}}" aria-expanded="false" aria-controls="collapse-{{episode.id}}" data-parent="#episodes">
{{episode.name}}
<span class="episode_range_text collapsed" data-toggle="collapse" data-target="#collapse-{{episode.id}}" aria-expanded="false" aria-controls="collapse-{{episode.id}}" data-parent="#episodes">
Levels {{episode.first_level}}-{{episode.last_level}}
</span>
<img class="episode_image coin_image" value="{{episode.id}}">
</p>
</div>

<div id="collapse-{{episode.id}}" aria-labelledby="episode-{{episode.id}}" class="collapse">
<div class="panel-body">
{% for level in episode.levels %}
{% if user|is_logged_in_as_student and user.new_student.class_field in level.locked_for_class.all %}
<!-- Mark level as locked -->
<p>
<a class="disabled">{{level.name}}:
{{level.title.strip | safe}}</a>
{% if level.score != None %}
<span class="score_text disabled">{{level.score|floatformat}}/{{level.maxScore|floatformat}}</span>
<img class="level_image coin_image" value="{{level.name}}">
{% endif %}
</p>
{% else %}
<!-- Marking titles as safe to enable bold, not to be used for user-created levels -->
<p>
<a onclick="movedToPythonDenPopup()">{{level.name}}: {{level.title.strip | safe}}</a>
{% if level.score != None %}
<span class="score_text">{{level.score|floatformat}}/{{level.maxScore|floatformat}}</span>
<img class="level_image coin_image" value="{{level.name}}">
{% endif %}
</p>
{% endif %}
{% endfor %}
</div>
</div>
</div>
{% endfor %}

{% if user|is_logged_in %}
<div class="panel-intro">
<h4>Created levels</h4>
Expand Down
13 changes: 0 additions & 13 deletions game/views/level_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,19 +233,6 @@ def levels(request, language):

context["blocklyEpisodes"] = blockly_episodes

old_python_episodes = fetch_episode_data(
app_settings.EARLY_ACCESS_FUNCTION(request), 10, 11
)

for episode in old_python_episodes:
for level in episode["levels"]:
attach_attempts_to_level(attempts, level)
level["locked_for_class"] = Level.objects.get(
id=level["id"]
).locked_for_class

context["oldPythonEpisodes"] = old_python_episodes

elif language == "python":
python_episodes = get_python_episodes(request)

Expand Down

0 comments on commit 2fc4aeb

Please sign in to comment.