-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4818931
commit b419e1e
Showing
1,364 changed files
with
622,840 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// SCORM API Wrapper | ||
var findAPITries = 0; | ||
var API = null; | ||
|
||
function findAPI(win) { | ||
while ((win.API == null) && (win.parent != null) && (win.parent != win)) { | ||
findAPITries++; | ||
if (findAPITries > 7) { | ||
return null; | ||
} | ||
win = win.parent; | ||
} | ||
return win.API; | ||
} | ||
|
||
function getAPI() { | ||
var theAPI = findAPI(window); | ||
if ((theAPI == null) && (window.opener != null) && (typeof(window.opener) != "undefined")) { | ||
theAPI = findAPI(window.opener); | ||
} | ||
if (theAPI == null) { | ||
alert("Unable to find an API adapter"); | ||
} | ||
return theAPI; | ||
} | ||
|
||
function initializeAPI() { | ||
API = getAPI(); | ||
if (API != null) { | ||
API.LMSInitialize(""); | ||
} | ||
} | ||
|
||
function terminateAPI() { | ||
if (API != null) { | ||
API.LMSFinish(""); | ||
} | ||
} | ||
|
||
function setProgress(progress) { | ||
if (API != null) { | ||
API.LMSSetValue("cmi.core.lesson_status", progress); | ||
API.LMSCommit(""); | ||
} | ||
} | ||
|
||
function setSuspendData(data) { | ||
if (API != null) { | ||
API.LMSSetValue("cmi.suspend_data", data); | ||
API.LMSCommit(""); | ||
} | ||
} | ||
|
||
function getSuspendData() { | ||
if (API != null) { | ||
return API.LMSGetValue("cmi.suspend_data"); | ||
} | ||
return ""; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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 @@ | ||
372 |
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 @@ | ||
its-ChaTTy/PyZombis |
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,62 @@ | ||
// SCORM Functions | ||
|
||
function loadPage() { | ||
initializeAPI(); | ||
console.log("SCORM API initialized."); | ||
} | ||
|
||
function unloadPage() { | ||
saveTextBoxData(); // Save data when the page is unloaded | ||
terminateAPI(); | ||
console.log("SCORM API terminated."); | ||
} | ||
|
||
function loadChapter(chapter) { | ||
loadPage(); | ||
|
||
var suspendData = getSuspendData(); | ||
if (suspendData) { | ||
console.log("Suspend data retrieved:", suspendData); | ||
// Restore the text data in the textbox | ||
document.getElementById("chapter-textbox").value = suspendData; | ||
} | ||
|
||
var completionStatus = API.LMSGetValue("cmi.core.lesson_status"); | ||
|
||
if (completionStatus === "completed") { | ||
document.getElementById("completion-status").innerText = "This chapter has been completed."; | ||
document.getElementById("complete-button").style.display = "none"; | ||
} else { | ||
document.getElementById("completion-status").innerText = "This chapter has not been completed."; | ||
document.getElementById("reset-button").style.display = "none"; | ||
} | ||
} | ||
|
||
function completeChapter(chapter) { | ||
setProgress("completed"); | ||
alert(chapter + " completed! Progress recorded."); | ||
document.getElementById("completion-status").innerText = "This chapter has been completed."; | ||
document.getElementById("complete-button").style.display = "none"; | ||
document.getElementById("reset-button").style.display = "block"; | ||
|
||
// Optionally save some suspend data when the chapter is completed | ||
setSuspendData(document.getElementById("chapter-textbox").value); | ||
} | ||
|
||
function resetChapter(chapter) { | ||
setProgress("incomplete"); | ||
alert(chapter + " reset to incomplete."); | ||
document.getElementById("completion-status").innerText = "This chapter has not been completed."; | ||
document.getElementById("complete-button").style.display = "block"; | ||
document.getElementById("reset-button").style.display = "none"; | ||
|
||
// Clear the suspend data if the chapter is reset | ||
setSuspendData(""); | ||
document.getElementById("chapter-textbox").value = ""; // Clear the textbox as well | ||
} | ||
|
||
function saveTextBoxData() { | ||
// Save the current state of the textbox into suspend data | ||
var textBoxData = document.getElementById("chapter-textbox").value; | ||
setSuspendData(textBoxData); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.