Closed ryanrolds closed 6 years ago
Hey Ryan thanks for the info. Yes it'd be great if you could make a pull request using this new functionality. Thanks!
Rather then make this change I just had the xAPIWrapper not generate IDs for the statements. That way the LRS, which has a good PRNG/RNG, generates the UUIDs.
After generating about 5k statements across 40 devices (same model tablet) we encountered a id collision. JavaScript's
Math.random()
isn't that great of a PRNG and the Web Crypto API isn't widely supported yet. It may be better to use a v3/v5 UUID (hash versions) and use actor id + course id + activity + timestamp to produce UUIDs that are less likely to collide in this context.If you're OK switching to v3 or v5 I'm happy to do the work.