# HG changeset patch # User Nicholas Jillings # Date 1457626576 0 # Node ID 640ffb822da1ce50735591483ace9e03ed85f3e3 # Parent 6531e3903ea17d8d98d5a54d946c4b864717e963 Bug #1652 and Feature #1650 fixes. You can specify the track labels through page attribute 'label' ('default', 'none', 'number', 'letter', 'capital'). Updated examples to match schema diff -r 6531e3903ea1 -r 640ffb822da1 core.js --- a/core.js Thu Mar 10 15:33:39 2016 +0000 +++ b/core.js Thu Mar 10 16:16:16 2016 +0000 @@ -2180,6 +2180,7 @@ this.showElementComments = undefined; this.outsideReference = null; this.loudness = null; + this.label = null; this.preTest = null; this.postTest = null; this.interfaces = []; diff -r 6531e3903ea1 -r 640ffb822da1 example_eval/AB_example.xml --- a/example_eval/AB_example.xml Thu Mar 10 15:33:39 2016 +0000 +++ b/example_eval/AB_example.xml Thu Mar 10 16:16:16 2016 +0000 @@ -13,7 +13,7 @@ - + This is an example of an 'AB'-style test, with two pages, using the test stimuli in 'example_eval/'. @@ -31,7 +31,7 @@ - + Thank you for taking this listening test. Please click 'submit' and your results will appear in the 'saves/' folder. @@ -60,7 +60,7 @@ - + A two way comparison using randomised element order, automatic loudness and synchronised looping. @@ -83,7 +83,7 @@ - + A 7 way comparison using randomised element order and synchronised looping. diff -r 6531e3903ea1 -r 640ffb822da1 example_eval/mushra_example.xml --- a/example_eval/mushra_example.xml Thu Mar 10 15:33:39 2016 +0000 +++ b/example_eval/mushra_example.xml Thu Mar 10 16:16:16 2016 +0000 @@ -13,7 +13,7 @@ - + This is an example of an 'APE'-style test, with two pages, using the test stimuli in 'example_eval/'. @@ -31,7 +31,7 @@ - + Thank you for taking this listening test. Please click 'submit' and your results will appear in the 'saves/' folder. @@ -71,7 +71,7 @@ - + Example of a 'MUSHRA' style interface with hidden anchor 'zero' (which needs to be below 20%), looping of the samples, randomisation of marker labels, mandatory moving of every sample, and a forced scale usage of at least 25%-75% using a Comparison Category Rating Scale. @@ -118,7 +118,7 @@ - + Example of a 'MUSHRA' style interface with hidden anchor 'zero' (which needs to be below 20%), looping of the samples, randomisation of marker labels, mandatory moving of every sample, and a forced scale usage of at least 25%-75%. diff -r 6531e3903ea1 -r 640ffb822da1 example_eval/project.xml --- a/example_eval/project.xml Thu Mar 10 15:33:39 2016 +0000 +++ b/example_eval/project.xml Thu Mar 10 16:16:16 2016 +0000 @@ -86,7 +86,7 @@ - + Comment on fragment Example Test Question diff -r 6531e3903ea1 -r 640ffb822da1 interfaces/AB.js --- a/interfaces/AB.js Thu Mar 10 15:33:39 2016 +0000 +++ b/interfaces/AB.js Thu Mar 10 16:16:16 2016 +0000 @@ -308,7 +308,22 @@ console.log("WARNING - AB cannot have fixed reference"); } var audioObject = audioEngineContext.newTrack(element); - var node = new this.comparatorBox(audioObject,index,String.fromCharCode(65 + index)); + var label; + switch(audioObject.specification.parent.label) { + case "none": + label = ""; + break; + case "number": + label = ""+index; + break; + case "letter": + label = String.fromCharCode(97 + index); + break; + default: + label = String.fromCharCode(65 + index); + break; + } + var node = new this.comparatorBox(audioObject,index,label); audioObject.bindInterface(node); this.comparators.push(node); this.boxHolders.appendChild(node.box); diff -r 6531e3903ea1 -r 640ffb822da1 interfaces/ape.js --- a/interfaces/ape.js Thu Mar 10 15:33:39 2016 +0000 +++ b/interfaces/ape.js Thu Mar 10 16:16:16 2016 +0000 @@ -239,7 +239,7 @@ }; // Create Submit (save) button var submit = document.createElement("button"); - submit.innerHTML = 'Submit'; + submit.innerHTML = 'Next'; submit.onclick = buttonSubmitClick; submit.id = 'submit-button'; // Append the interface buttons into the interfaceButtons object. @@ -535,7 +535,22 @@ this.canvas.appendChild(trackObj); this.sliders.push(trackObj); this.metrics.push(new metricTracker(this)); - trackObj.innerHTML = ''+(this.metrics.length-1)+''; + var label = document.createElement("label"); + switch(audioObject.specification.parent.label) { + case "letter": + label.textContent = String.fromCharCode(97 + this.metrics.length-1); + break; + case "capital": + label.textContent = String.fromCharCode(65 + this.metrics.length-1); + break; + case "none": + label.textContent = ""; + break; + default: + label.textContent = ""+this.metrics.length; + break; + } + trackObj.appendChild(label); this.metrics[this.metrics.length-1].initialise(convSliderPosToRate(trackObj)); return trackObj; }; diff -r 6531e3903ea1 -r 640ffb822da1 interfaces/discrete.js --- a/interfaces/discrete.js Thu Mar 10 15:33:39 2016 +0000 +++ b/interfaces/discrete.js Thu Mar 10 16:16:16 2016 +0000 @@ -55,7 +55,7 @@ }; // Create Submit (save) button var submit = document.createElement("button"); - submit.innerHTML = 'Submit'; + submit.innerHTML = 'Next'; submit.onclick = buttonSubmitClick; submit.id = 'submit-button'; submit.style.float = 'left'; @@ -184,7 +184,7 @@ }); // Find all the audioElements from the audioHolder - var label = 0; + var index = 0; var interfaceScales = testState.currentStateMap.interfaces[0].scales; $(page.audioElements).each(function(index,element){ // Find URL of track @@ -198,11 +198,25 @@ audioObject.bindInterface(orNode); } else { // Create a slider per track + switch(audioObject.specification.parent.label) { + case "none": + label = ""; + break; + case "letter": + label = String.fromCharCode(97 + index); + break; + case "capital": + label = String.fromCharCode(65 + index); + break; + default: + label = ""+index; + break; + } var sliderObj = new discreteObject(audioObject,label,interfaceScales); sliderBox.appendChild(sliderObj.holder); audioObject.bindInterface(sliderObj); interfaceContext.commentBoxes.createCommentBox(audioObject); - label += 1; + index += 1; } }); diff -r 6531e3903ea1 -r 640ffb822da1 interfaces/horizontal-sliders.js --- a/interfaces/horizontal-sliders.js Thu Mar 10 15:33:39 2016 +0000 +++ b/interfaces/horizontal-sliders.js Thu Mar 10 16:16:16 2016 +0000 @@ -55,7 +55,7 @@ }; // Create Submit (save) button var submit = document.createElement("button"); - submit.innerHTML = 'Submit'; + submit.innerHTML = 'Next'; submit.onclick = buttonSubmitClick; submit.id = 'submit-button'; submit.style.float = 'left'; @@ -185,7 +185,7 @@ }); // Find all the audioElements from the audioHolder - var label = 0; + var index = 0; $(page.audioElements).each(function(index,element){ // Find URL of track // In this jQuery loop, variable 'this' holds the current audioElement. @@ -198,6 +198,20 @@ audioObject.bindInterface(orNode); } else { // Create a slider per track + switch(audioObject.specification.parent.label) { + case "none": + label = ""; + break; + case "letter": + label = String.fromCharCode(97 + index); + break; + case "capital": + label = String.fromCharCode(65 + index); + break; + default: + label = ""+index; + break; + } var sliderObj = new sliderObject(audioObject,label); if (typeof page.initialPosition === "number") @@ -211,7 +225,7 @@ sliderBox.appendChild(sliderObj.holder); audioObject.bindInterface(sliderObj); interfaceContext.commentBoxes.createCommentBox(audioObject); - label += 1; + index += 1; } }); diff -r 6531e3903ea1 -r 640ffb822da1 interfaces/mushra.js --- a/interfaces/mushra.js Thu Mar 10 15:33:39 2016 +0000 +++ b/interfaces/mushra.js Thu Mar 10 16:16:16 2016 +0000 @@ -61,7 +61,7 @@ }; // Create Submit (save) button var submit = document.createElement("button"); - submit.innerHTML = 'Submit'; + submit.innerHTML = 'Next'; submit.onclick = buttonSubmitClick; submit.id = 'submit-button'; submit.style.float = 'left'; @@ -183,7 +183,7 @@ currentTestHolder.repeatCount = audioHolderObject.repeatCount; // Find all the audioElements from the audioHolder - var label = 0; + var index = 0; $(audioHolderObject.audioElements).each(function(index,element){ // Find URL of track // In this jQuery loop, variable 'this' holds the current audioElement. @@ -196,6 +196,20 @@ audioObject.bindInterface(orNode); } else { // Create a slider per track + switch(audioObject.specification.parent.label) { + case "none": + label = ""; + break; + case "letter": + label = String.fromCharCode(97 + index); + break; + case "capital": + label = String.fromCharCode(65 + index); + break; + default: + label = ""+index; + break; + } var sliderObj = new sliderObject(audioObject,label); if (typeof audioHolderObject.initialPosition === "number") @@ -209,7 +223,7 @@ sliderBox.appendChild(sliderObj.holder); audioObject.bindInterface(sliderObj); interfaceContext.commentBoxes.createCommentBox(audioObject); - label += 1; + index += 1; } }); diff -r 6531e3903ea1 -r 640ffb822da1 test-schema.xsd --- a/test-schema.xsd Thu Mar 10 15:33:39 2016 +0000 +++ b/test-schema.xsd Thu Mar 10 16:16:16 2016 +0000 @@ -53,6 +53,17 @@ + + + + + + + + + + +