Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

The openAssessmentIframe JavaScript function returns HTML that can be rendered in an iFrame to allow users to perform assessments.

...

Info


Argument
Value
Example
User-Agent<company identifier>The exact value here is not important, but it should include something to identify your company.
Accept-LanguageThe language localeThis is the locale to display the UI in; the locale of the assessment is determined by the Learner's locale (See /1/purchase - POST).
Sign In Token<your bearer token>

The token received from a call to /1/signin - GET

X-SystemDomain<the system domain>vbmapp
X-LearnerId<the learner id>The DMTD-supplied identifier that identifies the learner (see REST API Guide)
X-LearnerCode<the learner code>A REST-client-supplied identifier that identifies the learner (see REST API Guide)
JavaScript Element
The HTML DOM element under which to host the iFrame


...

Info
titleExample
<!DOCTYPE html>
<html>
<head>
<script src="https://api-sandbox.datamtd[staging|www].vbmappapp.com/javascripts/iframe_support.js"></script>
<script type="text/javascript">
window.onload = function() {
openAssessmentIframe(
'datamtd<your user agent key>', // User-Agent
'en', // Accept-Language
'a<a sign in tokentoken>', // Sign in token
'vbmapp', // X-SystemDomain
42, // X-LearnerId
null, // X-LearnerCode
document.getElementById('mount-point') // The mount point for the iFrame in this document
)
}
</script>
</head>
<body>
<h1>Welcome to VB-MAPP!</h1>
<div id="mount-point">
</div>
</body>
</html>

...