Check that score is a number before storing it to the database.

HFP-173

(cherry picked from commit bae3145)
pull/31/head 1.10.0
thomasmars 2016-10-28 13:45:11 +02:00
parent b4949c0d83
commit 426f51caa0
1 changed files with 1 additions and 1 deletions

View File

@ -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.
*