Use context and token in URL prefix
parent
5e87aee63c
commit
fca0537a4d
11
js/h5p.js
11
js/h5p.js
|
@ -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';
|
||||||
|
|
Loading…
Reference in New Issue