# HG changeset patch # User Nicholas Jillings # Date 1516192228 0 # Node ID 998e05c5769a732141a845a84c0ff1d9d778624f # Parent fc9718756d555c2e88409dd387afe1424cc3cea5 #171 Completed specification changes diff -r fc9718756d55 -r 998e05c5769a js/specification.js --- a/js/specification.js Tue Jan 16 16:11:35 2018 +0000 +++ b/js/specification.js Wed Jan 17 12:30:28 2018 +0000 @@ -12,7 +12,6 @@ this.poolSize = undefined; this.loudness = undefined; this.sampleRate = undefined; - this.calibration = undefined; this.crossFade = undefined; this.preSilence = undefined; this.postSilence = undefined; @@ -131,8 +130,9 @@ if (projectAttr !== null) { this[attributeName] = projectAttr; } - } + + this.calibration.decode(this, projectXML.getElementsByTagName('calibration')[0]); var exitTextNode = setupNode.getElementsByTagName('exitText'); if (exitTextNode.length == 1) { @@ -209,6 +209,7 @@ exitTextNode.textContent = this.exitText; setup.appendChild(exitTextNode); } + setup.appendChild(this.calibration.encode(RootDocument)); setup.appendChild(this.preTest.encode(RootDocument)); setup.appendChild(this.postTest.encode(RootDocument)); setup.appendChild(this.metrics.encode(RootDocument)); @@ -219,6 +220,83 @@ return RootDocument; }; + this.calibration = (function () { + var frequencies = false, + levels = false, + channels = false, + schema = undefined; + var Calibration = {}; + Object.defineProperties(Calibration, { + "parent": { + "value": this + }, + "schema": { + "get": function () { + return schema; + }, + "set": function (t) { + if (schema === undefined) { + schema = t; + } else { + throw ("Cannot set readonly"); + } + } + }, + "checkFrequencies": { + "get": function () { + return frequencies; + }, + "set": function (t) { + frequencies = (t === true); + } + }, + "checkLevels": { + "get": function () { + return levels; + }, + "set": function (t) { + levels = (t === true); + } + }, + "checkChannels": { + "get": function () { + return channels; + }, + "set": function (t) { + channels = (t === true); + } + }, + "encode": { + "value": function (doc) { + var node = doc.createElement("calibration"); + node.setAttribute("checkFrequencies", frequencies); + node.setAttribute("checkLevels", levels); + node.setAttribute("checkChannels", channels); + return node; + } + }, + "decode": { + "value": function (parent, xml) { + this.schema = schemaRoot.querySelector("[name=calibration]"); + var attributeMap = this.schema.querySelectorAll('attribute'), + i; + for (i in attributeMap) { + if (isNaN(Number(i)) === true) { + break; + } + var attributeName = attributeMap[i].getAttribute('name') || attributeMap[i].getAttribute('ref'); + var projectAttr = xml.getAttribute(attributeName); + projectAttr = processAttribute(projectAttr, attributeMap[i]); + if (projectAttr !== null) { + this[attributeName] = projectAttr; + } + } + } + } + }); + return Calibration; + })(); + function surveyNode(specification) { this.location = undefined; this.options = []; diff -r fc9718756d55 -r 998e05c5769a test_create.html --- a/test_create.html Tue Jan 16 16:11:35 2018 +0000 +++ b/test_create.html Wed Jan 17 12:30:28 2018 +0000 @@ -74,10 +74,6 @@ Fixed Sampling Rate: -
- Pre-Test audio calibration: - -
Global Cross-fade time: @@ -107,6 +103,23 @@

Test Completed Message

+
+

Pre-Test Calibrations

+
+
+ Check Frequency Response + +
+
+ Check Levels + +
+
+ Check Channels + +
+
+

Session Metrics

diff -r fc9718756d55 -r 998e05c5769a tests/examples/APE_example.xml --- a/tests/examples/APE_example.xml Tue Jan 16 16:11:35 2018 +0000 +++ b/tests/examples/APE_example.xml Wed Jan 17 12:30:28 2018 +0000 @@ -1,145 +1,146 @@ - - - - - Please enter your name. - - - - Please select with which activities you have any experience (example checkbox question) - - - - - - - - What instrument did you play? - - - This is an example of an 'APE'-style test, with two pages, using the test stimuli in 'example_eval/'. - - - - - Please enter your location. (example mandatory text question) - - - Please enter your age (example non-mandatory number question) - - - Please rate this interface (example radio button question) - - - - - - - Thank you for taking this listening test. Please click 'submit' and your results will appear in the 'saves/' folder. - - - - testTimer - elementTimer - elementInitialPosition - elementTracker - elementFlagListenedTo - elementFlagMoved - elementListenTracker - - - - - - - - - - - - Comment on fragment - - Preference - - Min - Max - Middle - 20 - - - - Depth - - Low - High - Middle - Middle - - - - - - - - - - Example of an 'APE' 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%. - - - - - Please enter the genre. - - - - - Comment on fragment - - Example Test Question - - Min - Max - Middle - 20 - - - - - - - - - - - - What is your general experience with numbers? - - - Please enter your overall preference - - - - - - - - Please describe the overall character - - - - - - - - - Example of an 'APE' 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%. - - - - - Please enter the genre. - - - - + + + + + + Please enter your name. + + + + Please select with which activities you have any experience (example checkbox question) + + + + + + + + What instrument did you play? + + + This is an example of an 'APE'-style test, with two pages, using the test stimuli in 'example_eval/'. + + + + + Please enter your location. (example mandatory text question) + + + Please enter your age (example non-mandatory number question) + + + Please rate this interface (example radio button question) + + + + + + + Thank you for taking this listening test. Please click 'submit' and your results will appear in the 'saves/' folder. + + + + testTimer + elementTimer + elementInitialPosition + elementTracker + elementFlagListenedTo + elementFlagMoved + elementListenTracker + + + + + + + + + + + + Comment on fragment + + Preference + + Min + Max + Middle + 20 + + + + Depth + + Low + High + Middle + Middle + + + + + + + + + + Example of an 'APE' 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%. + + + + + Please enter the genre. + + + + + Comment on fragment + + Example Test Question + + Min + Max + Middle + 20 + + + + + + + + + + + + What is your general experience with numbers? + + + Please enter your overall preference + + + + + + + + Please describe the overall character + + + + + + + + + Example of an 'APE' 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%. + + + + + Please enter the genre. + + + + diff -r fc9718756d55 -r 998e05c5769a xml/test-schema.xsd --- a/xml/test-schema.xsd Tue Jan 16 16:11:35 2018 +0000 +++ b/xml/test-schema.xsd Wed Jan 17 12:30:28 2018 +0000 @@ -48,6 +48,7 @@ + @@ -59,7 +60,6 @@ - @@ -76,6 +76,14 @@ + + + + + + + +