Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

window.open(scormUrl) #39

Open
Tyre88 opened this issue Mar 3, 2021 · 6 comments
Open

window.open(scormUrl) #39

Tyre88 opened this issue Mar 3, 2021 · 6 comments

Comments

@Tyre88
Copy link

Tyre88 commented Mar 3, 2021

All SCORM reporting works fine when i just do location.href = scormUrl;
But when i use window.open(scormUrl) the reporting doesn't work. It is fetching the last data from the backend but it seems like something goes wrong when i do "loadFromJSON(response)" and the SCORM api doesn't get initialized.

Have anyone else experienced this issue and if so, did you solve it?

@dipakdas99
Copy link

Hi @Tyre88,
What is the scorm URL? Could you please guide me on that?
I am assuming you've uploaded an uncompressed zip file in the s3/cloud storage bucket is that right?
Thanks in advance!

@Tyre88
Copy link
Author

Tyre88 commented Apr 15, 2021

Hi @dipakdas99 I've solved the problem by proxying the SCORM course through ocelot gateway and as soon as there's no CORS everything works fine.

@dipakdas99
Copy link

I didn't quite understand. Actually, I am pretty new to SCORM. Could you please tell me the workflow?

@Tyre88
Copy link
Author

Tyre88 commented Apr 15, 2021

I created a upload function where i "injected" the simplify-scorm js into the index.html in the scorm education and then injected a wrapper ontop of the simplify-scorm to call my server to take care of the logging of the status from the SCORM, all worked fine untill i wanted to open in a new window instead of the same window (it had CORS all the time) so i am not quite sure what was the problem.

The main problem seemd to be that the SCORM.initialize didn't run and therefore no data was logged.

@dipakdas99
Copy link

dipakdas99 commented Apr 15, 2021

Thanks for sharing this!

`

STAART
<iframe src="" style="border:0px #ffffff none;" id="iframescorm" name="myiFrame" scrolling="no" frameborder="1" marginheight="0px" marginwidth="0px" height="650px" width="100%" type="text/html" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen" mozallowfullscreen="mozallowfullscreen"></iframe>

<script src="../../Downloads/scormAPI.js"></script>

<script>
var scorm = {};
scorm.url = '/Users/dasdipak99/Desktop/synapse-scorm.zip';
scorm.student_id = '123';
scorm.student_name = 'Dipak';

scorm.start = () => {
    window.API.cmi.core.student_id = scorm.student_id;
    window.API.apiLogLevel = 4;
    document.getElementById("iframescorm").setAttribute("src", scorm.url);
}
</script>`

I used the above to run scorm on the browser. Copied code from @fabmesto's question( #40 ) for POC. Am I doing anything wrong here?

@vivaneo
Copy link

vivaneo commented Dec 26, 2023

Good morning,

I tried the different code examples to inject a scorm .zip file but it doesn't work.

The file downloads instead of starting playback.

Do you have sample code ready to work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants