You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Idea
Currently we ask teachers to explicitly add curly braces { } around keywords so that they can be translated. It's much better UX to do that automatically, plus we already have the code that recognize keywords! This change should be integrated when we save the code of an adventure within the customize-adventure page.
The text was updated successfully, but these errors were encountered:
Adds curly braces automatically around keywords in the teacher's adventure code.
For that, we iterate over the code snippets inside the contents of the editor, and use Lezer to parse and the code, and eventually iterate over the syntax tree to add curly braces around the keywords. The generated code should be as close as possible to the original one, maintaining indentation levels, spaces, and even errors.
Also adds a warning for the case when the teacher selects several levels and also have code snippets, letting them know this can lead to trouble.
Fixes#5140
**How to test**
* Automated tests should pass (WIP)
* Create an adventure, and write your code normally.
* Log in as a student, or preview the class where that adventure was added and see that you can change the keywords language.
* You could also see the generated code by going to the local database, searching for the adventure you just created and check that the keywords have curly braces around them.
Idea
Currently we ask teachers to explicitly add curly braces { } around keywords so that they can be translated. It's much better UX to do that automatically, plus we already have the code that recognize keywords! This change should be integrated when we save the code of an adventure within the customize-adventure page.
The text was updated successfully, but these errors were encountered: