The code widget allows for coding exercises to be embedded into the worksheet. The code widget is a wrapper around the CodeMirror editor. The code widget supports the following languages:
- JavaScript
- Python
- HTML
The code widget comes with some example excersises. To select an example, just choose one out of the list, be aware that the code will be replaced with the example code.
To change the language of the code widget, just select the language from the list in the top right of the editor. The code widget will automatically highlight the code based on the selected language.
The editor can be customized, by changing the settings in the action panel.
Toggels, if the code can be executed or not. If the code can be executed, the code will be executed when the user clicks the run button, if not, the run button will be disabled.
Toggels, if the editor should show autocompletion suggestions or not.
Switches between the light and dark theme. The light theme is the default theme.
Toggels, if the execution time should be shown or not. The execution time will be shown in the bottom right of the editor.
By clicking on the gutter left of the code, the line will be disabled. Disabled lines cannot be edited. To enable a line, just click on the gutter again.