I have been reading through the developer docs on Moodle Mobile2
And I would like to make my Gapfill question type work with it. The core question types work fine including the draggy droppy OU questions which are a bit similar to mine, but I am quite sure where to start. Does anyone have advice/suggestions/links?
first of all you should be familiar with Angular and directives, since question types work as directives.
To start developing you should follow this guide:
The easiest way to create your addon is to copy a similar question type from the mm2 repository and adapt it to your needs. For example, if your question type is similar to ddwtos then you should base your addon in it:
The structure of the addon is the following:
scss -> Custom styles for your addon.
directive.js -> The directive that will render your question. It will receive a question object in the scope. You can add a console log to inspect the properties of this question received.
handlers.js -> This service is the one that exposes your addon to the rest of the app. You can see the list of functions it can implement in this JSDoc.
main.js -> This is where the addon module is declared and initialised. Basically, you tell the app that this addon is a question type and its name.
render.js -> This is an adaptation to Angular of the JS code to make drag and drop work in Moodle: https://github.com/moodle/moodle/blob/master/question/type/ddwtos/yui/build/moodle-qtype_ddwtos-dd/moodle-qtype_ddwtos-dd.js
template.html -> The template of the directive.
I hope this helps you get started