Skip to main content

Exam Builder

Renders an interface for users to build a new exam.

Preview

Untitled

Parameters

ParameterTypeDescription
idstringSpecify an existing exam to edit.

Launch Options

ParameterTypeDescription
createWithTagsobjectApplies specified tags to an exam on create.
contentFilterobjectApplies search filters to all search results returned within the component.

Events

ParameterTypeDescription
onCreateExam

Features

Create Exams

Users can create new exams from within the exam builder interface, and then select the created exam as part of the picker UI.

Attach Tags to Exam on Create

You may request content tags be applied to exams (or any content) created in this component by passing createWithTags to launchOptions:

{
"createWithTags": [
{
"key": "school-id",
"type": "string",
"value": "123"
}
]
}

Filter Visible Search Results

You may request that the component only return content (items) that match a specific tag by adding contentFilter to launchOptions:

{
"createWithTags": [
{
"key": "school-id",
"type": "string",
"value": "123"
}
],
"contentFilter": {
"tags": {
"include": [
{
"key": "school-id",
"type": "string",
"value": "123"
}
]
}
}
}

Note:

  • Filtering by multiple tags values produces exclusive (and-style), not inclusive (or-style) results.

Launch using SDK

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>My First Campfire Application</title>
</head>

<body>
<div id="app">
<!-- Where the UI will load -->
<iframe id="tool" name="tool"></iframe>
</div>

<script>
// Step 1: Gather user data (from your server)
const user = {
email: "john.deaux@example.com",
firstName: "Jonathon"
lastName: "Deaux",
roles: "Instructor"
}
const APP_ID = "THE_DISTRICT_APP_KEY"

// Step 2: Instantiate
const service = new window.CampfireSDK.ExamBuilder({
id: "[item-id]",
params: {
oauth_consumer_key: APP_ID,
resource_link_id: "0",
user_id: user.email,
lis_person_contact_email_primary: user.email,
lis_person_name_given: user.firstName,
lis_person_name_family: user.lastName,
lis_person_name_full: `${user.firstName} ${user.lastName}`,
roles: user.roles
},
signingFunction: /* ... */
});

// Step 3: Mount
consumer.mount("tool").then(() => {
console.log("Mounted!");
})
</script>
</body>
</html>