# HG changeset patch # User Nicholas Jillings # Date 1479133023 0 # Node ID 464c6c6692d6ac6536b6cdbd87c37c1e57e29e95 # Parent 527020a63203492530a04a892dd8dd6ef22ac273 Beautified entire project. diff -r 527020a63203 -r 464c6c6692d6 analysis/analysis.css --- a/analysis/analysis.css Mon Nov 14 12:11:38 2016 +0000 +++ b/analysis/analysis.css Mon Nov 14 14:17:03 2016 +0000 @@ -5,12 +5,12 @@ div.code { margin: 5px; padding-left: 15px; - background-color: rgb(200,200,200); + background-color: rgb(200, 200, 200); border: 2px dashed black; } -table td tr{ +table td tr { padding: 5px; } -div.filter-entry{ +div.filter-entry { padding: 5px; -} \ No newline at end of file +} diff -r 527020a63203 -r 464c6c6692d6 analysis/analysis.js --- a/analysis/analysis.js Mon Nov 14 12:11:38 2016 +0000 +++ b/analysis/analysis.js Mon Nov 14 14:17:03 2016 +0000 @@ -1,31 +1,26 @@ /* -* Analysis script for WAET -*/ + * Analysis script for WAET + */ // Firefox does not have an XMLDocument.prototype.getElementsByName // and there is no searchAll style command, this custom function will // search all children recusrively for the name. Used for XSD where all // element nodes must have a name and therefore can pull the schema node -XMLDocument.prototype.getAllElementsByName = function(name) -{ +XMLDocument.prototype.getAllElementsByName = function (name) { name = String(name); var selected = this.documentElement.getAllElementsByName(name); return selected; } -Element.prototype.getAllElementsByName = function(name) -{ +Element.prototype.getAllElementsByName = function (name) { name = String(name); var selected = []; var node = this.firstElementChild; - while(node != null) - { - if (node.getAttribute('name') == name) - { + while (node != null) { + if (node.getAttribute('name') == name) { selected.push(node); } - if (node.childElementCount > 0) - { + if (node.childElementCount > 0) { selected = selected.concat(node.getAllElementsByName(name)); } node = node.nextElementSibling; @@ -33,26 +28,21 @@ return selected; } -XMLDocument.prototype.getAllElementsByTagName = function(name) -{ +XMLDocument.prototype.getAllElementsByTagName = function (name) { name = String(name); var selected = this.documentElement.getAllElementsByTagName(name); return selected; } -Element.prototype.getAllElementsByTagName = function(name) -{ +Element.prototype.getAllElementsByTagName = function (name) { name = String(name); var selected = []; var node = this.firstElementChild; - while(node != null) - { - if (node.nodeName == name) - { + while (node != null) { + if (node.nodeName == name) { selected.push(node); } - if (node.childElementCount > 0) - { + if (node.childElementCount > 0) { selected = selected.concat(node.getAllElementsByTagName(name)); } node = node.nextElementSibling; @@ -62,15 +52,12 @@ // Firefox does not have an XMLDocument.prototype.getElementsByName if (typeof XMLDocument.prototype.getElementsByName != "function") { - XMLDocument.prototype.getElementsByName = function(name) - { + XMLDocument.prototype.getElementsByName = function (name) { name = String(name); var node = this.documentElement.firstElementChild; var selected = []; - while(node != null) - { - if (node.getAttribute('name') == name) - { + while (node != null) { + if (node.getAttribute('name') == name) { selected.push(node); } node = node.nextElementSibling; @@ -80,41 +67,42 @@ } var chartContext, testData; -window.onload = function() { +window.onload = function () { // Load the Visualization API and the corechart package. - google.charts.load('current', {'packages':['corechart']}); + google.charts.load('current', { + 'packages': ['corechart'] + }); chartContext = new Chart(); testData = new Data(); } function get(url) { - // Return a new promise. - return new Promise(function(resolve, reject) { - // Do the usual XHR stuff - var req = new XMLHttpRequest(); - req.open('GET', url); - req.onload = function() { - // This is called even on 404 etc - // so check the status - if (req.status == 200) { - // Resolve the promise with the response text - resolve(req.response); - } - else { - // Otherwise reject with the status text - // which will hopefully be a meaningful error - reject(Error(req.statusText)); - } - }; + // Return a new promise. + return new Promise(function (resolve, reject) { + // Do the usual XHR stuff + var req = new XMLHttpRequest(); + req.open('GET', url); + req.onload = function () { + // This is called even on 404 etc + // so check the status + if (req.status == 200) { + // Resolve the promise with the response text + resolve(req.response); + } else { + // Otherwise reject with the status text + // which will hopefully be a meaningful error + reject(Error(req.statusText)); + } + }; - // Handle network errors - req.onerror = function() { - reject(Error("Network Error")); - }; + // Handle network errors + req.onerror = function () { + reject(Error("Network Error")); + }; - // Make the request - req.send(); - }); + // Make the request + req.send(); + }); } function arrayMean(values) { @@ -128,15 +116,17 @@ function percentile(values, p) { //http://web.stanford.edu/class/archive/anthsci/anthsci192/anthsci192.1064/handouts/calculating%20percentiles.pdf - values.sort( function(a,b) {return a - b;} ); + values.sort(function (a, b) { + return a - b; + }); // get ordinal rank - var index = values.length*p/100; + var index = values.length * p / 100; var k = Math.floor(index); if (k == index) { return values[k]; } else { - var f = index-k; - var x_int = (1-f)*values[k]+f*values[k+1]; + var f = index - k; + var x_int = (1 - f) * values[k] + f * values[k + 1]; return x_int; } } @@ -166,19 +156,19 @@ function boxplotRow(array) { // Take an array of element values and return array of computed intervals var result = { - median : percentile(array,50), - pct25 : percentile(array,25), - pct75 : percentile(array,75), - IQR : null, + median: percentile(array, 50), + pct25: percentile(array, 25), + pct75: percentile(array, 75), + IQR: null, min: null, max: null, outliers: new Array() } - result.IQR = result.pct75-result.pct25; + result.IQR = result.pct75 - result.pct25; var rest = []; - var pct75_IQR = result.pct75+1.5*result.IQR; - var pct25_IQR = result.pct25-1.5*result.IQR; - for (var i=0; i pct75_IQR || point < pct25_IQR) { @@ -190,23 +180,27 @@ result.max = arrayMax(rest); result.min = arrayMin(rest); return result; - + } -function arrayHistogram(values,steps,min,max) { +function arrayHistogram(values, steps, min, max) { if (steps == undefined) { steps = 0.25; console.log("Warning: arrayHistogram called without steps size set, default to 0.25"); } - if (min == undefined) {min = arrayMin(values);} - if (max == undefined) {max = arrayMax(values);} + if (min == undefined) { + min = arrayMin(values); + } + if (max == undefined) { + max = arrayMax(values); + } var histogram = []; var index = min; - while(index < max) { + while (index < max) { histogram.push({ marker: index, lt: index, - rt: index+steps, + rt: index + steps, count: 0 }); index += steps; @@ -225,13 +219,13 @@ function Chart() { this.valueData; this.charts = []; - - this.chartObject = function(name) { + + this.chartObject = function (name) { // Create the charting object this.name = name; this.root = document.createElement("div"); this.root.className = "chart-holder"; - this.root.setAttribute("name",name); + this.root.setAttribute("name", name); this.chartDOM = document.createElement("div"); this.tableDOM = document.createElement("div"); this.latexDOM = document.createElement("div"); @@ -242,30 +236,31 @@ this.print = document.createElement("button"); this.sortDataButton = document.createElement("button"); this.sortDataButton.textContent = "Sort by Data"; - this.sortDataButton.addEventListener("click",this); - this.sortDataButton.setAttribute("name","sort-data"); + this.sortDataButton.addEventListener("click", this); + this.sortDataButton.setAttribute("name", "sort-data"); this.sortNameButton = document.createElement("button"); this.sortNameButton.textContent = "Sort by Name"; - this.sortNameButton.addEventListener("click",this); - this.sortNameButton.setAttribute("name","sort-name"); - this.draw = function() { - if (this.chart == undefined) {return;} + this.sortNameButton.addEventListener("click", this); + this.sortNameButton.setAttribute("name", "sort-name"); + this.draw = function () { + if (this.chart == undefined) { + return; + } this.tableDOM.innerHTML = null; this.latexDOM.innerHTML = null; this.buildTable(); this.writeLatex(); - this.chart.draw(this.data,this.options); + this.chart.draw(this.data, this.options); } - this.sortData = function() { + this.sortData = function () { this.data.sort(1); } - this.sortName = function() { + this.sortName = function () { this.data.sort(0); } - this.handleEvent = function() { + this.handleEvent = function () { // Only used to handle the chart.event.addListener(this,'ready') callback - switch(event.currentTarget.getAttribute("name")) - { + switch (event.currentTarget.getAttribute("name")) { case "download": window.open(this.chart.getImageURI()); break; @@ -279,7 +274,7 @@ break; } } - + this.root.appendChild(this.chartDOM); this.root.appendChild(this.tableDOM); this.root.appendChild(this.latexDOM); @@ -287,16 +282,15 @@ this.root.appendChild(this.sortNameButton); this.root.appendChild(this.print); this.print.textContent = "Download"; - this.print.setAttribute("name","download"); - this.print.addEventListener("click",this); + this.print.setAttribute("name", "download"); + this.print.addEventListener("click", this); this.root.appendChild(this.downloadDOM); - this.buildTable = function() { + this.buildTable = function () { var table = document.createElement("table"); table.border = "1"; var numRows = this.data.getNumberOfRows(); var numColumns = this.data.getNumberOfColumns(); - for (var columnIndex=0; columnIndex"; + this.rootDOM.innerHTML = "ID: " + specification.id + ", Type: " + specification.type + ""; this.rootDOM.className = "filter-entry"; - this.handleEvent = function(event) { - switch(this.specification.type) { + this.handleEvent = function (event) { + switch (this.specification.type) { case "number": var name = event.currentTarget.name; - eval("this."+name+" = event.currentTarget.value"); + eval("this." + name + " = event.currentTarget.value"); break; case "checkbox": break; @@ -762,29 +795,29 @@ } this.parent.getFileCount(); } - this.getFilterPairs = function() { + this.getFilterPairs = function () { var pairs = []; - switch(this.specification.type) { + switch (this.specification.type) { case "number": if (this.min != "") { - pairs.push([specification.id+"-min",this.min]); + pairs.push([specification.id + "-min", this.min]); } if (this.max != "") { - pairs.push([specification.id+"-max",this.max]); + pairs.push([specification.id + "-max", this.max]); } break; case "radio": case "checkbox": - for (var i=0; i - - - - - - - - -

