changeset 2298:c588522dda07

Merge branch 'master' of https://github.com/BrechtDeMan/WebAudioEvaluationTool
author www-data <www-data@sucuk.dcs.qmul.ac.uk>
date Wed, 27 Apr 2016 10:21:17 +0100
parents b99f37fda80c (current diff) b0b4d264d9a8 (diff)
children b1a8d6d311c2
files
diffstat 11 files changed, 44 insertions(+), 94 deletions(-) [+]
line wrap: on
line diff
--- a/css/core.css	Tue Apr 26 02:21:03 2016 +0100
+++ b/css/core.css	Wed Apr 27 10:21:17 2016 +0100
@@ -41,8 +41,8 @@
 	background-color: #fff;
 	border-radius: 10px;
 	box-shadow: 0px 0px 50px #000;
-	z-index: 2;
-    position: absolute;
+	z-index: 10;
+    position: fixed;
 }
 
 div#popupContent {
@@ -107,10 +107,10 @@
 	/* 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: 2;
+	z-index: 9;
 	width: 100%;
 	height: 100%;
-	position: absolute;
+	position: fixed;
 	left: 0px;
 	top: 0px;
 }
--- a/index.html	Tue Apr 26 02:21:03 2016 +0100
+++ b/index.html	Wed Apr 27 10:21:17 2016 +0100
@@ -51,11 +51,11 @@
 			<h1>Web Audio Evaluation Tool</h1>
 			<h2>Start menu </h2>
 			<ul>
-				<li><a href="index.html?url=example_eval/project.xml" target="_blank">APE interface test example</a></li>
-				<li><a href="index.html?url=example_eval/mushra_example.xml" target="_blank">MUSHRA interface test example</a></li>
-				<li><a href="index.html?url=example_eval/AB_example.xml" target="_blank">AB interface test example</a></li>
-				<li><a href="index.html?url=example_eval/horizontal_example.xml" target="_blank">Horizontal interface test example</a></li>
-				<li><a href="index.html?url=example_eval/radio_example.xml" target="_blank">Radio interface test example</a></li>
+				<li><a href="test.html?url=tests/examples/project.xml" target="_blank">APE interface test example</a></li>
+				<li><a href="test.html?url=tests/examples/mushra_example.xml" target="_blank">MUSHRA interface test example</a></li>
+				<li><a href="test.html?url=tests/examples/AB_example.xml" target="_blank">AB interface test example</a></li>
+				<li><a href="test.html?url=tests/examples/horizontal_example.xml" target="_blank">Horizontal interface test example</a></li>
+				<li><a href="test.html?url=tests/examples/radio_example.xml" target="_blank">Radio interface test example</a></li>
 				<li><a href="test_create.html" target="_blank">Test creator</a></li>
 				<li><a href="analyse.html" target="_blank">Analysis and diagnostics of results</a></li>
 			</ul>
@@ -66,7 +66,7 @@
 				<li><a href="docs/Instructions/Instructions.pdf" target="_blank">Instructions</a></li>
 			</ul>
 		</div>
-        <div id="popupHolder" class="popupHolder" style="visibility: hidden; z-index: -1">
+        <div id="popupHolder" class="popupHolder" style="visibility: hidden">
             <div id="popupContent">
                 <div id="popupTitleHolder">
                     <span id="popupTitle"></span>
@@ -76,6 +76,6 @@
             <button id="popup-proceed" class="popupButton">Next</button>
             <button id="popup-previous" class="popupButton">Back</button>
         </div>
-        <div class="testHalt" style="visibility: hidden; z-index: -2"></div>
+        <div class="testHalt" style="visibility: hidden"></div>
 	</body>
 </html>
--- a/interfaces/AB.css	Tue Apr 26 02:21:03 2016 +0100
+++ b/interfaces/AB.css	Wed Apr 27 10:21:17 2016 +0100
@@ -13,18 +13,6 @@
 	font-size: 1.5em;
 }
 
-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: 2;
-	width: 100%;
-	height: 100%;
-	position: absolute;
-	left: 0px;
-	top: 0px;
-}
-
 button {
 	/* Specify any button structure or style */
 	min-width: 20px;
--- a/interfaces/ABX.css	Tue Apr 26 02:21:03 2016 +0100
+++ b/interfaces/ABX.css	Wed Apr 27 10:21:17 2016 +0100
@@ -13,18 +13,6 @@
 	font-size: 1.5em;
 }
 
-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: 2;
-	width: 100%;
-	height: 100%;
-	position: absolute;
-	left: 0px;
-	top: 0px;
-}
-
 button {
 	/* Specify any button structure or style */
 	min-width: 20px;
--- a/interfaces/discrete.css	Tue Apr 26 02:21:03 2016 +0100
+++ b/interfaces/discrete.css	Wed Apr 27 10:21:17 2016 +0100
@@ -17,18 +17,6 @@
 	font-size: 1.5em;
 }
 
