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

GetLastError function does not return the right error code #48

Open
mbabayev-coursera opened this issue Oct 16, 2023 · 0 comments
Open

Comments

@mbabayev-coursera
Copy link

mbabayev-coursera commented Oct 16, 2023

Hi, I noticed a couple issues with GetLastError implementation when I was playing around with this library. Although, let me know if this is intentional and I misunderstood the SCORM spec in some way.


First issue is specific to SCORM 1.2:

  1. Call Initialize()
  2. Call SetValue("cmi.core.student_name", "asd") (or any other read only value) -> 403 error as expected
  3. Call GetLastError() -> error code 0 returned

I believe this is because there is a check missing for lastErrorCode != 0, which 2004 implementation has, here: https://github.com/gabrieldoty/simplify-scorm/blob/master/src/scormAPI.js#L223C16-L223C16


Second issue happens in both 1.2 and 2004:

  1. Do NOT call Initialize()
  2. Call SetValue("cmi.core.student_name", "asd") (or any other value, it doesn't matter) -> 301 error as expected
  3. Call GetLastError() -> error code 0 returned

I haven't dug around in the code as to why this happens.

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

1 participant