Exam Picker
Overview
Display an interface that allows users to browse and select an Exam. Rich searching, filtering, and sorting capabilities are included. The primary purpose of this component is to fire an examSelected event containing the id of the Exam selected.
Endpoints
Launch URL: /lti/launch/exam-builder
Additional Parameters
None
Events
LAUNCHED
Emitted immediately after the Campfire application finished loading.
EXAM_EDITOR_CLOSED
Emitted when the Exam Builder modal inside of the Exam Picker is closed. NOTE: Do not use this event to understand whether a save or create happened as a byproduct of this event being fired.
EXAM_EDITOR_OPENED
Emitted when the Exam Builder modal inside of the Exam Picker opened.
EXAM_EDITOR_CANCELLED
Emitted when the Exam Builder modal inside of the Exam Picker is dismissed and no action is taken.
EXAM_SELECTED
Emitted when the “Select Assessment” button is pressed, and an Exam has been selected.
data: {
id: string;
}
Sample Implementation
new ExamPicker({
domain: import.meta.env.VITE_EXAMSPARK_SDK_DOMAIN,
params: {
oauth_consumer_key: import.meta.env.VITE_EXAMSPARK_SDK_CONSUMER_KEY,
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: [
"Instructor",
"urn:lti:instrole:ims/lis/Administrator",
"urn:lti:sysrole:ims/lis/SysAdmin",
].join(","),
},
launchOptions: {
selectionCardinality: "none", /* "none" | "single" */
userPrefs: {
objectiveAuthorityIds,
},
scopes: [
{
type: "action",
action: "createItem",
},
{
type: "action",
action: "updateItem",
},
{
type: "action",
action: "createExam",
},
{
type: "action",
action: "updateExam",
},
],
view: {
filters: {
// allowCustomFilters: true,
// ...other filter settings
// ...then, the filters to show
initial: [
{
type: "subject",
},
{
type: "gradeLevel",
},
{
type: "maturity",
},
{
type: "language",
},
],
},
},
},
signingFunction: (url: string) =>
getUnsafeOauthSigningFunction({
launchUrl: url,
secretKey: config.appSecret,
}),
});