Skip to content

Paging does not work with attachments #150

@tseabrooks

Description

@tseabrooks

TinCanJS/src/LRS.js

Lines 770 to 786 in 8733f14

else {
boundary = xhr.getResponseHeader("Content-Type").split("boundary=")[1];
parsedResponse = lrs._parseMultipart(boundary, xhr.response);
statements = JSON.parse(parsedResponse[0].body);
for (i = 1; i < parsedResponse.length; i += 1) {
attachmentMap[parsedResponse[i].headers["X-Experience-API-Hash"]] = parsedResponse[i].body;
}
lrs._assignAttachmentContent(statements.statements, attachmentMap);
result = new TinCan.StatementsResult({ statements: statements.statements });
for (i = 0; i < result.statements.length; i += 1) {
if (! (result.statements[i] instanceof TinCan.Statement)) {
result.statements[i] = new TinCan.Statement(result.statements[i]);
}
}

When turning on attachment support the more link in the StatementResult is always null. Issue is in linked lines above. Code should be modified to grab the more value from the parsed JSON when doing attachments.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions