Add author-mode level editor: forms, live checks, Python execution of solutions, learner preview, YAML export

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
denis
2026-10-16 16:51:33 +02:00
parent 3003eda8a2
commit 57bda6eecf
27 changed files with 1712 additions and 10 deletions
+147
View File
@@ -0,0 +1,147 @@
{
"author.title": "Level editor — author mode",
"author.skip": "Go to the form",
"author.language": "Editor language",
"author.toolbar.label": "Level actions",
"author.toolbar.new": "New level",
"author.toolbar.load_select": "Site level to load",
"author.toolbar.load": "Load this level",
"author.toolbar.import": "Import a YAML file",
"author.toolbar.download": "Download level.yaml",
"author.toolbar.back": "Back to the app",
"author.confirm.new": "Start a new level? The current draft will be replaced.",
"author.confirm.load": "Load level {id}? The current draft will be replaced.",
"author.status.saved": "Draft saved in this browser at {time}.",
"author.status.draft_restored": "Previous draft restored.",
"author.status.loaded": "Level {id} loaded: edit it, then download the file.",
"author.status.imported": "File {name} imported.",
"author.status.import_error": "Import failed: {detail}",
"author.status.downloaded": "level.yaml downloaded for level {id}.",
"author.status.downloaded_with_errors": "level.yaml downloaded, but {count} error(s) remain to fix before proposing it.",
"author.section.info": "Level information",
"author.section.steps": "Steps",
"author.section.steps.help": "One new notion per step. Alternate explanations and code exercises.",
"author.section.mission": "Final mission",
"author.section.problems": "Checks",
"author.section.check": "Run the exercises",
"author.section.preview": "Try it as a learner",
"author.section.export": "Publish the level",
"author.level.id": "Identifier",
"author.level.id.help": "Two digits, a dash, a short lowercase name (e.g. 08-functions). It must equal the folder name levels/<id>/.",
"author.level.title": "Level title",
"author.level.difficulty": "Difficulty (0 to 10)",
"author.level.difficulty.help": "0 = no prerequisite.",
"author.level.xp": "Mission XP",
"author.level.xp.help": "Awarded once, at the end of the level.",
"author.level.requires": "Prerequisite levels",
"author.level.requires.help": "Informative only: never prevents opening the level.",
"author.level.requires.none": "No other level exists yet.",
"author.step.title": "Step {n} — {type}",
"author.step.type.explain": "Explanation",
"author.step.type.code": "Code exercise",
"author.step.add.explain": "Add an explanation",
"author.step.add.code": "Add a code exercise",
"author.step.up": "Move step {n} up",
"author.step.down": "Move step {n} down",
"author.step.remove": "Remove step {n}",
"author.step.text": "Text",
"author.step.text.help": "Short sentences. Inline code goes between backticks: `print()`.",
"author.step.voice": "Offer voice narration",
"author.step.voice.help": "Adds a \"Listen\" button. The audio file is then generated with make voice.",
"author.step.image": "Image (optional)",
"author.step.image.help": "Path relative to the level folder.",
"author.step.instruction": "Instruction",
"author.step.starter": "Starter code",
"author.step.starter.help": "It must run as is, without errors, and must not already pass the tests (except for a \"run to see\" step).",
"author.step.hints": "Hints",
"author.step.hints.help": "One hint per line, from vaguest to most precise. Same count in French and English.",
"author.step.solution": "Reference solution",
"author.step.solution.help": "Required: it is executed to check that the tests are right.",
"author.tests": "Validation tests",
"author.test.title": "Test {n}",
"author.test.add": "Add a test",
"author.test.remove": "Remove test {n}",
"author.test.kind": "Test type",
"author.test.name": "Variable name",
"author.test.value": "Expected value",
"author.test.value.newline": "Exact output: press Enter at the end of the text to expect a final line break (print adds one).",
"author.test.value.regex": "Regular expression applied to the whole output. If the program asks for input, the prompt is part of the output.",
"author.test.valueType": "Value type",
"author.test.valueType.help": "An integer and a decimal that are equal (10 and 10.0) count as the same value; add a \"variable type\" test to tell them apart.",
"author.test.type": "Expected type",
"author.test.inputs": "Scripted inputs (optional)",
"author.test.inputs.help": "One per line, answered in order to input(). The test is then evaluated on a replay of the code with these inputs.",
"author.test.message": "Message if the test fails (optional)",
"author.test.message.label": "Failure message",
"author.valueType.text": "Text",
"author.valueType.number": "Number",
"author.valueType.boolean": "True / false",
"author.kind.no_syntax_error": "No syntax error",
"author.kind.no_syntax_error.help": "The code runs without a syntax error.",
"author.kind.stdout_equals": "Output exactly equal",
"author.kind.stdout_equals.help": "Everything printed, final line break included.",
"author.kind.stdout_contains": "Output contains",
"author.kind.stdout_contains.help": "A piece of text present in the output.",
"author.kind.stdout_matches_regex": "Output matches a regular expression",
"author.kind.stdout_matches_regex.help": "Useful for randomness or varying output.",
"author.kind.code_contains": "Code contains",
"author.kind.code_contains.help": "Checks the use of a notion (e.g. random.choice, while).",
"author.kind.var_equals": "Variable equals",
"author.kind.var_equals.help": "Value of a variable after execution.",
"author.kind.var_type_is": "Variable type",
"author.kind.var_type_is.help": "Type of a variable after execution (str, int, float…).",
"author.mission.title": "Mission title",
"author.mission.goal": "Goal",
"author.mission.tests.help": "Without tests, the mission is validated with a simple \"I understand\" button (like level 00).",
"author.mission.reward": "Reward sound",
"author.remove": "Remove",
"author.path.step": "Step {n}",
"author.path.test": "Test {n}",
"author.path.mission": "Mission",
"author.severity.error": "Error",
"author.severity.warning": "Warning",
"author.severity.info": "Good to know",
"author.problems.none": "No problem detected.",
"author.problems.summary": "{errors} error(s), {warnings} warning(s), {infos} note(s).",
"author.problems.goto": "Go to field",
"author.check.help": "Runs, with real Python, each exercise's solution (it must pass its tests) and its starter code (it must not pass them).",
"author.check.run": "Run the exercises",
"author.check.starting": "Starting Python…",
"author.check.progress": "Exercise {done} of {total}…",
"author.check.passed": "All {count} exercise(s) are correct.",
"author.check.failed": "Some exercises have problems (see the checks).",
"author.check.fix_structure": "First fix the structure errors reported in the checks.",
"author.preview.help": "Plays this level in the real learner interface. Progress is not saved.",
"author.preview.start": "Try this level",
"author.export.step1": "Download level.yaml (toolbar) and place it in levels/<id>/level.yaml.",
"author.export.step2": "Add the level to levels/manifest.json (line below).",
"author.export.step3": "Run make validate-levels.",
"author.export.step4": "If steps have narration enabled, run make voice and add the audio files.",
"author.export.step5": "Run make test, then propose your contribution (see CONTRIBUTING.md).",
"author.export.manifest": "Line to add to levels/manifest.json:",
"author.export.yaml": "Contents of level.yaml",
"lint.schema_required": "Required field missing: {field}.",
"lint.schema_unknown_field": "Unknown field: {field}.",
"lint.schema_pattern": "Invalid format (two digits, dash, lowercase name).",
"lint.schema_enum": "Value not allowed here.",
"lint.schema_type": "Wrong value type.",
"lint.schema_range": "Value out of range, or list too short.",
"lint.schema_invalid": "Invalid structure: {detail}",
"lint.missing_english": "English translation missing.",
"lint.hint_count_differs": "Hint counts differ: {fr} in French, {en} in English.",
"lint.id_already_exists": "A level {id} already exists: the file would replace it.",
"lint.requires_self": "A level cannot be its own prerequisite.",
"lint.requires_unknown": "Unknown prerequisite: {id}.",
"lint.solution_missing": "Reference solution missing.",
"lint.hints_missing": "No hint: providing at least one helps stuck learners.",
"lint.kind_unsupported": "The \"{kind}\" test is not handled by the engine yet.",
"lint.test_name_missing": "Variable name missing.",
"lint.test_value_missing": "Expected value missing.",
"lint.type_unusual": "Unusual type. Usual types: {allowed}.",
"lint.regex_invalid": "Invalid regular expression: {detail}",
"lint.voice_to_generate": "Narration enabled on steps {steps}: run make voice to generate the audio before proposing the level.",
"lint.solution_error": "The solution crashes: {type} — {message}{line}",
"lint.solution_fails": "The solution does not pass its tests: {failures}.",
"lint.starter_passes": "The starter code already passes the tests: the exercise would already be solved.",
"lint.starter_error": "The starter code does not run: {type} — {message}{line}"
}
+147
View File
@@ -0,0 +1,147 @@
{
"author.title": "Éditeur de niveaux — mode auteur",
"author.skip": "Aller au formulaire",
"author.language": "Langue de l'éditeur",
"author.toolbar.label": "Actions sur le niveau",
"author.toolbar.new": "Nouveau niveau",
"author.toolbar.load_select": "Niveau du site à charger",
"author.toolbar.load": "Charger ce niveau",
"author.toolbar.import": "Importer un fichier YAML",
"author.toolbar.download": "Télécharger level.yaml",
"author.toolbar.back": "Retour à l'application",
"author.confirm.new": "Commencer un nouveau niveau ? Le brouillon actuel sera remplacé.",
"author.confirm.load": "Charger le niveau {id} ? Le brouillon actuel sera remplacé.",
"author.status.saved": "Brouillon enregistré dans ce navigateur à {time}.",
"author.status.draft_restored": "Brouillon précédent restauré.",
"author.status.loaded": "Niveau {id} chargé : modifie-le puis télécharge le fichier.",
"author.status.imported": "Fichier {name} importé.",
"author.status.import_error": "Import impossible : {detail}",
"author.status.downloaded": "level.yaml téléchargé pour le niveau {id}.",
"author.status.downloaded_with_errors": "level.yaml téléchargé, mais {count} erreur(s) restent à corriger avant de le proposer.",
"author.section.info": "Informations du niveau",
"author.section.steps": "Étapes",
"author.section.steps.help": "Une seule notion nouvelle par étape. Alterne explications et exercices de code.",
"author.section.mission": "Mission finale",
"author.section.problems": "Vérifications",
"author.section.check": "Exécuter les exercices",
"author.section.preview": "Essayer comme apprenant",
"author.section.export": "Publier le niveau",
"author.level.id": "Identifiant",
"author.level.id.help": "Deux chiffres, un tiret, un nom court en minuscules (ex. 08-functions). Il doit être identique au nom du dossier levels/<id>/.",
"author.level.title": "Titre du niveau",
"author.level.difficulty": "Difficulté (0 à 10)",
"author.level.difficulty.help": "0 = aucun prérequis.",
"author.level.xp": "XP de la mission",
"author.level.xp.help": "Accordés une seule fois, à la fin du niveau.",
"author.level.requires": "Niveaux prérequis",
"author.level.requires.help": "Indicatif : n'empêche jamais d'ouvrir le niveau.",
"author.level.requires.none": "Aucun autre niveau n'existe pour l'instant.",
"author.step.title": "Étape {n} — {type}",
"author.step.type.explain": "Explication",
"author.step.type.code": "Exercice de code",
"author.step.add.explain": "Ajouter une explication",
"author.step.add.code": "Ajouter un exercice de code",
"author.step.up": "Monter l'étape {n}",
"author.step.down": "Descendre l'étape {n}",
"author.step.remove": "Supprimer l'étape {n}",
"author.step.text": "Texte",
"author.step.text.help": "Phrases courtes. Le code en ligne s'écrit entre apostrophes inversées : `print()`.",
"author.step.voice": "Proposer la narration vocale",
"author.step.voice.help": "Ajoute un bouton « Écouter ». Le fichier audio se génère ensuite avec make voice.",
"author.step.image": "Image (facultatif)",
"author.step.image.help": "Chemin relatif au dossier du niveau.",
"author.step.instruction": "Consigne",
"author.step.starter": "Code de départ",
"author.step.starter.help": "Doit s'exécuter tel quel, sans erreur, et ne pas passer déjà les tests (sauf étape « exécute pour voir »).",
"author.step.hints": "Indices",
"author.step.hints.help": "Un indice par ligne, du plus vague au plus précis. Même nombre en français et en anglais.",
"author.step.solution": "Solution de référence",
"author.step.solution.help": "Obligatoire : elle est exécutée pour vérifier que les tests sont justes.",
"author.tests": "Tests de validation",
"author.test.title": "Test {n}",
"author.test.add": "Ajouter un test",
"author.test.remove": "Supprimer le test {n}",
"author.test.kind": "Type de test",
"author.test.name": "Nom de la variable",
"author.test.value": "Valeur attendue",
"author.test.value.newline": "Sortie exacte : appuie sur Entrée en fin de texte pour attendre un retour à la ligne final (print en ajoute un).",
"author.test.value.regex": "Expression régulière appliquée à toute la sortie. Si le programme demande une saisie, l'invite est dans la sortie.",
"author.test.valueType": "Type de la valeur",
"author.test.valueType.help": "Un entier et un décimal égaux (10 et 10.0) comptent pour la même valeur ; ajoute un test « type de variable » pour les distinguer.",
"author.test.type": "Type attendu",
"author.test.inputs": "Saisies scriptées (facultatif)",
"author.test.inputs.help": "Une par ligne, répondues dans l'ordre aux input(). Le test est alors évalué sur un rejeu du code avec ces saisies.",
"author.test.message": "Message si le test échoue (facultatif)",
"author.test.message.label": "Message d'échec",
"author.valueType.text": "Texte",
"author.valueType.number": "Nombre",
"author.valueType.boolean": "Vrai / faux",
"author.kind.no_syntax_error": "Pas d'erreur de syntaxe",
"author.kind.no_syntax_error.help": "Le code s'exécute sans erreur de syntaxe.",
"author.kind.stdout_equals": "Sortie exactement égale",
"author.kind.stdout_equals.help": "Tout ce qui est affiché, retour à la ligne final compris.",
"author.kind.stdout_contains": "Sortie contient",
"author.kind.stdout_contains.help": "Un morceau de texte présent dans la sortie.",
"author.kind.stdout_matches_regex": "Sortie conforme à une expression régulière",
"author.kind.stdout_matches_regex.help": "Utile pour du hasard ou des sorties qui varient.",
"author.kind.code_contains": "Le code contient",
"author.kind.code_contains.help": "Vérifie l'usage d'une notion (ex. random.choice, while).",
"author.kind.var_equals": "Variable égale à",
"author.kind.var_equals.help": "Valeur d'une variable après exécution.",
"author.kind.var_type_is": "Type de variable",
"author.kind.var_type_is.help": "Type d'une variable après exécution (str, int, float…).",
"author.mission.title": "Titre de la mission",
"author.mission.goal": "Objectif",
"author.mission.tests.help": "Sans test, la mission se valide par un simple bouton « Je comprends » (comme au niveau 00).",
"author.mission.reward": "Son de récompense",
"author.remove": "Supprimer",
"author.path.step": "Étape {n}",
"author.path.test": "Test {n}",
"author.path.mission": "Mission",
"author.severity.error": "Erreur",
"author.severity.warning": "Avertissement",
"author.severity.info": "À savoir",
"author.problems.none": "Aucun problème détecté.",
"author.problems.summary": "{errors} erreur(s), {warnings} avertissement(s), {infos} information(s).",
"author.problems.goto": "Aller au champ",
"author.check.help": "Exécute avec le vrai Python la solution de chaque exercice (elle doit passer ses tests) et son code de départ (il ne doit pas les passer).",
"author.check.run": "Exécuter les exercices",
"author.check.starting": "Démarrage de Python…",
"author.check.progress": "Exercice {done} sur {total}…",
"author.check.passed": "Les {count} exercice(s) sont corrects.",
"author.check.failed": "Des exercices posent problème (voir les vérifications).",
"author.check.fix_structure": "Corrige d'abord les erreurs de structure signalées dans les vérifications.",
"author.preview.help": "Joue ce niveau dans l'interface réelle de l'apprenant. La progression n'est pas enregistrée.",
"author.preview.start": "Essayer ce niveau",
"author.export.step1": "Télécharge level.yaml (barre d'outils) et place-le dans levels/<id>/level.yaml.",
"author.export.step2": "Ajoute le niveau à levels/manifest.json (ligne ci-dessous).",
"author.export.step3": "Lance make validate-levels.",
"author.export.step4": "Si des étapes ont la narration activée, lance make voice et ajoute les fichiers audio.",
"author.export.step5": "Lance make test, puis propose ta contribution (voir CONTRIBUTING.md).",
"author.export.manifest": "Ligne à ajouter à levels/manifest.json :",
"author.export.yaml": "Contenu du fichier level.yaml",
"lint.schema_required": "Champ obligatoire manquant : {field}.",
"lint.schema_unknown_field": "Champ inconnu : {field}.",
"lint.schema_pattern": "Format invalide (deux chiffres, tiret, nom en minuscules).",
"lint.schema_enum": "Valeur non autorisée ici.",
"lint.schema_type": "Type de valeur incorrect.",
"lint.schema_range": "Valeur hors limites, ou liste trop courte.",
"lint.schema_invalid": "Structure invalide : {detail}",
"lint.missing_english": "Traduction anglaise manquante.",
"lint.hint_count_differs": "Le nombre d'indices diffère : {fr} en français, {en} en anglais.",
"lint.id_already_exists": "Un niveau {id} existe déjà : le fichier le remplacerait.",
"lint.requires_self": "Un niveau ne peut pas être son propre prérequis.",
"lint.requires_unknown": "Prérequis inconnu : {id}.",
"lint.solution_missing": "Solution de référence manquante.",
"lint.hints_missing": "Aucun indice : prévoir au moins un indice aide les apprenants bloqués.",
"lint.kind_unsupported": "Le test « {kind} » n'est pas encore géré par le moteur.",
"lint.test_name_missing": "Nom de variable manquant.",
"lint.test_value_missing": "Valeur attendue manquante.",
"lint.type_unusual": "Type inhabituel. Types usuels : {allowed}.",
"lint.regex_invalid": "Expression régulière invalide : {detail}",
"lint.voice_to_generate": "Narration activée aux étapes {steps} : lance make voice pour générer l'audio avant de proposer le niveau.",
"lint.solution_error": "La solution plante : {type} — {message}{line}",
"lint.solution_fails": "La solution ne passe pas ses tests : {failures}.",
"lint.starter_passes": "Le code de départ passe déjà les tests : l'exercice serait déjà résolu.",
"lint.starter_error": "Le code de départ ne s'exécute pas : {type} — {message}{line}"
}
+2
View File
@@ -58,6 +58,8 @@
"settings.theme.light": "Light",
"settings.theme.dark": "Dark",
"settings.guide": "Guide character",
"settings.author": "Author mode",
"settings.authorOpen": "Open the level editor",
"settings.sound": "Sound effects",
"settings.volume": "Volume",
"settings.voice": "Voice",
+2
View File
@@ -58,6 +58,8 @@
"settings.theme.light": "Clair",
"settings.theme.dark": "Sombre",
"settings.guide": "Personnage-guide",
"settings.author": "Mode auteur",
"settings.authorOpen": "Ouvrir l'éditeur de niveaux",
"settings.sound": "Effets sonores",
"settings.volume": "Volume",
"settings.voice": "Voix",