Check instanceof score as well to validate number.

HFP-215
pull/27/head
thomasmars 2016-11-19 12:29:38 +01:00
parent 3278535a04
commit 9b0d77a721
1 changed files with 2 additions and 1 deletions

View File

@ -1637,7 +1637,8 @@ H5P.shuffleArray = function (array) {
* Reported time consumption/usage
*/
H5P.setFinished = function (contentId, score, maxScore, time) {
if (typeof score === 'number' && H5PIntegration.postUserStatistics === true) {
var validScore = typeof score === 'number' || score instanceof Number;
if (validScore && H5PIntegration.postUserStatistics === true) {
/**
* Return unix timestamp for the given JS Date.
*