Code can be saved as an asset, similar to images, videos, and other media, and easily embedded in activities. It can also be attached to an activity or question as a related resource. Common applications of code assets include interactive HTML activities and custom forms for data collection. 

Follow the steps below to create a code asset:

  1. Click the Asset Library button when in an activity's edit mode, or select Content>Assets from the main menu.
  2. Next, click the Create New tab at the top.
  3. Select Create Asset using Code and paste your code into the field.
  4. Click Preview to see the code-generated asset in the drawer.
  5. Enter a name for the new asset. 
  6. When finished, click Save. If creating the new code asset while editing an activity, select an option to insert the asset into the content. Then, click Select
    • Insert as link - This option inserts a link inline with the content that opens in a new browser tab or window.
    • Insert as resizable window - This option inserts a link that opens in a resizable window within the current activity.
    • Embed with iFrame - This option inserts a resizable iFrame that is in line with the content. It can be used in book activities, questions, explanations, and more.

Below is an example of an acknowledgment form inserted using a code asset. 

 

IMPORTANT: When using code assets for forms or data collection, it is strongly recommended that you use either the Embed with iFrame option or the Insert as a resizable window option to ensure proper functionality and that data is returned back to Acadio.