-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: 2;
-	width: 100%;
-	height: 100%;
-	position: absolute;
-	left: 0px;
-	top: 0px;
-}
-
 button {
 	/* Specify any button structure or style */
 	min-width: 20px;
--- a/interfaces/horizontal-sliders.css	Tue Apr 26 02:21:03 2016 +0100
+++ b/interfaces/horizontal-sliders.css	Wed Apr 27 10:21:17 2016 +0100
@@ -17,18 +17,6 @@
 	font-size: 1.5em;
 }
 
-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: 2;
-	width: 100%;
-	height: 100%;
-	position: absolute;
-	left: 0px;
-	top: 0px;
-}
-
 button {
 	/* Specify any button structure or style */
 	min-width: 20px;
--- a/interfaces/mushra.css	Tue Apr 26 02:21:03 2016 +0100
+++ b/interfaces/mushra.css	Wed Apr 27 10:21:17 2016 +0100
@@ -17,18 +17,6 @@
 	font-size: 1.5em;
 }
 
-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: 2;
-	width: 100%;
-	height: 100%;
-	position: absolute;
-	left: 0px;
-	top: 0px;
-}
-
 button {
 	/* Specify any button structure or style */
 	min-width: 20px;
--- a/js/core.js	Tue Apr 26 02:21:03 2016 +0100
+++ b/js/core.js	Wed Apr 27 10:21:17 2016 +0100
@@ -241,8 +241,8 @@
     } else if (responseDocument.firstChild.nodeName == "waetresult") {
         // document is a result
         projectXML = document.implementation.createDocument(null,"waet");
-        projectXML.children[0].appendChild(responseDocument.getElementsByTagName('waet')[0].getElementsByTagName("setup")[0].cloneNode(true));
-        var child = responseDocument.children[0].children[0];
+        projectXML.firstChild.appendChild(responseDocument.getElementsByTagName('waet')[0].getElementsByTagName("setup")[0].cloneNode(true));
+        var child = responseDocument.firstChild.firstChild;
         while (child != null) {
             if (child.nodeName == "survey") {
                 // One of the global survey elements
@@ -268,15 +268,15 @@
                     // We need to complete this, so it must be regenerated by store
                     var copy = child;
                     child = child.previousElementSibling;
-                    responseDocument.children[0].removeChild(copy);
+                    responseDocument.firstChild.removeChild(copy);
                 }
             } else if (child.nodeName == "page") {
                 if (child.getAttribute("state") == "empty") {
                     // We need to complete this page
-                    projectXML.children[0].appendChild(responseDocument.getElementById(child.getAttribute("ref")).cloneNode(true));
+                    projectXML.firstChild.appendChild(responseDocument.getElementById(child.getAttribute("ref")).cloneNode(true));
                     var copy = child;
                     child = child.previousElementSibling;
-                    responseDocument.children[0].removeChild(copy);
+                    responseDocument.firstChild.removeChild(copy);
                 }
             }
             child = child.nextElementSibling;
@@ -587,8 +587,6 @@
 		this.buttonPrevious.onclick = function(){popup.previousClick();};
 		
         this.hidePopup();
-        
-		this.popup.style.zIndex = -1;
 		this.popup.style.visibility = 'hidden';
 	};
 	
@@ -596,20 +594,16 @@
 		if (this.popup == null) {
 			this.createPopup();
 		}
-		this.popup.style.zIndex = 3;
 		this.popup.style.visibility = 'visible';
 		var blank = document.getElementsByClassName('testHalt')[0];
-		blank.style.zIndex = 2;
 		blank.style.visibility = 'visible';
         this.popupResponse.style.left="0%";
 	};
 	
 	this.hidePopup = function(){
         if (this.popup) {
-            this.popup.style.zIndex = -1;
             this.popup.style.visibility = 'hidden';
             var blank = document.getElementsByClassName('testHalt')[0];
-            blank.style.zIndex = -2;
             blank.style.visibility = 'hidden';
             this.buttonPrevious.style.visibility = 'inherit';
         }
@@ -2102,9 +2096,11 @@
 		this.span = document.createElement('div');
 		this.inputs.align = 'center';
 		this.inputs.style.marginLeft = '12px';
+        this.inputs.className = "comment-radio-inputs-holder";
 		this.span.style.marginLeft = '12px';
 		this.span.align = 'center';
 		this.span.style.marginTop = '15px';
+        this.span.className = "comment-radio-span-holder";
 		
 		var optCount = commentQuestion.options.length;
 		for (var optNode of commentQuestion.options)
@@ -2174,9 +2170,9 @@
 				boxwidth = 400;
 			}
 			this.holder.style.width = boxwidth+"px";
-			var text = this.holder.children[2];
-			var options = this.holder.children[3];
-			var optCount = options.children.length;
+			var text = this.holder.getElementsByClassName("comment-radio-span-holder")[0];
+			var options = this.holder.getElementsByClassName("comment-radio-inputs-holder")[0];
+			var optCount = options.childElementCount;
 			var spanMargin = Math.floor(((boxwidth-20-(optCount*80))/(optCount))/2)+'px';
 			var options = options.firstChild;
 			var text = text.firstChild;
