Closed cahirodoherty-learningpool closed 10 months ago
When statement.attachments are set on xapi:preSendStatement, they aren't getting handled in processAttachments
xapi:preSendStatement
Create a course with xapi extension and a custom plugin that will add an 'attachments' array of objects to the xapi statement. Attachment objects should be of the form outlined here - https://www.npmjs.com/package/xapiwrapper/v/1.11.0#send-statement-with-attachments
Attachments will be processed correctly and not rejected by LRS on post
XAPI attachment is of incorrect format. POST request is rejected. This is due to never entering the if block https://github.com/adaptlearning/adapt-contrib-xapi/blob/master/js/XAPI.js#L1310-L1312 When attachments is set as null, attachments === undefined is falsey
attachments === undefined
Subject of the issue/enhancement/features
When statement.attachments are set on
xapi:preSendStatement
, they aren't getting handled in processAttachmentsYour environment
Steps to reproduce
Create a course with xapi extension and a custom plugin that will add an 'attachments' array of objects to the xapi statement. Attachment objects should be of the form outlined here - https://www.npmjs.com/package/xapiwrapper/v/1.11.0#send-statement-with-attachments
Expected behaviour
Attachments will be processed correctly and not rejected by LRS on post
Actual behaviour
XAPI attachment is of incorrect format. POST request is rejected. This is due to never entering the if block https://github.com/adaptlearning/adapt-contrib-xapi/blob/master/js/XAPI.js#L1310-L1312 When attachments is set as null,
attachments === undefined
is falsey