Added users stats function: setFinished.

namespaces
Frode Petterson 2013-09-18 15:52:06 +02:00
parent 4d319b3424
commit d633697065
1 changed files with 13 additions and 0 deletions

View File

@ -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) {