dhodges47 / SCORM-LearningManagementSystem

Open Source SCORM Learning Management System demo
MIT License
145 stars 72 forks source link

SCORM2004 - CoreId always blank #5

Closed rscott78 closed 4 years ago

rscott78 commented 4 years ago

I've bumped into something with my SCORM2004 course. I created it using Articulate360, perhaps it's an issue on their end? Here's what I'm finding:

When Getvalue is called, the values such as sessionId, userId, coreId are passed in blank. This causes an issue in the visual studio side because it expects to see those, especially the coreId.

In looking through OutermostLMSV5.js, I found a comment that says // for SCORM 2004 it has to be API_1484_11

This led me to investigate the _LMSGetValue function around line 259. In there, it points at the API object and sends that. Here's the line:

var lmsInfo = JSON.stringify(createLMSInfo(API._sessionid, API._userid, API._coreid, API._scorm_course_id, API._sco_identifier, name));

At that point in the code, The API variables are all blank. However, API_1484_11 has values that are set correctly.

Is this simply a matter of it being a bug that needs addressed so that it uses the other API object instead? Or is it a configuration issue I have somewhere that's leading to this behavior?

dhodges47 commented 4 years ago

I don't know of any configuration property that would govern this. So it could very well be a bug that needs to be addressed. If you fix it, let me know.

On Tue, Dec 3, 2019 at 10:36 AM Ryan Scott notifications@github.com wrote:

I've bumped into something with my SCORM2004 course. I created it using Articulate360, perhaps it's an issue on their end? Here's what I'm finding:

When Getvalue is called, the values such as sessionId, userId, coreId are passed in blank. This causes an issue in the visual studio side because it expects to see those, especially the coreId.

In looking through OutermostLMSV5.js, I found a comment that says // for SCORM 2004 it has to be API_1484_11

This led me to investigate the _LMSGetValue function around line 259. In there, it points at the API object and sends that. Here's the line:

var lmsInfo = JSON.stringify(createLMSInfo(API._sessionid, API._userid, API._coreid, API._scorm_course_id, API._sco_identifier, name));

At that point in the code, The API variables are all blank. However, API_1484_11 has values that are set correctly.

Is this simply a matter of it being a bug that needs addressed so that it uses the other API object instead? Or is it a configuration issue I have somewhere that's leading to this behavior?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dhodges47/SCORM-LearningManagementSystem/issues/5?email_source=notifications&email_token=AAB5OFWBK5HTHQVRG5NMF6DQWZ4IZA5CNFSM4JU2A2D2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H5WYV6Q, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB5OFQVSLANEPWNFEJO3BTQWZ4IZANCNFSM4JU2A2DQ .

Myhindash commented 4 years ago

Hi, I was facing the same issue

The API object was always null, so I have saved that object in a new object called "lmsInfoInit" and replace it with the API object then it works with me

unzip the attached file and take the file "OutermostLMSV5.js" and replace it with yours (also take backup just in case) OutermostLMSV5.zip

dhodges47 commented 4 years ago

Thanks for your help. I figured out that the real problem was hard references to the API object. I replaced all instances of "API" to "this" and it should resolve the problem. See the latest commit ouf OutermostLMSV5.js.

obadakh66 commented 2 years ago

Hi, i tried both options and it still 0 , any other options ?