Mercurial > hg > webaudioevaluationtool
changeset 2259:16b74cc55286
Merge branch 'master' of https://github.com/BrechtDeMan/WebAudioEvaluationTool
author | www-data <www-data@sucuk.dcs.qmul.ac.uk> |
---|---|
date | Tue, 19 Apr 2016 18:21:03 +0100 |
parents | 4fe7b04dc3fa (current diff) 90fd43dee199 (diff) |
children | 2bb73e3e4bbb |
files | |
diffstat | 2 files changed, 26 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/js/core.js Tue Apr 19 17:21:02 2016 +0100 +++ b/js/core.js Tue Apr 19 18:21:03 2016 +0100 @@ -2691,7 +2691,7 @@ if (passed == false) { check_pass = false; - console.log("Continue listening to track-"+object.interfaceDOM.getPresentedId()+1); + console.log("Continue listening to track-"+object.interfaceDOM.getPresentedId()); error_obj.push(object.interfaceDOM.getPresentedId()); } } @@ -2720,7 +2720,7 @@ { if(ao.metric.wasMoved == false && ao.interfaceDOM.canMove() == true) { - failed.push(ao.interfaceDOM.getPresentedId()+1); + failed.push(ao.interfaceDOM.getPresentedId()); } } if (failed.length == 0) @@ -2751,7 +2751,7 @@ { if(ao.metric.wasListenedTo == false) { - failed.push(ao.interfaceDOM.getPresentedId()+1); + failed.push(ao.interfaceDOM.getPresentedId()); } } if (failed.length == 0)
--- a/js/specification.js Tue Apr 19 17:21:02 2016 +0100 +++ b/js/specification.js Tue Apr 19 18:21:03 2016 +0100 @@ -107,20 +107,25 @@ for (var i in survey) { if (isNaN(Number(i)) == true){break;} var location = survey[i].getAttribute('location'); - if (location == 'pre' || location == 'before') - { - if (this.preTest != null){this.errors.push("Already a pre/before test survey defined! Ignoring second!!");} - else { - this.preTest = new this.surveyNode(this); - this.preTest.decode(this,survey[i]); - } - } else if (location == 'post' || location == 'after') { - if (this.postTest != null){this.errors.push("Already a post/after test survey defined! Ignoring second!!");} - else { - this.postTest = new this.surveyNode(this); - this.postTest.decode(this,survey[i]); - } - } + switch(location) + { + case 'pre': + case 'before': + if (this.preTest != null){console.log("Already a pre/before test survey defined! Ignoring second!!");} + else { + this.preTest = new this.surveyNode(this); + this.preTest.decode(this,survey[i]); + } + break; + case 'post': + case 'after': + if (this.postTest != null){console.log("Already a post/after test survey defined! Ignoring second!!");} + else { + this.postTest = new this.surveyNode(this); + this.postTest.decode(this,survey[i]); + } + break; + } } var interfaceNode = setupNode.getElementsByTagName('interface'); @@ -294,6 +299,10 @@ node.decode(parent,xml.children[i]); this.options.push(node); } + if (this.options.length == 0) { + console.log("Empty survey node"); + console.log(this); + } }; this.encode = function(doc) { var node = doc.createElement('survey');