Closed ayubkidvento closed 1 month ago
Are you running this in a local development environment/web server? If so, everything you are seeing above is as-expected.
The pipwerks code is trying to find and connect to the API that a SCORM Learning Management System makes available to a SCORM course when it is launched - so if you're not running this from a SCORM LMS there will be no API for the pipwerks wrapper to connect to.
In order for it to work properly you'll need to run it from an LMS such as SCORM Cloud or something that mimics the behaviour of an LMS. There's a good guide to testing SCORM content by @pipwerks here
Hi @moloko, thanks for the quick response. The scorm is in AWS S3. I'm fetching from there, and the React app runs locally. Is it necessary to put the scorm in SCORM CLOUD or will it also work if it is in AWS S3?
Sorry I'm not entirely clear on what it is you are trying to do here.. but it sounds a little bit to me like you have been given a SCORM 1.2 course and you are trying to build something that can load it and communicate with it.
The code in this repository is what you'd use if you were building a SCORM 1.2 course; it's not what you'd use for something that needs to be able to run that course and communicate with it.
If you are building something that needs to be able to run and communicate with a SCORM 1.2 course then what you want is probably something like this: https://github.com/jcputney/scorm-again
I would also suggest a deep dive into how SCORM works as it's a fairly esoteric and often complicated subject. There are some good resources here
@moloko Sorry for the inconvenience, I've got a scorm uploaded on AWS S3 bucket, I'm playing that scorm in React App. I want to implement resume functionality in the scorm so that if I'm coming back after watching half of the scorm, it will resume from the exact slide that I left earlier. For that I'm using the above config, but getting all those above errors.
@ayubkidvento you need to clarify whether you are trying to build a SCORM 1.2 course or build something that can load and run a SCORM 1.2 course
The code in this repository is a library you'd use if building a SCORM 1.2 course
If you want to be able to load and run a SCORM 1.2 course then you need something like https://github.com/jcputney/scorm-again
I'm trying to build something which can load & run the scorm.
OK so you are trying to build something that acts like a Learning Management System. The code in this repository is not going of any use to you whatsoever.
You need to use something like SCORM Again.
Hope this helps.
@moloko Thank you for your assistance. This helps a lot.
Thanks @moloko
Hello, I've got a scorm(scorm 1.2) that needs to be integrated with React app. I'm using pipwerks-scorm-api-wrapper to implement resume functionality in the scorm. As per the documentation, I've created a separate component. `import { useEffect } from "react"; import pipwerks from "pipwerks-scorm-api-wrapper";
const CourseComponent = () => { var scorm = pipwerks.SCORM;
useEffect(() => { scorm.version = "1.2"; scorm.init(); const suspendData = scorm.get("cmi.suspend_data"); const lessonLocation = scorm.get("cmi.core.lesson_location"); console.log(suspendData, lessonLocation); return () => { scorm.save(); scorm.quit(); }; }, []);
const saveProgress = (pageNumber, progressData) => { // Save the learner's progress in suspend_data scorm.set("cmi.suspend_data", JSON.stringify(progressData)); scorm.set("cmi.core.lesson_location", pageNumber); // Commit to ensure data is saved in LMS scorm.save(); };
return (
Course Content
); };
export default CourseComponent;`
When I render this component, I get the following in the console:
When I try to save the progress, I get the following:
Any sort of help would be highly appreciated. Thank you