The main idea is that we need syntax highlighting to quiz questions.
Here are the requirements:
- a plugin that is updated frequently, preferable by more than 1 person.
- support for syntax highlighting to as many languages as possible, not only in editing mode within the editor but in the view mode of questions, pages etc.
- it has to be free.
- it is better that it is accessible from the buttons of the editor so that it is easily accessible from students who want to create quiz content.
- it should support moodle 3.3+
Plugins that do not fill these requirements are:
- Code Sample plugin
So here is a solution:
1 – Install the generico filter
- Download the filter
- unzip to <moodleinstalldir>/filters
- navigate to moodle notifications and the system will guide you for installation, install.
2 – Activate the generico filter
Go to: Site Administration->plugins->filters->manage filters and activate the filter
3 – Configure the generico filter
Go to: Site Administration -> plugins -> filters -> Generico
From the bundles you can try the codeblock. But it didnt work for me.
I used prettify.txt from moodle forums. To install it simply drag and drop to the proper area (you will be prompted at the administrations screen, it should be a green area named “bundle”).
You can download prettify.txt from here.
To use the filter you can use the following tags:
4 – Install a plugin for your editor
For Atto you need: Generico Atto Icon with which a button will appear on the editor that can be used to autogenerate the generico tags.