From bae31451c0a1f49835ca4a1351f90e86581e9f06 Mon Sep 17 00:00:00 2001 From: thomasmars Date: Fri, 28 Oct 2016 13:45:11 +0200 Subject: [PATCH] Check that score is a number before storing it to the database. HFP-173 --- js/h5p.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/h5p.js b/js/h5p.js index 65ec2e1..e6b4555 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -1637,7 +1637,7 @@ H5P.shuffleArray = function (array) { * Reported time consumption/usage */ H5P.setFinished = function (contentId, score, maxScore, time) { - if (score && H5PIntegration.postUserStatistics === true) { + if (typeof score === 'number' && H5PIntegration.postUserStatistics === true) { /** * Return unix timestamp for the given JS Date. *