Picture of Sherri Fricker
Custom Component
by Sherri Fricker - Thursday, 20 May 2021, 5:54 PM
 

Is it possible to save a component - for instance an accordion component that we use often within and across courses. This would reduce the need for us to copy and paste the source code each time we need to use the same component.

Thanks!

 

We are using 

  • Authoring tool version 0.10.5
  • Framework version 5.12.1
Picture of Oliver Foster
Re: Custom Component
by Oliver Foster - Monday, 24 May 2021, 8:27 AM
 

This post seems rather confusing.

You're using the Authoring Tool, with the preinstalled Accordion plugin. You've also installed third party plugins.

A component is a plugin. You have saved them, uploaded them and used them. Their source code is contained in the plugin zip. 

What are you copy-pasting?

 

 

Picture of Sherri Fricker
Re: Custom Component
by Sherri Fricker - Tuesday, 25 May 2021, 2:52 PM
 

We re-use a number of the components already populated with content. It is the content of the accordion that I would rather not be copying & pasting each time we use a standard component within and across courses.

For instance, we provide keyboard instructions for certain items more than once within one course. 

Picture of Oliver Foster
Re: Custom Component
by Oliver Foster - Tuesday, 25 May 2021, 3:41 PM
 

No, this isn't currently possible, sorry.

 

Picture of Chuck Lorenz
Re: Custom Component
by Chuck Lorenz - Wednesday, 26 May 2021, 1:06 PM
 

Sherri,

Your post is entitled "Custom Component."  Are you (or someone on your staff) willing to create a new component that is based on the Accordion? Unless I'm misunderstanding your requirements, I think it is possible to build a custom accordion component that includes preset text.

A couple of coding hurdles: 

  • Accordion items are built from text and data provided in the AAT item config editor. These are added to the component/plugin model and respond to javascript events for expand, contract, and completion. So attempting to add your example keyboard instruction item to the .hbs template alone may not be enough. I suspect that your js code will need to create your instruction item and add it to the ItemsComponentModel alongside the other items created through the AAT config editor.  
  • Rename the plugin (and associated code) in order to avoid conflicts with adapt-contrib-accordion and to help you recognize it in the AAT. You can find other posts and articles in the framework wiki to guide you with this.  

(Ollie: flaws in this basic approach?)

Picture of Oliver Foster
Re: Custom Component
by Oliver Foster - Thursday, 27 May 2021, 8:33 AM
 

> Flaws in this basic approach?

The number of plugins which do the same job could become unmaintainable as it's 1 plugin for 1 set of defaults. If you need 3 sets of accordion defaults, you'd have 4 accordions in the AAT.

Otherwise it'd work fine.

Picture of Sherri Fricker
Re: Custom Component
by Sherri Fricker - Thursday, 27 May 2021, 2:02 PM
 

We also use Articulate Rise and it allows us to save pre-built blocks (in Adapt language that could be more than 1 block with the included components). It is really helpful - naming them properly makes retrieval much easier.

Thanks for helping me out!

Sherri