Use context and token in URL prefix

pull/22/head
Frode Petterson 2016-06-13 10:31:09 +02:00
parent 5e87aee63c
commit fca0537a4d
1 changed files with 2 additions and 9 deletions

View File

@ -1655,8 +1655,7 @@ H5P.setFinished = function (contentId, score, maxScore, time) {
maxScore: maxScore, maxScore: maxScore,
opened: toUnix(H5P.opened[contentId]), opened: toUnix(H5P.opened[contentId]),
finished: toUnix(new Date()), finished: toUnix(new Date()),
time: time, time: time
token: H5PIntegration.tokens.result
}); });
} }
}; };
@ -1800,14 +1799,8 @@ H5P.createTitle = function (rawTitle, maxLength) {
options.data = { options.data = {
data: (data === null ? 0 : data), data: (data === null ? 0 : data),
preload: (preload ? 1 : 0), preload: (preload ? 1 : 0),
invalidate: (invalidate ? 1 : 0), invalidate: (invalidate ? 1 : 0)
token: H5PIntegration.tokens.contentUserData
}; };
// Set editor context
if (H5PIntegration.editor && H5PIntegration.editor.uploadParams) {
options.data.contextId = H5PIntegration.editor.uploadParams.contextId;
}
} }
else { else {
options.type = 'GET'; options.type = 'GET';