When creating a new exercise, you may want to use code as content to provide students with a code sample.
To use code as content, follow the steps below.
- Create an assignment. Find out how to create an assignment here.
- Click New exercise, fill in a title and click Save.
- Click New question and select a question type or click New description and select a description type.
- Click the ¶-icon and select code.
- Write your code.
- To highlight the code in the correct way, click the <>-icon and change the code-line from <pre> to <pre class="hljs #code_language">. (For example <pre class="hljs python>)
- Click Save.