Web Audio Evaluation Toolbox: Analysis

-
- -
-

Charts per test

- - -
-
-

Charts per test page

- -
-
-

Charts per element

- -
- -
- - \ No newline at end of file + + + + + + + + + + +

Web Audio Evaluation Toolbox: Analysis

+
+ +
+

Charts per test

+ + +
+
+

Charts per test page

+ +
+
+

Charts per element

+ +
+ +
+ + + diff -r 527020a63203 -r 464c6c6692d6 css/core.css --- a/css/core.css Mon Nov 14 12:11:38 2016 +0000 +++ b/css/core.css Mon Nov 14 14:17:03 2016 +0000 @@ -3,60 +3,53 @@ */ div.title { - width: 100%; - height: 50px; - margin-bottom: 10px; - font-size: 2em; + width: 100%; + height: 50px; + margin-bottom: 10px; + font-size: 2em; } - div.indicator-box { - position: absolute; - left: 150px; - top: 10px; - width: 300px; - height: 60px; - padding: 20px; - border-radius: 10px; - background-color: rgb(100,200,200); + position: absolute; + left: 150px; + top: 10px; + width: 300px; + height: 60px; + padding: 20px; + border-radius: 10px; + background-color: rgb(100, 200, 200); } - div.comment-div { - border:1px solid #444444; - max-width: 600px; - min-width: 400px; - float: left; - margin: 5px 10px 5px 5px; - height: 90px; + border: 1px solid #444444; + max-width: 600px; + min-width: 400px; + float: left; + margin: 5px 10px 5px 5px; + height: 90px; border-radius: 10px; } - div.comment-div span { - margin-left: 15px; + margin-left: 15px; } - div.popupHolder { - width: 500px; - min-height: 250px; - max-height: 400px; - background-color: #fff; - border-radius: 10px; - box-shadow: 0px 0px 50px #000; - z-index: 10; - position: fixed; + width: 500px; + min-height: 250px; + max-height: 400px; + background-color: #fff; + border-radius: 10px; + box-shadow: 0px 0px 50px #000; + z-index: 10; + position: fixed; } - div#popupContent { margin-top: 20px; margin-bottom: 35px; overflow: auto; } - div#popupContent iframe { width: 100%; border: 0px none; height: 290px; } - div#popupTitleHolder { width: inherit; min-height: 25px; @@ -66,11 +59,9 @@ padding: 8px; text-align: center; } - #popupTitle { white-space: pre-line; } - div#popupResponse { width: inherit; min-height: 50px; @@ -78,20 +69,18 @@ overflow: auto; position: relative; } - button.popupButton { - /* Button for popup window + /* Button for popup window */ - width: 50px; - height: 25px; - position: absolute; - border-radius: 5px; - border: #444; - border-width: 1px; - border-style: solid; - background-color: #fff; + width: 50px; + height: 25px; + position: absolute; + border-radius: 5px; + border: #444; + border-width: 1px; + border-style: solid; + background-color: #fff; } - div.popup-option-checbox { /* Popup window checkbox */ padding: 5px; @@ -99,46 +88,38 @@ width: -moz-fit-content; width: -webkit-fit-content; } - -div.popup-option-checbox input{ +div.popup-option-checbox input { /* Popup window checkbox */ margin-right: 15px; } - table.popup-option-list { margin: auto; } - table.popup-option-list tr { padding: 5px; } - table.popup-option-list tr td { padding: 5px; } - button#popup-proceed { bottom: 10px; right: 10px; } - button#popup-previous { bottom: 10px; left: 10px; } - div.testHalt { - /* Specify any colouring during the test halt for pre/post questions */ - background-color: rgba(0,0,0,0.5); - /* Don't mess with this bit */ - z-index: 9; - width: 100%; - height: 100%; - position: fixed; - left: 0px; - top: 0px; + /* Specify any colouring during the test halt for pre/post questions */ + background-color: rgba(0, 0, 0, 0.5); + /* Don't mess with this bit */ + z-index: 9; + width: 100%; + height: 100%; + position: fixed; + left: 0px; + top: 0px; } - div#lightbox-root { visibility: hidden; z-index: 20; @@ -146,80 +127,69 @@ min-height: 50px; max-height: 250px; } - div.lightbox-error { margin: 25px; margin-bottom: 50px; padding: 5px; border-radius: 5px; - background-color: rgb(255,220,220); - border: 2px rgb(200,0,0) solid; + background-color: rgb(255, 220, 220); + border: 2px rgb(200, 0, 0) solid; } - div.lightbox-warning { margin: 25px; margin-bottom: 50px; padding: 5px; border-radius: 5px; - background-color: rgb(255,255,220); - border: 2px rgb(255,250,0) solid; + background-color: rgb(255, 255, 220); + border: 2px rgb(255, 250, 0) solid; } - div.lightbox-message { margin: 25px; margin-bottom: 50px; padding: 5px; border-radius: 5px; - background-color: rgb(200,220,255); - border: 2px rgb(50,100,250) solid; + background-color: rgb(200, 220, 255); + border: 2px rgb(50, 100, 250) solid; } - div#lightbox-blanker { visibility: hidden; z-index: 19; } - button.outside-reference { - width:120px; - height:20px; - margin-bottom:5px; - position: absolute; + width: 120px; + height: 20px; + margin-bottom: 5px; + position: absolute; } - textarea.trackComment { - max-width: 594px; - min-width: 350px; - max-height: 60px; + max-width: 594px; + min-width: 350px; + max-height: 60px; resize: none; } - div.playhead { - width: 500px; - height: 50px; - background-color: #eee; - border-radius: 10px; - padding: 10px; + width: 500px; + height: 50px; + background-color: #eee; + border-radius: 10px; + padding: 10px; } - div.playhead-scrub-track { - width: 100%; - height: 10px; - border-style: solid; - border-width: 1px; + width: 100%; + height: 10px; + border-style: solid; + border-width: 1px; } - div#playhead-scrubber { - width: 10px; - height: 10px; - position: relative; - background-color: #000; + width: 10px; + height: 10px; + position: relative; + background-color: #000; } - div.master-volume-holder-inline { width: 100%; padding: 5px; } - div.master-volume-holder-float { position: absolute; top: 20px; @@ -227,15 +197,13 @@ width: 250px%; padding: 5px; } - div#master-volume-root { - margin:auto; + margin: auto; border: black 1px solid; border-radius: 5px; width: 250px; height: 40px; } - input#master-volume-control { width: 200px; height: 25px; @@ -243,14 +211,12 @@ margin: 0px; padding: 0px; } - span#master-volume-feedback { width: 45px; height: 25px; margin-left: 5px; float: left; } - div.error-colour { background-color: #FF8F8F; } @@ -258,13 +224,11 @@ background-color: #FF8F8F; color: black; } - div.calibration-holder { text-align: center; align-content: center; height: auto; } - div.calibration-slider { width: 50px; margin: 2px; @@ -272,11 +236,11 @@ align-content: center; float: left; } - -div.calibration-slider input[type=range][orient=vertical] -{ - writing-mode: bt-lr; /* IE */ - -webkit-appearance: slider-vertical; /* WebKit */ +div.calibration-slider input[type=range][orient=vertical] { + writing-mode: bt-lr; + /* IE */ + -webkit-appearance: slider-vertical; + /* WebKit */ width: 8px; padding: 0 5px; height: 290px; diff -r 527020a63203 -r 464c6c6692d6 index.html --- a/index.html Mon Nov 14 12:11:38 2016 +0000 +++ b/index.html Mon Nov 14 14:17:03 2016 +0000 @@ -1,55 +1,57 @@ - - + + - - + - Web Audio Evaluation Tool - - - - - - - - - - + Web Audio Evaluation Tool + + - - -