@@ -2214,9 +2210,11 @@
 		this.span = document.createElement('div');
 		this.inputs.align = 'center';
 		this.inputs.style.marginLeft = '12px';
+        this.inputs.className = "comment-checkbox-inputs-holder";
 		this.span.style.marginLeft = '12px';
 		this.span.align = 'center';
 		this.span.style.marginTop = '15px';
+        this.span.className = "comment-checkbox-span-holder";
 		
 		var optCount = commentQuestion.options.length;
 		for (var i=0; i<optCount; i++)
@@ -2277,9 +2275,9 @@
 				boxwidth = 400;
 			}
 			this.holder.style.width = boxwidth+"px";
-			var text = this.holder.children[2];
-			var options = this.holder.children[3];
-			var optCount = options.children.length;
+			var text = this.holder.getElementsByClassName("comment-checkbox-span-holder")[0];
+			var options = this.holder.getElementsByClassName("comment-checkbox-inputs-holder")[0];
+			var optCount = options.childElementCount;
 			var spanMargin = Math.floor(((boxwidth-20-(optCount*80))/(optCount))/2)+'px';
 			var options = options.firstChild;
 			var text = text.firstChild;
@@ -2810,7 +2808,7 @@
             this.root.appendChild(interfaceContext.returnNavigator());
         } else {
             this.document = existingStore;
-            this.root = existingStore.children[0];
+            this.root = existingStore.firstChild;
             this.SessionKey.key = this.root.getAttribute("key");
         }
         if (specification.preTest != undefined){this.globalPreTest = new this.surveyNode(this,this.root,specification.preTest);}
@@ -2901,7 +2899,7 @@
 			// From popup: node is the popupOption node containing both spec. and results
 			// ID is the position
 			if (node.specification.type == 'statement'){return;}
-			var surveyresult = this.XMLDOM.children[0];
+			var surveyresult = this.XMLDOM.firstChild;
             while(surveyresult != null) {
                 if (surveyresult.getAttribute("ref") == node.specification.id)
                 {
--- a/php/get_filtered_score.php	Tue Apr 26 02:21:03 2016 +0100
+++ b/php/get_filtered_score.php	Wed Apr 27 10:21:17 2016 +0100
@@ -191,5 +191,6 @@
                 }
             }
         }
+        echo $doc_string;
 }
 ?>
\ No newline at end of file
--- a/test.html	Tue Apr 26 02:21:03 2016 +0100
+++ b/test.html	Wed Apr 27 10:21:17 2016 +0100
@@ -52,7 +52,7 @@
 		<div id='topLevelBody'>
             <span>Web Audio Evaluation Toolbox</span>
 		</div>
-        <div id="popupHolder" class="popupHolder" style="visibility: hidden; z-index: -1">
+        <div id="popupHolder" class="popupHolder" style="visibility: hidden">
             <div id="popupContent">
                 <div id="popupTitleHolder">
                     <span id="popupTitle"></span>
@@ -62,6 +62,6 @@
             <button id="popup-proceed" class="popupButton">Next</button>
             <button id="popup-previous" class="popupButton">Back</button>
         </div>
-        <div class="testHalt" style="visibility: hidden; z-index: -2"></div>
+        <div class="testHalt" style="visibility: hidden"></div>
 	</body>
 </html>
--- a/tests/examples/radio_example.xml	Tue Apr 26 02:21:03 2016 +0100
+++ b/tests/examples/radio_example.xml	Wed Apr 27 10:21:17 2016 +0100
@@ -18,7 +18,7 @@
 			<interfaceoption type="show" name="page-count"/>
 		</interface>
 	</setup>
-	<page id='test-0' hostURL="media/example/" randomiseOrder='true' repeatCount='4' loop='true' showElementComments='true' loudness="-23" poolSize="3">
+	<page id='test-0' hostURL="media/example/" randomiseOrder='true' repeatCount='4' loop='true' showElementComments='true' loudness="-23">
 		<interface>
 			<scales>
 				<scalelabel position="0">(1) Very Annoying</scalelabel>
@@ -31,6 +31,17 @@
 		<audioelement url="0.wav" id="track-1" alwaysInclude="true"/>
 		<audioelement url="1.wav" id="track-2"/>
         <audioelement url="3.wav" id="track-4"/>
-        <audioelement url="2.wav" id="track-3" type="outside-reference"/>
+        <audioelement url="3.wav" id="track-5"/>
+        <audioelement url="3.wav" id="track-6"/>
+        <audioelement url="3.wav" id="track-7"/>
+        <audioelement url="3.wav" id="track-8"/>
+        <audioelement url="3.wav" id="track-9"/>
+        <audioelement url="3.wav" id="track-10"/>
+        <audioelement url="3.wav" id="track-11"/>
+        <audioelement url="3.wav" id="track-12"/>
+        <audioelement url="3.wav" id="track-13"/>
+        <audioelement url="3.wav" id="track-14"/>
+        <audioelement url="3.wav" id="track-15"/>
+        <audioelement url="2.wav" id="track-16" type="outside-reference"/>
 	</page>
 </waet>