adlnet / xAPIWrapper

Wrapper to simplify communication to an LRS
https://adlnet.gov/projects/xapi/
Apache License 2.0
219 stars 114 forks source link

Added server-side node compatibility #123

Closed oliverfoster closed 5 years ago

oliverfoster commented 5 years ago

67

Works

Notes

vbhayden commented 5 years ago

Tracking, but a PR of this scale is going to take a bit to move forward. While I get the interest in having an NPM module with xAPI-everything included, it feels like this would make curation pretty muddy.

Will review this in the next week or so.

oliverfoster commented 5 years ago

Let me know once you've reviewed it.

oliverfoster commented 5 years ago

Just checking in. Any thoughts on this?

vbhayden commented 5 years ago

Ok, going to look at this today. Do you have a sample app.js file or something to show it working that I could use as a starting place?

oliverfoster commented 5 years ago

I was using the tests to do that.

This file can be run using $ mocha test/tests/test.xapiwrapper.js https://github.com/adlnet/xAPIWrapper/blob/29154f51be1c0df8753923116100f66fdecf1a4e/test/tests/test.xapiwrapper.js

This one to get the above text running in the browser: https://github.com/adlnet/xAPIWrapper/blob/29154f51be1c0df8753923116100f66fdecf1a4e/test/textXAPIWrapper.html

It demonstrates the xapiwrapper.min.js statement, verbs, activity etc api working in both node and the browser. Launch doesn't work in node. It'll give an error. ADL.launch()

vbhayden commented 5 years ago

Simple examples seem to run, will look more at it later. 👍

In the meantime, it doesn't produce intellisense and we'll probably need to have more rigorous tests with more complex statement varieties.

oliverfoster commented 5 years ago

Yup, totally agree.

Do you have any suggestions for statement varieties?

For the intellisense I reckon it'd be easiest to produce a non-minified but compiled version with comments intact. I will have a look to see if we can just import the uncompiled source files instead though. Irritatingly the ADL object transcends multiple files but hopefully the code is segregated enough to allow that to happen without one file needing references to code in another. I don't know if it's preferable to use the uncompiled source directly? Any thoughts?

oliverfoster commented 5 years ago

Closed in favour of https://github.com/adlnet/xAPIWrapper/pull/126 : with intellisense and a few of the more complex bits removed.