JavaScript: openLearnersIframe
Overview
The openLearnersIframe JavaScript function returns HTML that can be rendered in an iFrame to allow users to select Learners and manage/perform assessments.
Beta API
NOTE: This API is currently in beta and applies only to the 'iFrame' API customers (see example below).
Function Arguments
Argument | Value | Example |
---|---|---|
User-Agent | <company identifier> | The exact value here is not important, but it should include something to identify your company. |
Accept-Language | The language locale | This 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 |
JavaScript Element | The HTML DOM element under which to host the iFrame |
Example
Example
<!DOCTYPE html>
<html>
<head>
<script src="https://[staging|www].vbmappap.com/javascripts/iframe_support.js"></script>
<script type="text/javascript">
window.onload = function() {
openLearnersIframe(
'<your user agent string>', // User-Agent
'en', // Accept-Language
'<a sign in token>', // Sign in token
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>
Response
<html>
<head>...</head>
<body>
<h1>Welcome to VB-MAPP!</h1>
<div id="mount-point>
<iframe> ... vb-mapp here </iframe>
</div>
</body>
</html>