Skip to content

Commit

Permalink
💻 Delete tutorials (#6151)
Browse files Browse the repository at this point in the history
This PR removes tutorials including the content and the reference from the teacher's manual.

Fixes #5991

**How to test**
- All pages should load without an error especially the /hedy and /tryit pages
- The teacher's manual should not have a reference to the tutorial
- The localhost:8080/tutorial#default should not trigger the tutorial but return a 404
  • Loading branch information
boryanagoncharenko authored Feb 7, 2025
1 parent 3d90ae1 commit 15b2ee5
Show file tree
Hide file tree
Showing 183 changed files with 1,321 additions and 4,775 deletions.
118 changes: 1 addition & 117 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
translating, tags, surveys, super_teacher, public_adventures, user_activity, feedback)
from website.auth import (current_user, is_admin, is_teacher, is_second_teacher, is_super_teacher, is_students_teacher,
has_public_profile, login_user_from_token_cookie, requires_login, requires_login_redirect,
requires_teacher, forget_current_user, hide_explore)
forget_current_user, hide_explore)
from website.log_fetcher import log_fetcher
from website.frontend_types import Adventure, Program, ExtraStory, SaveInfo
from website.flask_hedy import g_db
Expand Down Expand Up @@ -93,10 +93,6 @@
for lang in ALL_LANGUAGES.keys():
QUIZZES[lang] = hedy_content.Quizzes(lang)

TUTORIALS = collections.defaultdict(hedy_content.NoSuchTutorial)
for lang in ALL_LANGUAGES.keys():
TUTORIALS[lang] = hedy_content.Tutorials(lang)

SLIDES = collections.defaultdict(hedy_content.NoSuchSlides)
for lang in ALL_LANGUAGES.keys():
SLIDES[lang] = hedy_content.Slides(lang)
Expand Down Expand Up @@ -785,21 +781,6 @@ def parse_by_id(user):
return make_response(gettext("request_invalid"), 400)


@app.route('/parse_tutorial', methods=['POST'])
@requires_login
def parse_tutorial(user):
body = request.json

code = body['code']
level = try_parse_int(body['level'])
try:
result = hedy.transpile(code, level, "en")
# this is not a return, is this code needed?
make_response(({'code': result.code}), 200)
except BaseException:
return make_response(gettext("request_invalid"), 400)


@app.route("/generate_machine_files", methods=['POST'])
def prepare_files():
body = request.json
Expand Down Expand Up @@ -1190,78 +1171,6 @@ def get_log_results():
return make_response(response, 200)


@app.route('/tutorial', methods=['GET'])
def tutorial_index():
if not current_user()['username']:
return redirect('/login')
level = 1
cheatsheet = COMMANDS[g.lang].get_commands_for_level(level, g.keyword_lang)
commands = hedy.commands_per_level.get(level)
adventures = load_adventures_for_level(level)
parsons = len(PARSONS[g.lang].get_parsons_data_for_level(level))
initial_tab = adventures[0].short_name
initial_adventure = adventures[0]

max_level = hedy.HEDY_MAX_LEVEL # do we need to fetch the max level per language?

return render_template(
"code-page.html",
intro_tutorial=True,
next_level=2,
level_nr=str(level),
level=str(level),
adventures=adventures,
initial_tab=initial_tab,
commands=commands,
quiz=True,
max_level=max_level,
parsons=True if parsons else False,
parsons_exercises=parsons,
initial_adventure=initial_adventure,
cheatsheet=cheatsheet,
blur_button_available=False,
current_user_is_in_class=len(current_user().get('classes') or []) > 0,
# See initialize.ts
javascript_page_options=dict(
page='code',
level=level,
lang=g.lang,
adventures=adventures,
initial_tab=initial_tab,
current_user_name=current_user()['username'],
start_tutorial=True,
))


@app.route('/teacher-tutorial', methods=['GET'])
@requires_teacher
def teacher_tutorial(user):
teacher_classes = g_db().get_teacher_classes(user['username'], True)
adventures = []
for adventure in g_db().get_teacher_adventures(user['username']):
adventures.append(
{'id': adventure.get('id'),
'name': adventure.get('name'),
'date': utils.localized_date_format(adventure.get('date')),
'level': adventure.get('level')
}
)

