Mercurial > hg > webaudioevaluationtool
comparison js/core.js @ 2872:97a52e326464
Merge branch 'master' into vnext
author | Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk> |
---|---|
date | Tue, 09 May 2017 16:11:11 +0100 |
parents | 0228ab1777d9 cf1a3a529177 |
children | 033027759cf7 |
comparison
equal
deleted
inserted
replaced
2870:0228ab1777d9 | 2872:97a52e326464 |
---|---|
3331 } | 3331 } |
3332 interfaceContext.lightbox.post("Error", str); | 3332 interfaceContext.lightbox.post("Error", str); |
3333 } | 3333 } |
3334 return state; | 3334 return state; |
3335 }; | 3335 }; |
3336 this.checkFragmentMinPlays = function () { | |
3337 var failedObjects = audioEngineContext.audioObjects.filter(function (a) { | |
3338 var minPlays = a.specification.minNumberPlays || a.specification.parent.minNumberPlays || specification.minNumberPlays; | |
3339 if (minPlays === undefined || a.numberOfPlays >= minPlays) { | |
3340 return false; | |
3341 } | |
3342 return true; | |
3343 }); | |
3344 if (failedObjects.length === 0) { | |
3345 return true; | |
3346 } | |
3347 var failedString = []; | |
3348 failedObjects.forEach(function (a) { | |
3349 failedString.push(a.interfaceDOM.getPresentedId()); | |
3350 }); | |
3351 var str = "You have not played fragments " + failedString.join(", ") + " enough. Please keep listening"; | |
3352 interfaceContext.lightbox.post("Message", str); | |
3353 this.storeErrorNode(str); | |
3354 return false; | |
3355 }; | |
3356 | |
3336 | 3357 |
3337 this.sortFragmentsByScore = function () { | 3358 this.sortFragmentsByScore = function () { |
3338 var elements = audioEngineContext.audioObjects.filter(function (elem) { | 3359 var elements = audioEngineContext.audioObjects.filter(function (elem) { |
3339 return elem.specification.type !== "outside-reference"; | 3360 return elem.specification.type !== "outside-reference"; |
3340 }); | 3361 }); |