Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Felienne/hedy into tutorials_5991
Browse files Browse the repository at this point in the history
  • Loading branch information
boryanagoncharenko committed Feb 7, 2025
2 parents 3f7b86c + ed49bfa commit 8959024
Show file tree
Hide file tree
Showing 104 changed files with 5,046 additions and 663 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-to-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# Restrict who can run this workflow
- if: github.actor != 'Felienne' && github.actor != 'jpelay'
- if: github.actor != 'Felienne' && github.actor != 'jpelay' && github.actor != 'boryanagoncharenko'
run: |
echo "You must be Felienne to run this workflow :D" >&2
exit 1
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ FROM python:3.12-slim
COPY requirements.txt /tmp/requirements.txt

RUN apt update && \
apt install build-essential -y && \
apt install -y curl && \
apt install build-essential curl -y && \
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/* && \
pip3 install --no-cache-dir -r /tmp/requirements.txt

WORKDIR /app
Expand Down
8 changes: 7 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1359,12 +1359,14 @@ def index(level, program_id):
return utils.error_page(error=404, ui_message=gettext('no_such_level'))

loaded_program = None
suppress_save_and_load = False
if program_id:
result = g_db().program_by_id(program_id)
if not result or not get_current_user_program_permissions(result):
return utils.error_page(error=404, ui_message=gettext('no_such_program'))

loaded_program = Program.from_database_row(result)
suppress_save_and_load = True

# Initially all levels are available -> strip those for which conditions
# are not met or not available yet
Expand Down Expand Up @@ -1573,6 +1575,7 @@ def index(level, program_id):
adventures=adventures,
initial_tab=initial_tab,
current_user_name=current_user()['username'],
suppress_save_and_load=suppress_save_and_load,
))


Expand All @@ -1588,12 +1591,14 @@ def tryit(level, program_id):
return utils.error_page(error=404, ui_message=gettext('no_such_level'))

loaded_program = None
suppress_save_and_load = False
if program_id:
result = g_db().program_by_id(program_id)
if not result or not get_current_user_program_permissions(result):
return utils.error_page(error=404, ui_message=gettext('no_such_program'))

loaded_program = Program.from_database_row(result)
suppress_save_and_load = True

# Initially all levels are available -> strip those for which conditions
# are not met or not available yet
Expand Down Expand Up @@ -1802,6 +1807,7 @@ def tryit(level, program_id):
adventures=adventures,
initial_tab=initial_tab,
current_user_name=current_user()['username'],
suppress_save_and_load=suppress_save_and_load,
))


Expand Down Expand Up @@ -1972,7 +1978,7 @@ def render_code_in_editor(level):
adventures=adventures,
initial_tab='start',
current_user_name=current_user()['username'],
suppress_save_and_load_for_slides=True,
suppress_save_and_load=True,
))


Expand Down
2 changes: 1 addition & 1 deletion content/adventures/ca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1968,7 +1968,7 @@ adventures:
story_text: "En aquest nivell aprendràs com demanar fàcilment comandes per a diferents plats.\n\n### Exercici 1\nAcaba el codi amb una comanda `{ask}` en els buits de manera que se li pregunti al client què vol menjar per a cada plat.\n"
example_code: "```\nplats = entrant, primer plat, postres\n{for} plat {in} plats\n {print} \"Què vol de \" plat \"?\"\n _ \n _\n```\n"
story_text_2: "### Exercici\nPer descomptat, també pots fer una comanda per a diverses persones!\nPots afegir la quantitat correcta d'indentació abans de cada línia perquè el codi funcioni correctament?\nConsell: algunes línies no necessiten cap indentació.\n"
example_code_2: "```\n_ plats = primer plat, segon plat, postre\n_ noms= Toni, Olga\n_ {for} nom {in} noms\n_ {for} plat {in} plats\n_ menjar = {ask} nom ', què t'agradaria menjar com a ' course '?'\n_ {print} nom' demana ' menjar ' com a ' plat\n```\n"
example_code_2: "```\n_ plats = primer plat, segon plat, postre\n_ noms= Toni, Olga\n_ {for} nom {in} noms\n_ {for} plat {in} plats\n_ menjar = {ask} nom \", què t'agradaria menjar com a \" plat \"?\"\n_ {print} nom \" demana \" menjar \" com a \" plat\n```\n"
8:
story_text: "En aquest nivell pots fer que el teu restaurant virtual sigui més elaborat repetint diverses línies de codi. Com això:\n\n### Exercici\nAquest codi es pot ampliar amb més elements al menú, per exemple oferint begudes i/o diversos plats o postres. Afegeix almenys un element més.\n**Extra** Afegeix encara més elements, tantes opcions com vulguis!\n"
example_code: "```\n{print} \"Benvinguts al restaurant del Chef Hedy\"\ngent = {ask} \"Quantes persones sereu a taula?\"\n{print} \"Perfecte!\"\n{repeat} gent {times}\n menjar = {ask} \"Què voldrà menjar?\"\n {print} menjar\n{print} \"Moltes gràcies per la comanda!\"\n{print} \"Bon profit!\"\n```\n"
Expand Down
Loading

0 comments on commit 8959024

Please sign in to comment.