Design and implement a way to request plugin activations for exercises
This would a major update to the exercise JavaScript API and would a milestone going forward with JS plugin system.
So, the idea is that exercises would be configured with a set of plugins they need to work. I guess this should be done in the exercise and not in the material html, which includes a place holder for the exercise. However, there could be plugins that change how a normal exercise is embedded, so I guess both locations should be supported.
The material html could include something like this:
<div data-aplus-exercise="ex1" data-aplus-plugins="active-elements/1.1 logger/2.4"></div>
Where active-elements/1.0 would mean "this exercise requries plugin active-elements and version [1.1, 2.0[ of it. Similarly, the line states that version [2.4, 3.0[ is required for the plugin logger.
I'm not sure how plugins should be implemented, but https://h5p.org/ could be looked as a possible idea.
For the first plugin, the active elements feature could be removed from the chapter.js and implemented as a plugin.
Todo:
- [ ] Design a way to load plugins
- [ ] Implement a way to require plugins via material HTML
- [ ] Implement a way to require plugins via exercise config and/or exercise protocol
- [ ] Implement active elements as a plugin
- [ ] Update documentation in https://apluslms.github.io/protocols/