Author API Methods
setItemSource()
Sets the source information of the Item being edited. This source content is only used for authoring purposes and will not be shown or used in assessments.
You would want to use this method so that you can programatically set a default value for the source in all Items, for example.
Examples
var hasUpdatedSource = authorApp.setItemSource("My source content.");
console.log(hasUpdatedSource);
Arguments
-
source string
The source content of the Item.
Return value
Type boolean
Returns true
if successful.
Returns false
if unable to set the Item source, for example, when not in the Item editor view or the passed value is not valid.
Related articles
- Updating Item Details In The Sidebar
- The
getItemSource()
method, which allows you to get the Item source.