I'm rolling my own (very simple) xapi endpoint and trying to get a course that uses this plugin to work. It's failing on the initial get state call. The xapi response to a get request to the activities/state endpoint when the state doesn't exist is a 404 with no body. The code here seems to be assuming the objects passed to the callback function are error and the xhr object, respectively. But, as far as I can tell, the xapiwrapper function passes the xhr object and the response... As the xhr object is always there, it seems the code block I've linked to always evaluates to true, which would appear to be incorrect, unless I've misunderstood something - I think that's why the course is failing to initialise? That being said, this comment appears to contradict my thinking, so I'm not sure how to proceed.
Your environment
5.31.7
Steps to reproduce
Create new course
Add xapi plugin and configure for xapi endpoint that replies with a 404 to the activities/state path if no state is found.
Publish course.
Browse to the course.
Expected behaviour
I would expect the 404 to be handled gracefully and for the course to post a 'virgin' state object
Subject of the issue/enhancement/features
I'm rolling my own (very simple) xapi endpoint and trying to get a course that uses this plugin to work. It's failing on the initial get state call. The xapi response to a get request to the activities/state endpoint when the state doesn't exist is a 404 with no body. The code here seems to be assuming the objects passed to the callback function are
error
and thexhr
object, respectively. But, as far as I can tell, the xapiwrapper function passes the xhr object and the response... As the xhr object is always there, it seems the code block I've linked to always evaluates to true, which would appear to be incorrect, unless I've misunderstood something - I think that's why the course is failing to initialise? That being said, this comment appears to contradict my thinking, so I'm not sure how to proceed.Your environment
5.31.7
Steps to reproduce
Expected behaviour
I would expect the 404 to be handled gracefully and for the course to post a 'virgin' state object
Actual behaviour
The GET method fails and the course hangs.
Screenshots (if you can)