Picture of Anthony Starkie
Problems developing plug-in with Authoring Tool
by Anthony Starkie - Monday, 13 June 2016, 6:13 PM
 

I'm new to Adapt Learning and have been following the advice in the Wiki files covering creating your own Plugin component. The plugin I'm developing is an extension of the MCQ component (adapt-contrib-mcq) which I've cloned and used as the basis of my new plugin.

I've updated the properties.schema and bower.json files to reflect the new plugin. These seem to be working as the intended options appear in the Authoring Tool and can be configured (screenshots attached). The only other changes I've made to the files are:

- change of file names for .js, .less and .hbs file to adapt-mcqi.jsmcqi.less and mcqi.hbs respectively.

update of var Mcq to Mcqi in adapt-mcqi.js file.

Changes in LESS files and templates from mcq to mcqi

I've not yet added to or modified any of the JS methods or functions.

I'm having a number of issues at the moment, specifically:

- When I upload the plugin to the authoring tool, I get "an error occurred while getting schemas" (screenshot attached). But when I check the plugin manager, it appears (screenshot attached).

- I can configure the options as with any other question component but then can't run a preview without getting an error - "Uncaught error: mcqi component not found. Is it install and included?" and the course will not load. If I remove this component and load any of the others, the preview will run fine.

I'm running the authoring tool through the Vagrant installation on Mac OSX in Google Chrome. My current plugin files are located on GitHub: https://github.com/anthonystarkie/adapt-mcqi.git

Is there something obvious I'm missing or have included in error? Any suggestions or advice would be appreciated!






Picture of Matt Leathes
Re: Problems developing plug-in with Authoring Tool
by Matt Leathes - Monday, 13 June 2016, 6:58 PM
 

Hmm, I've had a quick look and I can't see anything obviously wrong... as with developing any plugin I would advise you try getting it working with the Framework first before trying it in the Authoring Tool - have you tried that?

Picture of Anthony Starkie
Re: Problems developing plug-in with Authoring Tool
by Anthony Starkie - Tuesday, 14 June 2016, 8:57 PM
 

Hi Matt,

Thanks for the feedback - I hadn't tried using the Framework first but I will do so now. I've been reading around the documentation and it wasn't completely clear to me how I upload a new plugin I'm still developing - is it as simple as copying it into the plugin directory or do I need to register it first following the process outlined in the Wiki? If so, do I need to re-register it with each iteration during the development? 

Picture of Matt Leathes
Re: Problems developing plug-in with Authoring Tool
by Matt Leathes - Wednesday, 15 June 2016, 10:30 AM
 

is it as simple as copying it into the plugin directory or do I need to register it first following the process outlined in the Wiki? If so, do I need to re-register it with each iteration during the development?

Not sure if you mean for the framework or for the authoring tool? But I can tell you that for the framework all you need to do is have a copy in the relevant subfolder of your src directory (src/components for what you're developing) and the $ grunt dev CLI task will automatically update the build with your changes as you make them.

This is why we strongly recommend doing any plugin development in the framework until you're as happy as you can be with how it's working - only then move onto trying it in the AT, as the process of updating a plugin for the AT is more involved.

It's not necessary to register your plugin during development - registration is about making it available to the CLI for commands like $ adapt install - and also to make it appear in the Adapt Plugin Browser - so it's really something you'd do right at the end.

Picture of Chuck Lorenz
Re: Problems developing plug-in with Authoring Tool
by Chuck Lorenz - Monday, 13 June 2016, 8:10 PM
 

Hi Anthony,

I'm adding my name to the list of people who have scanned your code and don't see anything wrong. (No matter what is causing this, good for you for being so careful & thorough for someone "new to Adapt Learning".)

Just seeing what we can rule out:
Are you incrementing the version number in bower.json each time you upload a new version?

- Chuck

Picture of Anthony Starkie
Re: Problems developing plug-in with Authoring Tool
by Anthony Starkie - Tuesday, 14 June 2016, 8:59 PM
 

Hi Chuck,

Thanks for taking the time to check what I've done so far. I did remember the need to change the version number - I first made the mistake of trying to re-upload the same initial plugin version and the authoring tool picked that up so that feature is working ok.

Picture of John Niezen
Re: Problems developing plug-in with Authoring Tool
by John Niezen - Tuesday, 14 June 2016, 6:21 AM
 

We have the same kind of error, but with standard AT see https://community.adaptlearning.org/mod/forum/discuss.php?d=1431. We have no other components but the ones that are with the AT. But once I create a new course and do a preview it starts with all the missing component. If you add that, then another and so on and so on.

We got some tips, but that did not work.