adaptlearning / adapt-contrib-xapi

TinCan/xAPI extension for the Adapt Framework
GNU General Public License v3.0
12 stars 28 forks source link

Question: Should xAPI be prevented from listening on any initialisation error #81

Closed dancgray closed 1 year ago

dancgray commented 4 years ago

If I'm reading the code correctly any error on initialisation prevents the event listeners being setup but allows the user to continue without any visible warning. The users progress would not be sent to the LRS. This seems far from ideal.

For example, on initialisation, if the LRS returns an HTTP error when xAPI requests the state the value for isInitialised is set to false. Which prevents the listeners being setup but with only a console warning.

My question is, should the user be given a more explicit warning that their progress will not be tracked and are all initialisation errors of equal importance for xAPI tracking?

brian-learningpool commented 4 years ago

Displaying a warning to the user under such circumstances is configurable. There's a _lrsFailureBehaviour configuration attribute. By default they should actually be shown.

See: https://github.com/adaptlearning/adapt-contrib-xapi/blob/master/properties.schema#L288-L310 https://github.com/adaptlearning/adapt-contrib-xapi/blob/master/js/adapt-contrib-xapi.js#L1579

dancgray commented 4 years ago

Thanks @brian-learningpool. I think something in our course must have been preventing/hiding that alert.

Is there any appetite for optionally making the warning none closable for initialisation failures only?

brian-learningpool commented 4 years ago

Hi @dancgray, I guess we could, but I would prefer it if this was tied to a new option of some kind, so we have something like:

dancgray commented 4 years ago

Thanks @brian-learningpool, that sounds ideal, adding the option to _lrsFailureBehaviour.

Also the way the error alert is setup at the moment (event with the notify _isCancellable set) it will get dismissed due to the wait timer.

Presumably I will have to trigger xAPI's showError after the page has loaded?

Apologies for the questions, I'm not that familiar with the wait process.

oliverfoster commented 1 year ago

closed as stale