changeset 890:716cd1efe64c

Added reference and anchor values to audioHolders in specificationNode.
author Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk>
date Wed, 17 Jun 2015 15:53:57 +0100
parents 804813c05761
children 8c44e2d0d6c4
files core.js example_eval/project.xml
diffstat 2 files changed, 35 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/core.js	Wed Jun 17 15:42:56 2015 +0100
+++ b/core.js	Wed Jun 17 15:53:57 2015 +0100
@@ -1246,8 +1246,10 @@
 				this.type = child.nodeName;
 				if (this.type == 'check') {
 					this.check = child.getAttribute('name');
+				} else if (this.type == 'anchor' || this.type == 'reference') {
+					this.value = Number(child.textContent);
 				}
-			}
+			};
 			this.options = [];
 			if (commonInterfaceNode != undefined) {
 				var child = commonInterfaceNode.firstElementChild;
@@ -1428,6 +1430,38 @@
 		if (xml.getAttribute('elementComments') == "true") {this.elementComments = true;}
 		else {this.elementComments = false;}
 		
+		this.anchor = xml.getElementsByTagName('anchor');
+		if (this.anchor.length == 0) {
+			// Find anchor in commonInterface;
+			for (var i=0; i<parent.commonInterface.options.length; i++) {
+				if(parent.commonInterface.options[i].type == 'anchor') {
+					this.anchor = parent.commonInterface.options[i].value;
+					break;
+				}
+			}
+			if (typeof(this.anchor) == "object") {
+				this.reference = null;
+			}
+		} else {
+			this.anchor = this.anchor[0].textContent;
+		}
+		
+		this.reference = xml.getElementsByTagName('reference');
+		if (this.reference.length == 0) {
+			// Find anchor in commonInterface;
+			for (var i=0; i<parent.commonInterface.options.length; i++) {
+				if(parent.commonInterface.options[i].type == 'reference') {
+					this.reference = parent.commonInterface.options[i].value;
+					break;
+				}
+			}
+			if (typeof(this.reference) == "object") {
+				this.reference = null;
+			}
+		} else {
+			this.reference = this.reference[0].textContent;
+		}
+		
 		this.preTest = new parent.prepostNode('pretest',xml.getElementsByTagName('PreTest'));
 		this.postTest = new parent.prepostNode('posttest',xml.getElementsByTagName('PostTest'));
 		
--- a/example_eval/project.xml	Wed Jun 17 15:42:56 2015 +0100
+++ b/example_eval/project.xml	Wed Jun 17 15:53:57 2015 +0100
@@ -40,7 +40,6 @@
 			<check name="fragmentMoved"/>
 			<check name="fragmentComments"/>
 			<anchor>20</anchor>
-			<reference>80</reference>
 		</interface>
 	</setup>
 	<audioHolder id='test-0' hostURL="example_eval/" sampleRate="44100" randomiseOrder='true' repeatCount='0' loop='true' elementComments='true'>