Added users stats function: setFinished.
parent
4d319b3424
commit
d633697065
13
js/h5p.js
13
js/h5p.js
|
@ -303,6 +303,19 @@ H5P.shuffleArray = function(array) {
|
|||
return array;
|
||||
};
|
||||
|
||||
/**
|
||||
* Post finished results for user.
|
||||
*
|
||||
* @param {Number} contentId
|
||||
* @param {Number} points
|
||||
* @param {Number} maxPoints
|
||||
*/
|
||||
H5P.setFinished = function (contentId, points, maxPoints) {
|
||||
if (H5P.postUserStatistics === true) {
|
||||
H5P.jQuery.post(H5P.ajaxPath + 'setFinished', {contentId: contentId, points: points, maxPoints: maxPoints});
|
||||
}
|
||||
};
|
||||
|
||||
// Add indexOf to browsers that lack them. (IEs)
|
||||
if(!Array.prototype.indexOf) {
|
||||
Array.prototype.indexOf = function(needle) {
|
||||
|
|
Loading…
Reference in New Issue