return render_template('for-teachers.html', current_page='my-profile',
page_title=gettext('title_for-teacher'),
teacher_classes=teacher_classes,
teacher_adventures=adventures,
tutorial=True,
content=hedyweb.PageTranslations('for-teachers').get_page_translations(g.lang),
javascript_page_options=dict(
page='for-teachers',
tutorial=True,
))


# routing to index.html


@app.route('/hour-of-code/<int:level>', methods=['GET'])
@app.route('/hour-of-code', methods=['GET'], defaults={'level': 1})
def hour_of_code(level, program_id=None):
Expand Down Expand Up @@ -1380,7 +1289,6 @@ def hour_of_code(level, program_id=None):
hide_cheatsheet = True

quiz = True if QUIZZES[g.lang].get_quiz_data_for_level(level) else False
tutorial = True if TUTORIALS[g.lang].get_tutorial_for_level(level) else False

quiz_questions = 0

Expand Down Expand Up @@ -1414,7 +1322,6 @@ def hour_of_code(level, program_id=None):
commands=commands,
# parsons=parsons,
# parsons_exercises=parson_exercises,
tutorial=tutorial,
latest=version(),
quiz=quiz,
quiz_questions=quiz_questions,
Expand Down Expand Up @@ -1594,7 +1501,6 @@ def index(level, program_id):

parsons = True if PARSONS[g.lang].get_parsons_data_for_level(level) else False
quiz = True if QUIZZES[g.lang].get_quiz_data_for_level(level) else False
tutorial = True if TUTORIALS[g.lang].get_tutorial_for_level(level) else False

quiz_questions = 0
parson_exercises = 0
Expand Down Expand Up @@ -1650,7 +1556,6 @@ def index(level, program_id):
commands=commands,
parsons=parsons,
parsons_exercises=parson_exercises,
tutorial=tutorial,
latest=version(),
quiz=quiz,
quiz_questions=quiz_questions,
Expand Down Expand Up @@ -1828,7 +1733,6 @@ def tryit(level, program_id):

parsons = True if PARSONS[g.lang].get_parsons_data_for_level(level) else False
quiz = True if QUIZZES[g.lang].get_quiz_data_for_level(level) else False
tutorial = True if TUTORIALS[g.lang].get_tutorial_for_level(level) else False

quiz_questions = 0
parson_exercises = 0
Expand Down Expand Up @@ -1884,7 +1788,6 @@ def tryit(level, program_id):
commands=commands,
parsons=parsons,
parsons_exercises=parson_exercises,
tutorial=tutorial,
latest=version(),
quiz=quiz,
quiz_questions=quiz_questions,
Expand Down Expand Up @@ -2599,25 +2502,6 @@ def translate_keywords():
return make_response(gettext('translate_error'), 400)


# TODO TB: Think about changing this to sending all steps to the front-end at once
@app.route('/get_tutorial_step/<level>/<step>', methods=['GET'])
def get_tutorial_translation(level, step):
# Keep this structure temporary until we decide on a nice code / parse structure
if step == "code_snippet":
code = hedy_content.deep_translate_keywords(gettext('tutorial_code_snippet'), g.keyword_lang)
return make_response({'code': code}, 200)
try:
step = int(step)
except ValueError:
return make_response(gettext('invalid_tutorial_step'), 400)

data = TUTORIALS[g.lang].get_tutorial_for_level_step(level, step, g.keyword_lang)
if not data:
data = {'title': gettext('tutorial_title_not_found'),
'text': gettext('tutorial_message_not_found')}
return make_response((data), 200)


