-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously uncommitted amends for #3.
Allows xAPI in Curatr which is a hybrid of ADL Launch and Rustici Launch logic.
- Loading branch information
1 parent
ac6af9e
commit 93d3486
Showing
6 changed files
with
189 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<!--[if IE]><![endif]--> | ||
<!doctype html> | ||
<!--[if IE 7 ]><html id="adapt" class="ie ie7 no-js" lang="en"><![endif]--> | ||
<!--[if IE 8 ]><html id="adapt" class="ie ie8 no-js" lang="en"><![endif]--> | ||
<!--[if IE 9 ]><html id="adapt" class="ie ie9 no-js" lang="en"><![endif]--> | ||
<!--[if gt IE 9]><!--><html id="adapt" class="no-js" lang="en"><!--<![endif]--> | ||
<head> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
<title></title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> | ||
<script src="libraries/jquery.min.js"></script> | ||
<script type="text/javascript"> | ||
$.ajax({ | ||
type: "POST", | ||
beforeSend: function(request) { | ||
request.setRequestHeader("Content-Type", "application/json"); | ||
request.setRequestHeader("Authorization", getLauncherAuth()); | ||
}, | ||
url: getLauncherURL(), | ||
data: getData(), | ||
processData: false, | ||
success: function(msg) { | ||
window.location = 'index.html?xAPILaunchService=' + getLauncherEndpoint() + '&xAPILaunchKey=' + encodeURIComponent(msg.key); | ||
} | ||
}); | ||
|
||
function generateSessionID() { | ||
return Math.random().toString(36).substr(2, 9); | ||
} | ||
|
||
function getLauncherURL() { | ||
var url = "https://launcher.learninglocker.net/session/" + generateSessionID() + "/launch"; | ||
|
||
return url; | ||
} | ||
|
||
function getLauncherAuth() { | ||
// "Basic " + toBase64('username:password'); | ||
var auth = ""; | ||
|
||
return auth; | ||
} | ||
|
||
function getLauncherEndpoint() { | ||
var endpoint = "https://launcher.learninglocker.net/content/"; | ||
|
||
return encodeURIComponent(endpoint); | ||
} | ||
|
||
function getData() { | ||
var data = { | ||
statement: { | ||
actor: { | ||
mbox: "mailto:username@domain.com", | ||
name: "Test User" | ||
}, | ||
context: { | ||
contextActivities: { | ||
grouping: [ | ||
{ | ||
objectType: "Activity", | ||
id: "http://example.com/course_identifier", | ||
definition: { | ||
name: { | ||
en: "Test Course" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
ttl: 10 | ||
}; | ||
|
||
return JSON.stringify(data); | ||
} | ||
</script> | ||
</head> | ||
|
||
<body> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!--[if IE]><![endif]--> | ||
<!doctype html> | ||
<!--[if IE 7 ]><html id="adapt" class="ie ie7 no-js" lang="en"><![endif]--> | ||
<!--[if IE 8 ]><html id="adapt" class="ie ie8 no-js" lang="en"><![endif]--> | ||
<!--[if IE 9 ]><html id="adapt" class="ie ie9 no-js" lang="en"><![endif]--> | ||
<!--[if gt IE 9]><!--><html id="adapt" class="no-js" lang="en"><!--<![endif]--> | ||
<head> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
<title></title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> | ||
<script src="libraries/jquery.min.js"></script> | ||
<script type="text/javascript"> | ||
window.location = 'index.html?endpoint=' + getLRSEndpoint() + '&actor=' + getActor() + '&auth=' + getAuth(); | ||
|
||
function getLRSEndpoint() { | ||
var endpoint = "https://saas.learninglocker.net/data/xAPI/"; | ||
|
||
return encodeURIComponent(endpoint); | ||
} | ||
|
||
function getActor() { | ||
var actor = { | ||
mbox: "mailto:username@domain.com", | ||
name: "Test User" | ||
}; | ||
|
||
return JSON.stringify(actor); | ||
} | ||
|
||
function getAuth() { | ||
// "Basic " + toBase64('username:password'); | ||
var auth = ""; | ||
|
||
return auth; | ||
} | ||
</script> | ||
</head> | ||
|
||
<body> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<tincan xmlns="http://projecttincan.com/tincan.xsd"> | ||
<activities> | ||
<activity id="@@config._xapi._activityId" type="http://adlnet.gov/expapi/activities/course"> | ||
<name><![CDATA[@@course.title]]></name> | ||
<description lang="en"><![CDATA[@@course.description]]></description> | ||
<launch lang="en">index.html</launch> | ||
</activity> | ||
</activities> | ||
</tincan> |