Skip to main content

Item Editor

Overview

Launch a standalone Item Creation or Item Editing experience.

Item Editor

Endpoints

Launch URL (new item): /lti/launch/author/item

Launch URL (existing item): /lti/launch/author/item/<id>

Additional Parameters

{
id?: string | undefined;
}

Events

LAUNCHED

Emitted immediately after the Campfire application finished loading.

ITEM_HAS_CHANGES

Emitted when the state of the save button in the Item Editor changes. This event can be used to warn a user trying to navigate away without saving.

data: {
modified: boolean
}

ITEM_SAVED

Emitted every time the item is saved to our database, including during creation

data: {
id: string;
}

ITEM_CREATED

Emitted the first time an item is saved to our database

data: {
id: string;
}

Messages

setItemContent

Set the content of an item programmatically in the UI. This command can be used in the Item Editor, the Exam Builder, and the Exam Editor

component.setItemContent({
content: {
canvas: [
{
type: "choice",
prompt: {
body: "<p>1</p>",
},
options: [
{
text: "<p>2 (correct)</p>",
isKey: true,
},
{
text: "<p>3</p>",
isKey: false,
},
{
text: "<p>4</p>",
isKey: false,
},
{
text: "<p>5</p>",
isKey: false,
},
],
},
],
},
});