Picture of michael lennon
How best to introduce custom html/js
by michael lennon - Tuesday, 14 July 2015, 7:52 PM
 

Folks,

I have a number of charts and tools I have created using custom html/js that I would like to include in a course.

Is there a recommended approach when adding custom html to be to an article/custom component.

Is there for example a way of adding partials to an article?

Thanks

Picture of Chris Jones
Re: How best to introduce custom html/js
by Chris Jones - Wednesday, 15 July 2015, 8:32 AM
 

Hello Michael,

Adapt is very flexible in this regard, it has been designed to be modular by means of plugins and components. You could for instance create your own chart component and use that in you articles.

There is a guide on the wiki on developing plugins (they are written using HTML and Javascript)

https://github.com/adaptlearning/adapt_framework/wiki/Developing-plugins

There is also a great deal of community plugins that have been developed so its possible that you could find that something has already been created.

Chris

 

 

Picture of michael lennon
Re: How best to introduce custom html/js
by michael lennon - Friday, 17 July 2015, 3:35 PM
 

Hi Chris,

Say I have 6 or 7 highchart "slides" in a course. II would'nt make sense to create and register a plugin for each of these right?

Can I register the highchartsJS file during the build and then reference a chart object in the body html of a block/component?

I don't want to be registering plugins for code that will be of limited contextual use.

 

Picture of x z
Re: How best to introduce custom html/js
by x z - Friday, 17 July 2015, 6:04 PM
 

I'm wondering if it would be possible to copy the code for each chart or another type of Interactive directly into an HTML block. I'm not a sophisticated coder -- just a former teacher teaching herself to build interactive learning activities. 

Mark
Re: How best to introduce custom html/js
by Mark Lynch - Wednesday, 15 July 2015, 9:31 AM
 

Hi Michael,

 

The iframe component might help, https://github.com/LearningPool/adapt-contrib-responsiveIframe.

We originally developed this to embed adobe captivate files into courses.

 

Mark. 

Picture of michael lennon
Re: How best to introduce custom html/js
by michael lennon - Wednesday, 15 July 2015, 2:38 PM
 

Thanks guys, the guide is a bit on the light side. Is there any tutorials out there on creating a very simple plugin? 

Picture of Chris Jones
Re: How best to introduce custom html/js
by Chris Jones - Wednesday, 15 July 2015, 3:16 PM
 

I don't know about a tutorial, someone else here may have something, but I do have a very simple adapt plugin

 templates/helloWorld.handlebars - this is a very simple template that diplays a title.

 css/helloWorld.less - this adds some custom styling.

 js/helloWorld.js - in which a Backbone view is used to render the Handlebars template with data. Adapt.register() is called to register the view with the Adapt framework.

 finally bower.json defines all of the required properties of the plugin such as name, version and keywords.

 ...very finally if you want to integrate your plugin with the Authoring Tool you will need to define a schema.json and properties.json. (maybe someone helpful from the Authoring Tool team could post something on this).

 

Picture of michael lennon
Re: How best to introduce custom html/js
by michael lennon - Wednesday, 15 July 2015, 3:29 PM
 

Thanks Chris, that is exactly what I was looking for

Picture of michael lennon
Re: How best to introduce custom html/js
by michael lennon - Wednesday, 15 July 2015, 5:17 PM
 

Could anyone give me some info on how to integrate a plugin with the Authoring Tool using schema.json and properties.json like Chris mentioned?

Mark
Re: How best to introduce custom html/js
by Mark Lynch - Wednesday, 15 July 2015, 9:35 PM
 

Hi,

Some documentation here https://github.com/adaptlearning/adapt_authoring/wiki/Plugin-Compatibility, it has links to the core components schema files - use those as samples/examples.

Mark.

Picture of michael lennon
Re: How best to introduce custom html/js
by michael lennon - Thursday, 16 July 2015, 11:16 AM
 

Thanks Mark. Folks I created a test plug-in and uploaded it as a zip to the tool via plugins management. Can you tell me how I can delete or update a plugin in the adapt tool/command line?

Mark
Re: How best to introduce custom html/js
by Mark Lynch - Thursday, 16 July 2015, 2:48 PM
 

Hi Michael,

The adapt-cli currently does not support unregistering of components. However, bower has recently implemented support for this, and so adapt-cli may soon support it also. Perhaps you can create an issue on https://github.com/adaptlearning/adapt-cli to kickstart this feature? In the meantime, you may be able to use bower to unregister the component, although I have not tested this.

Try the following commands:

$ npm install -g bower

$ cd /path/to/my/project

$ bower unregister my-component-name

I'd be interested to know if this works for you. If you decide to try this, please post back your result.

Picture of michael lennon
Re: How best to introduce custom html/js
by michael lennon - Thursday, 16 July 2015, 3:24 PM
 

Hi Mark,

I'm getting a "bower EUNKNOWN cannot delete..". message when I try.

 

Picture of michael lennon
Re: How best to introduce custom html/js
by michael lennon - Tuesday, 21 July 2015, 12:11 PM
 

Hi Chris,

Can you give me an example of the JSON for the component as none is supplied in the github example? 

Im trying... 

{

        "_id":"c-142",

        "_parentId":"b-72",

        "_type":"component",

        "_component":"helloWorld"

    }

but its throwing errors in the browser. Am I missing some properties?

 

 

{        "_id":"c-142",        "_parentId":"b-72",        "_type":"component",        "_component":"helloWorld"     
    }