@app.route('/store_parsons_order', methods=['POST'])
def store_parsons_order():
body = request.json
Expand Down
4 changes: 1 addition & 3 deletions content/pages/ar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,5 @@ teacher-guide:
- text: |-
جميع معلمي Hedy ومبرمجيها ومعجبيها الآخرين مرحب بهم للانضمام إلى خادمنا على <a href="https://discord.gg/8yY7dEme9r" target="_blank">Discord</a>. هذا هو المكان المثالي للدردشة حول Hedy: لدينا قنوات حيث يمكنك عرض مشاريعك ودروسك الرائعة، وقنوات للإبلاغ عن الأخطاء، وقنوات للدردشة مع معلمين آخرين ومع فريق Hedy.
يمكنك <a href="https://www.youtube.com/watch?v=Lyz_Lnd-_aI" target="_blank">هنا</a> العثور على فيديو حول كيفية الانضمام إلى مجتمع Discord.
- {}
- subsections:
- text: هل ترغب في متابعة البرنامج التعليمي (مرة أخرى)؟ انقر <a href="https://hedy.org/tutorial" target="_blank">هنا</a>.
2 changes: 0 additions & 2 deletions content/pages/bg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ teacher-guide:
Няма нужда да инсталирате нищо преди да работите с Хеди, просто отворете уебсайта и сте готови!
- title: Общността на Хеди
text: 'Всички учители, програмисти и други фенове на Хеди са добре дошли да се присъединят към нашия [Discord сървър](https://discord.gg/8yY7dEme9r). Това е идеалното място за разговори за Хеди : имаме канали, в които можете да покажете страхотните си проекти и уроци, канали за докладване на грешки и канали за разговори с други учители и с екипа на Хеди.'
- {}
- {}
- title: Подготовка
key: подготовка
subsections:
Expand Down
5 changes: 0 additions & 5 deletions content/pages/ca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,6 @@ teacher-guide:
<a href="https://www.youtube.com/watch?v=Lyz_Lnd-_aI" target="_blank">Aquí</a> podeu trobar un vídeo sobre com unir-vos a la comunitat de Discord.
- text: "Les organitzacions de la UE han de complir amb el RGPD (Reglament General de Protecció de Dades) quan processen dades personals.\nCom que aquest és un tema complex per a moltes escoles, pots utilitzar totes les funcionalitats de programació de Hedy sense compartir dades personals.\nLa manera més fàcil de fer-ho és utilitzar Hedy sense crear comptes per al professor i els estudiants. Sense comptes, totes les funcionalitats estan disponibles, amb l'excepció de personalitzar nivells, desar els programes dels estudiants i veure el seu progrés. Això és limitant, però hi ha escoles que utilitzen Hedy d'aquesta manera.\n\nUna segona manera és que un professor creï un compte amb una adreça de correu electrònic sense dades personals, per exemple \"[email protected]\". A part d'una adreça de correu electrònic, que només es requereix per restablir la contrasenya, no necessites compartir cap informació quan crees un compte de professor.\nAmb un compte de professor, pots crear comptes anònims per als estudiants, per exemple, estudiant-arc-de-sant-martí1, estudiant-arc-de-sant-martí2, etc. (Consulta 'Preparacions per a l'ensenyament' per a un manual detallat). D'aquesta manera, pots utilitzar totes les funcionalitats de Hedy, incloent desar el progrés, sense compartir dades personals teves o dels teus estudiants.\n\nSi el que s'ha explicat anteriorment no és suficient per al teu context, podem signar un acord de processament per al processament de les teves dades personals."
title: Hedy i el RGPD
- title: Tutorial
key: tutorial
subsections:
- title: Tutorial
text: Vols seguir el tutorial (un altre cop)? Clica <a href="https://hedy.org/tutorial" target="_blank">aquí</a>.
- title: Teaching preparations
key: preparations
subsections:
Expand Down
5 changes: 0 additions & 5 deletions content/pages/cs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ teacher-guide:
text: "Organizace v EU musí při zpracování osobních údajů dodržovat GDPR (obecné nařízení o ochraně osobních údajů).\nProtože se jedná o složitou problematiku pro mnoho škol, můžete využívat všechny funkce programování Hedy bez sdílení osobních údajů.\nNejjednodušší je používat Hedy bez vytváření účtů pro učitele a studenty. Bez účtů jsou k dispozici všechny funkce s výjimkou personalizace úrovní, ukládání programů studentů a prohlížení jejich pokroku. To je omezující, ale existují školy, které Hedy takto používají.\n\nDruhým způsobem je, že si učitel vytvoří účet s e-mailovou adresou bez osobních údajů, například „[email protected]“. Kromě e-mailové adresy, která je vyžadována pouze pro obnovení hesla, nemusíte při vytváření účtu učitele sdělovat žádné údaje.\nS účtem učitele můžete vytvářet anonymní účty pro studenty, např. rainbow-student1, rainbow-student2 atd (podrobný návod naleznete v části „Přípravy na výuku“). Tímto způsobem můžete využívat všechny funkce Hedy, včetně ukládání pokroku, aniž byste sdíleli osobní údaje své nebo svých studentů.\n\nPokud vám výše uvedený postup v daném kontextu nestačí, můžeme s vámi uzavřít smlouvu o zpracování osobních údajů."
title: Úvod
key: úvod
- title: Návod
key: návod
subsections:
- title: Návod
text: Chcete (znovu) sledovat návod? Klikněte na<a href="https://hedy.org/tutorial" target="_blank"><a href="https://hedy.org/tutorial" target="_blank">zde</a>.
- subsections:
- title: Pro učitele
text: Své hodiny můžete připravit na stránce <a href="https://hedy.org/for-teachers" target="_blank">Pro učitele</a>. Najdete zde vše potřebné pro výuku s Hedy, jako jsou vaše třídy, dobrodružství a prezentace. Všechny funkce stránky pro učitele jsou vysvětleny níže.
Expand Down
1 change: 0 additions & 1 deletion content/pages/da.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ teacher-guide:
- {}
- {}
- {}
- {}
- levels:
- sections:
- {}
Expand Down
5 changes: 0 additions & 5 deletions content/pages/de.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,6 @@ teacher-guide:
text: |-
Alle Hedy-Lehrpersonen, Programmierer und Programmiererinnen und andere Fans sind auf unserem <a href="https://discord.gg/8yY7dEme9r" target="_blank">Discord-Server</a> willkommen. Dies ist der ideale Ort, um sich über Hedy auszutauschen: wir haben Channel, wo du deine coolen Projekte und Lektionen zeigen kannst, Channel um Fehler zu melden, und Channel um sich mit anderen Lehrpersonen und dem Hedy-Team zu unterhalten.
<a href="https://www.youtube.com/watch?v=Lyz_Lnd-_aI" target="_blank">Hier</a> findest du ein Video darüber, wie man der Discord Community beitritt.
- title: Tutorial
key: tutorial
subsections:
- title: Tutorial
text: Möchtest du das Tutorial (nochmal) machen? Klicke <a href="https://hedy.org/tutorial" target="_blank">hier</a>.
- title: Vorbereitungen
key: vorbereitungen
subsections:
Expand Down
5 changes: 0 additions & 5 deletions content/pages/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,6 @@ teacher-guide:
With a teacher account, you can create anonymous accounts for students, e.g. rainbow-student1, rainbow-student2, etc (See 'Teaching preparations' for a detailed manual). This way you can use all functionality of Hedy, including saving progress, without sharing personal data of yourself or your students.
If the above is not sufficient for your context, we can sign a processing agreement for the processing of your personal data.
- title: Tutorial
key: tutorial
subsections:
- title: Tutorial
text: Do you want to follow the tutorial (again)? Click <a href="https://hedy.org/tutorial" target="_blank">here</a>.
- title: Teaching preparations
key: preparations
subsections:
Expand Down
4 changes: 0 additions & 4 deletions content/pages/eo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ teacher-guide:
text: <Verkota>
- title: Instruado per Hedy
- title: Aparatoj
- title: Tutorial
key: tutorial
subsections:
- title: Tutorial
- title: Preparations
key: preparations
subsections:
Expand Down
5 changes: 0 additions & 5 deletions content/pages/es.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,6 @@ teacher-guide:
Con una cuenta de profesor, puede crear cuentas anónimas para los alumnos, por ejemplo, rainbow-alumno1, rainbow-alumno2, etc (consulte el manual "Preparativos para la enseñanza"). De esta manera usted puede utilizar todas las funcionalidades de Hedy, incluyendo guardar el progreso, sin compartir datos personales suyos o de sus alumnos.
Si lo anterior no es suficiente para su contexto, podemos firmar un acuerdo de procesamiento para el tratamiento de sus datos personales.
- title: Tutorial
key: tutorial
subsections:
- title: Tutorial
text: ¿Quieres ver el tutorial (de nuevo)? Haz clic <a href="https://hedy.org/tutorial" target="_blank">aquí</a>.
- title: Preparativos para la enseñanza
key: preparativos
subsections:
Expand Down
1 change: 0 additions & 1 deletion content/pages/et.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ teacher-guide:
Hedy kasutamiseks ei ole vaja midagi alla laadida, lihtsalt ava veebileht ja hakka pihta!
- title: Hedy kogukond
text: 'Kutsume kõiki Hedy õpetajaid, programmeerijaid ja teisi fänneliituma oma [Discord''i serveriga](https://discord.gg/8yY7dEme9r). See on ideaalne koht Hedy teemadel vestlemiseks: meil on kanalid, kus saad teistega jagada oma lahedaid projekte ja õppeplaane, kanalid vigade raporteerimiseks ja kanalid teiste õpetajatega ja Hedy meeskonnaga vestlemiseks.'
- {}
- title: Ettevalmistused
key: Ettevalmistused
subsections:
Expand Down
5 changes: 0 additions & 5 deletions content/pages/fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ teacher-guide:
text: |-
Tous les enseignants Hedy, programmeurs et autres fans sont les bienvenus sur notre <a href="https://discord.gg/8yY7dEme9r" target="_blank">server Discord</a>. C'est l'endroit idéal pour chatter à propos de Hedy : nous avons des channels où vous pouvez montrer vos projets cools et vos leçons, des channels pour remonter les bugs et des channels pour chatter avec d'autres enseignants et l'équipe Hedy.
<a href="https://www.youtube.com/watch?v=Lyz_Lnd-_aI" target="_blank">Ici</a> vous trouverez une vidéo expliquant comment rejoindre notre communauté sur Discord.
- title: Tutoriel
key: tutoriel
subsections:
- title: Tutoriel
text: Vous souhaitez (re)voir le tutoriel <a href="https://hedycode.com/tutorial" target="_blank">? Cliquez-<a href="https://hedycode.com/tutorial" target="_blank">ici</a>.
- title: Préparatifs
key: préparations
subsections:
Expand Down
5 changes: 0 additions & 5 deletions content/pages/fr_CA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,6 @@ teacher-guide:
Avec un compte enseignant, vous pouvez créer des comptes anonymes pour les élèves, par exemple nuage-eleve1, nuage-eleve2, etc. (Voir 'Préparatifs pédagogiques' pour un manuel détaillé). De cette façon, vous pouvez utiliser toutes les fonctionnalités de Hedy, y compris l'enregistrement des progrès, sans partager de données personnelles vous concernant ou concernant vos élèves.
Si ce qui précède n'est pas suffisant pour votre contexte, nous pouvons signer un accord de traitement pour le traitement de vos données personnelles.
- title: Tutoriel
key: tutoriel
subsections:
- title: Tutoriel
text: Souhaitez-vous (re)voir le tutoriel <a href="https://hedycode.com/tutorial" target="_blank">? Cliquez-<a href="https://hedycode.com/tutorial" target="_blank">ici</a>.
- title: Préparatifs pédagogiques
key: préparations
subsections:
Expand Down
1 change: 0 additions & 1 deletion content/pages/he.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ teacher-guide:
- title: קהל יעד
- title: איך הֶדִי עובדת?
- title: מכשירים
- {}
- title: הכנות
key: הכנות
- title: Teaching with Hedy
Expand Down
5 changes: 0 additions & 5 deletions content/pages/hu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ teacher-guide:
text: |-
A Hedyt használó tanárokat, programozókat, és más érdeklődőket szívesen várjuk a <a href="https://discord.gg/8yY7dEme9r" target="_blank">Discord szerverünkre</a>. Ez az ideális helye, hogy a Hedyről beszéljünk: vannak csatornáink, ahol megoszthatod a projektjeidet és óraterveidet, jelentheted, ha hibát találtál, vagy beszélgethetsz más tanárokkal, illetve a Hedy csapattal.
<a href="https://www.youtube.com/watch?v=Lyz_Lnd-_aI" target="_blank">Itt</a> található egy videó arról, hogy hogyan tudsz a Discordhoz csatlakozni.
- title: Tutorial
key: tutorial
subsections:
- title: Tutorial
text: Szeretnéd a bemutatót (ismét) végignézni? Kattints <a href="https://hedy.org/tutorial" target="_blank">ide</a>.
- title: Előkészületek
key: preparations
subsections:
Expand Down
Loading

0 comments on commit 15b2ee5

Please sign in to comment.