changeset 2599:fddfb7c0b4fa

Merge branch 'master' into vnext
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Mon, 14 Nov 2016 12:14:38 +0000
parents eeb2e6dce5f2 (diff) 527020a63203 (current diff)
children cc2364d8bc17 afeda52bcd53
files test_create/test_core.js
diffstat 9 files changed, 909 insertions(+), 817 deletions(-) [+]
line wrap: on
line diff
--- a/interfaces/AB.js	Mon Nov 14 12:11:38 2016 +0000
+++ b/interfaces/AB.js	Mon Nov 14 12:14:38 2016 +0000
@@ -2,15 +2,15 @@
 loadInterface();
 
 function loadInterface() {
-	// Get the dimensions of the screen available to the page
-	var width = window.innerWidth;
-	var height = window.innerHeight;
-	interfaceContext.insertPoint.innerHTML = ""; // Clear the current schema
-	
-	// Custom comparator Object
-	Interface.prototype.comparator = null;
-    
-    Interface.prototype.checkScaleRange = function(min, max) {
+    // Get the dimensions of the screen available to the page
+    var width = window.innerWidth;
+    var height = window.innerHeight;
+    interfaceContext.insertPoint.innerHTML = ""; // Clear the current schema
+
+    // Custom comparator Object
+    Interface.prototype.comparator = null;
+
+    Interface.prototype.checkScaleRange = function (min, max) {
         var page = testState.getCurrentTestPage();
         var audioObjects = audioEngineContext.audioObjects;
         var state = true;
@@ -19,166 +19,170 @@
         var maxRanking = -Infinity;
         for (var ao of audioObjects) {
             var rank = ao.interfaceDOM.getValue();
-            if (rank < minRanking) {minRanking = rank;}
-            if (rank > maxRanking) {maxRanking = rank;}
+            if (rank < minRanking) {
+                minRanking = rank;
+            }
+            if (rank > maxRanking) {
+                maxRanking = rank;
+            }
         }
-        if (maxRanking*100 < max) {
+        if (maxRanking * 100 < max) {
             str += "At least one fragment must be selected."
             state = false;
         }
         if (!state) {
             console.log(str);
             this.storeErrorNode(str);
-            interfaceContext.lightbox.post("Message",str);
+            interfaceContext.lightbox.post("Message", str);
         }
         return state;
     }
-	
-	// The injection point into the HTML page
-	interfaceContext.insertPoint = document.getElementById("topLevelBody");
-	var testContent = document.createElement('div');
-	testContent.id = 'testContent';
-	
-	// Create the top div for the Title element
-	var titleAttr = specification.title;
-	var title = document.createElement('div');
-	title.className = "title";
-	title.align = "center";
-	var titleSpan = document.createElement('span');
+
+    // The injection point into the HTML page
+    interfaceContext.insertPoint = document.getElementById("topLevelBody");
+    var testContent = document.createElement('div');
+    testContent.id = 'testContent';
+
+    // Create the top div for the Title element
+    var titleAttr = specification.title;
+    var title = document.createElement('div');
+    title.className = "title";
+    title.align = "center";
+    var titleSpan = document.createElement('span');
     titleSpan.id = "test-title";
-	
-	// Set title to that defined in XML, else set to default
-	if (titleAttr != undefined) {
-		titleSpan.textContent = titleAttr;
-	} else {
-		titleSpan.textContent =  'Listening test';
-	}
-	// Insert the titleSpan element into the title div element.
-	title.appendChild(titleSpan);
-	
-	var pagetitle = document.createElement('div');
-	pagetitle.className = "pageTitle";
-	pagetitle.align = "center";
-	var titleSpan = document.createElement('span');
-	titleSpan.id = "pageTitle";
-	pagetitle.appendChild(titleSpan);
-	
-	// Create Interface buttons!
-	var interfaceButtons = document.createElement('div');
-	interfaceButtons.id = 'interface-buttons';
-	interfaceButtons.style.height = '25px';
-	
-	// Create playback start/stop points
-	var playback = document.createElement("button");
-	playback.innerHTML = 'Stop';
-	playback.id = 'playback-button';
-	playback.style.float = 'left';
-	// onclick function. Check if it is playing or not, call the correct function in the
-	// audioEngine, change the button text to reflect the next state.
-	playback.onclick = function() {
-		if (audioEngineContext.status == 1) {
-			audioEngineContext.stop();
-			this.innerHTML = 'Stop';
+
+    // Set title to that defined in XML, else set to default
+    if (titleAttr != undefined) {
+        titleSpan.textContent = titleAttr;
+    } else {
+        titleSpan.textContent = 'Listening test';
+    }
+    // Insert the titleSpan element into the title div element.
+    title.appendChild(titleSpan);
+
+    var pagetitle = document.createElement('div');
+    pagetitle.className = "pageTitle";
+    pagetitle.align = "center";
+    var titleSpan = document.createElement('span');
+    titleSpan.id = "pageTitle";
+    pagetitle.appendChild(titleSpan);
+
+    // Create Interface buttons!
+    var interfaceButtons = document.createElement('div');
+    interfaceButtons.id = 'interface-buttons';
+    interfaceButtons.style.height = '25px';
+
+    // Create playback start/stop points
+    var playback = document.createElement("button");
+    playback.innerHTML = 'Stop';
+    playback.id = 'playback-button';
+    playback.style.float = 'left';
+    // onclick function. Check if it is playing or not, call the correct function in the
+    // audioEngine, change the button text to reflect the next state.
+    playback.onclick = function () {
+        if (audioEngineContext.status == 1) {
+            audioEngineContext.stop();
+            this.innerHTML = 'Stop';
             var time = audioEngineContext.timer.getTestTime();
             console.log('Stopped at ' + time); // DEBUG/SAFETY
-		}
-	};
-	// Append the interface buttons into the interfaceButtons object.
-	interfaceButtons.appendChild(playback);
-	
-	// Global parent for the comment boxes on the page
-	var feedbackHolder = document.createElement('div');
-	feedbackHolder.id = 'feedbackHolder';
-    
+        }
+    };
+    // Append the interface buttons into the interfaceButtons object.
+    interfaceButtons.appendChild(playback);
+
+    // Global parent for the comment boxes on the page
+    var feedbackHolder = document.createElement('div');
+    feedbackHolder.id = 'feedbackHolder';
+
     // Create outside reference holder
     var outsideRef = document.createElement("div");
     outsideRef.id = "outside-reference-holder";
-	
-	// Construct the AB Boxes
-	var boxes = document.createElement('div');
-	boxes.align = "center";
-	boxes.id = "box-holders";
+
+    // Construct the AB Boxes
+    var boxes = document.createElement('div');
+    boxes.align = "center";
+    boxes.id = "box-holders";
     boxes.style.float = "left";
-	
-	var submit = document.createElement('button');
-	submit.id = "submit";
-	submit.onclick = buttonSubmitClick;
-	submit.className = "big-button";
-	submit.textContent = "submit";
-	submit.style.position = "relative";
-	submit.style.left = (window.innerWidth-250)/2 + 'px';
-		
-	feedbackHolder.appendChild(boxes);
-    
+
+    var submit = document.createElement('button');
+    submit.id = "submit";
+    submit.onclick = buttonSubmitClick;
+    submit.className = "big-button";
+    submit.textContent = "submit";
+    submit.style.position = "relative";
+    submit.style.left = (window.innerWidth - 250) / 2 + 'px';
+
+    feedbackHolder.appendChild(boxes);
+
     // Create holder for comment boxes
     var comments = document.createElement("div");
     comments.id = "comment-box-holder";
-	
-	// Inject into HTML
-	testContent.appendChild(title); // Insert the title
-	testContent.appendChild(pagetitle);
-	testContent.appendChild(interfaceButtons);
+
+    // Inject into HTML
+    testContent.appendChild(title); // Insert the title
+    testContent.appendChild(pagetitle);
+    testContent.appendChild(interfaceButtons);
     testContent.appendChild(outsideRef);
-	testContent.appendChild(feedbackHolder);
-	testContent.appendChild(submit);
+    testContent.appendChild(feedbackHolder);
+    testContent.appendChild(submit);
     testContent.appendChild(comments);
-	interfaceContext.insertPoint.appendChild(testContent);
+    interfaceContext.insertPoint.appendChild(testContent);
 
-	// Load the full interface
-	testState.initialise();
-	testState.advanceState();
+    // Load the full interface
+    testState.initialise();
+    testState.advanceState();
 }
 
-function loadTest(audioHolderObject)
-{
-	var feedbackHolder = document.getElementById('feedbackHolder');
-	var interfaceObj = audioHolderObject.interfaces;
-	if (interfaceObj.length > 1)
-	{
-		console.log("WARNING - This interface only supports one <interface> node per page. Using first interface node");
-	}
-	interfaceObj = interfaceObj[0];
-    
+function loadTest(audioHolderObject) {
+    var feedbackHolder = document.getElementById('feedbackHolder');
+    var interfaceObj = audioHolderObject.interfaces;
+    if (interfaceObj.length > 1) {
+        console.log("WARNING - This interface only supports one <interface> node per page. Using first interface node");
+    }
+    interfaceObj = interfaceObj[0];
+
     var commentHolder = document.getElementById('comment-box-holder');
     commentHolder.innerHTML = "";
-    
+
     // Delete outside reference
-	var outsideReferenceHolder = document.getElementById("outside-reference-holder");
+    var outsideReferenceHolder = document.getElementById("outside-reference-holder");
     outsideReferenceHolder.innerHTML = "";
-    
+
     // Set the page title
     if (typeof audioHolderObject.title == "string" && audioHolderObject.title.length > 0) {
         document.getElementById("test-title").textContent = audioHolderObject.title
     }
-	
-	if(interfaceObj.title != null)
-	{
-		document.getElementById("pageTitle").textContent = interfaceObj.title;
-	}
-    
+
+    if (interfaceObj.title != null) {
+        document.getElementById("pageTitle").textContent = interfaceObj.title;
+    }
+
     var interfaceOptions = specification.interfaces.options.concat(interfaceObj.options);
     // Clear the interfaceElements
     {
         var node = document.getElementById('playback-holder');
-        if (node){feedbackHolder.removeChild(node);}
+        if (node) {
+            feedbackHolder.removeChild(node);
+        }
         node = document.getElementById('page-count');
-        if (node){document.getElementById('interface-buttons').removeChild(node);}
+        if (node) {
+            document.getElementById('interface-buttons').removeChild(node);
+        }
         node = document.getElementById('master-volume-holder-float');
-        if (node){feedbackHolder.removeChild(node);}
+        if (node) {
+            feedbackHolder.removeChild(node);
+        }
     }
-    
+
     // Populate the comparator object
-	interfaceContext.comparator = new comparator(audioHolderObject);
-    
-    for (var option of interfaceOptions)
-    {
-        if (option.type == "show")
-        {
-            switch(option.name) {
+    interfaceContext.comparator = new comparator(audioHolderObject);
+
+    for (var option of interfaceOptions) {
+        if (option.type == "show") {
+            switch (option.name) {
                 case "playhead":
                     var playbackHolder = document.getElementById('playback-holder');
-                    if (playbackHolder == null)
-                    {
+                    if (playbackHolder == null) {
                         playbackHolder = document.createElement('div');
                         playbackHolder.id = 'playback-holder';
                         playbackHolder.style.width = "100%";
@@ -190,309 +194,329 @@
                     break;
                 case "page-count":
                     var pagecountHolder = document.getElementById('page-count');
-                    if (pagecountHolder == null)
-                    {
+                    if (pagecountHolder == null) {
                         pagecountHolder = document.createElement('div');
                         pagecountHolder.id = 'page-count';
                         document.getElementById('interface-buttons').appendChild(pagecountHolder);
                     }
-                    pagecountHolder.innerHTML = '<span>Page '+(testState.stateIndex+1)+' of '+testState.stateMap.length+'</span>';
+                    pagecountHolder.innerHTML = '<span>Page ' + (testState.stateIndex + 1) + ' of ' + testState.stateMap.length + '</span>';
                     break;
                 case "volume":
-                    if (document.getElementById('master-volume-holder-float') == null)
-                    {
+                    if (document.getElementById('master-volume-holder-float') == null) {
                         feedbackHolder.appendChild(interfaceContext.volume.object);
                     }
                     break;
                 case "comments":
                     // Generate one comment box per presented page
-                    for (var element of audioEngineContext.audioObjects)
-                    {
+                    for (var element of audioEngineContext.audioObjects) {
                         interfaceContext.commentBoxes.createCommentBox(element);
                     }
-                    interfaceContext.commentBoxes.showCommentBoxes(commentHolder,true);
+                    interfaceContext.commentBoxes.showCommentBoxes(commentHolder, true);
                     break;
             }
         }
     }
-    
-    $(audioHolderObject.commentQuestions).each(function(index,element) {
-		var node = interfaceContext.createCommentQuestion(element);
-		commentHolder.appendChild(node.holder);
-	});
-    
-	resizeWindow(null);
+
+    $(audioHolderObject.commentQuestions).each(function (index, element) {
+        var node = interfaceContext.createCommentQuestion(element);
+        commentHolder.appendChild(node.holder);
+    });
+
+    resizeWindow(null);
 }
 
-function comparator(audioHolderObject)
-{	
-	this.comparatorBox = function(audioElement,id,text)
-	{
-		this.parent = audioElement;
-		this.id = id;
-		this.value = 0;
-		this.disabled = true;
-		this.box = document.createElement('div');
-		this.box.className = 'comparator-holder';
-		this.box.setAttribute('track-id',audioElement.id);
-		this.box.id = 'comparator-'+text;
-		this.selector = document.createElement('div');
-		this.selector.className = 'comparator-selector disabled';
-		var selectorText = document.createElement('span');
-		selectorText.textContent = text;
-		this.selector.appendChild(selectorText);
-		this.playback = document.createElement('button');
-		this.playback.className = 'comparator-button';
-		this.playback.disabled = true;
-		this.playback.textContent = "Listen";
-		this.box.appendChild(this.selector);
-		this.box.appendChild(this.playback);
-		this.selector.onclick = function(event)
-		{
-			var time = audioEngineContext.timer.getTestTime();
-			if ($(event.currentTarget).hasClass('disabled'))
-			{
-				console.log("Please wait until sample has loaded");
-				return;
-			}
-			if (audioEngineContext.status == 0)
-			{
-				interfaceContext.lightbox.post("Message","Please listen to the samples before making a selection");
-				console.log("Please listen to the samples before making a selection");
-				return;
+function comparator(audioHolderObject) {
+    this.comparatorBox = function (audioElement, id, text) {
+        this.parent = audioElement;
+        this.id = id;
+        this.value = 0;
+        this.disabled = true;
+        this.box = document.createElement('div');
+        this.box.className = 'comparator-holder';
+        this.box.setAttribute('track-id', audioElement.id);
+        this.box.id = 'comparator-' + text;
+        this.selector = document.createElement('div');
+        this.selector.className = 'comparator-selector disabled';
+        var selectorText = document.createElement('span');
+        selectorText.textContent = text;
+        this.selector.appendChild(selectorText);
+        this.playback = document.createElement('button');
+        this.playback.className = 'comparator-button';
+        this.playback.disabled = true;
+        this.playback.textContent = "Listen";
+        this.box.appendChild(this.selector);
+        this.box.appendChild(this.playback);
+        this.selector.onclick = function (event) {
+            var time = audioEngineContext.timer.getTestTime();
+            if ($(event.currentTarget).hasClass('disabled')) {
+                console.log("Please wait until sample has loaded");
+                return;
             }
-			var id = event.currentTarget.parentElement.getAttribute('track-id');
-			interfaceContext.comparator.selected = id;
+            if (audioEngineContext.status == 0) {
+                interfaceContext.lightbox.post("Message", "Please listen to the samples before making a selection");
+                console.log("Please listen to the samples before making a selection");
+                return;
+            }
+            var id = event.currentTarget.parentElement.getAttribute('track-id');
+            interfaceContext.comparator.selected = id;
             if ($(event.currentTarget).hasClass("selected")) {
                 $(".comparator-selector").removeClass('selected');
-                for (var i=0; i<interfaceContext.comparator.comparators.length; i++)
-                {
+                for (var i = 0; i < interfaceContext.comparator.comparators.length; i++) {
                     var obj = interfaceContext.comparator.comparators[i];
-                    obj.parent.metric.moved(time,0);
+                    obj.parent.metric.moved(time, 0);
                     obj.value = 0;
                 }
             } else {
                 $(".comparator-selector").removeClass('selected');
                 $(event.currentTarget).addClass('selected');
-                for (var i=0; i<interfaceContext.comparator.comparators.length; i++)
-                {
+                for (var i = 0; i < interfaceContext.comparator.comparators.length; i++) {
                     var obj = interfaceContext.comparator.comparators[i];
                     if (i == id) {
                         obj.value = 1;
                     } else {
                         obj.value = 0;
                     }
-                    obj.parent.metric.moved(time,obj.value);
+                    obj.parent.metric.moved(time, obj.value);
                 }
-                console.log("Selected "+id+' ('+time+')');
+                console.log("Selected " + id + ' (' + time + ')');
             }
-		};
-        this.playback.setAttribute("playstate","ready");
-		this.playback.onclick = function(event)
-		{
-			var id = event.currentTarget.parentElement.getAttribute('track-id');
-            if (event.currentTarget.getAttribute("playstate") == "ready")
-            {
+        };
+        this.playback.setAttribute("playstate", "ready");
+        this.playback.onclick = function (event) {
+            var id = event.currentTarget.parentElement.getAttribute('track-id');
+            if (event.currentTarget.getAttribute("playstate") == "ready") {
                 audioEngineContext.play(id);
             } else if (event.currentTarget.getAttribute("playstate") == "playing") {
                 audioEngineContext.stop();
             }
-			
-		};
-		
-		this.enable = function()
-		{
-			if (this.parent.state == 1)
-			{
-				$(this.selector).removeClass('disabled');
-				this.playback.disabled = false;
-			}
-		};
-		this.updateLoading = function(progress)
-		{
-			if (progress != 100)
-			{
-				progress = String(progress);
-				progress = progress.split('.')[0];
-				this.playback.textContent = progress+'%';
-			} else {
-				this.playback.textContent = "Play";
-			}
-		};
-        this.error = function() {
+
+        };
+
+        this.enable = function () {
+            if (this.parent.state == 1) {
+                $(this.selector).removeClass('disabled');
+                this.playback.disabled = false;
+            }
+        };
+        this.updateLoading = function (progress) {
+            if (progress != 100) {
+                progress = String(progress);
+                progress = progress.split('.')[0];
+                this.playback.textContent = progress + '%';
+            } else {
+                this.playback.textContent = "Play";
+            }
+        };
+        this.error = function () {
             // audioObject has an error!!
             this.playback.textContent = "Error";
             $(this.playback).addClass("error-colour");
         }
-        this.startPlayback = function()
-        {
+        this.startPlayback = function () {
             if (this.parent.specification.parent.playOne || specification.playOne) {
                 $('.comparator-button').text('Wait');
-                $('.comparator-button').attr("disabled","true");
-                $(this.playback).removeAttr("disabled");
+                $('.comparator-button').attr("disabled", "true");
+                $(this.playback).css("disabled", "false");
             } else {
                 $('.comparator-button').text('Listen');
             }
             $(this.playback).text('Stop');
-            this.playback.setAttribute("playstate","playing");
+            this.playback.setAttribute("playstate", "playing");
         };
-        this.stopPlayback = function()
-        {
+        this.stopPlayback = function () {
             if (this.playback.getAttribute("playstate") == "playing") {
                 $('.comparator-button').text('Listen');
                 $('.comparator-button').removeAttr("disabled");
-                this.playback.setAttribute("playstate","ready");
+                this.playback.setAttribute("playstate", "ready");
             }
         };
-		this.exportXMLDOM = function(audioObject)
-		{
-			var node = storage.document.createElement('value');
-			node.textContent = this.value;
-			return node;
-		};
-		this.getValue = function() {
-			return this.value;	
-		};
-		this.getPresentedId = function()
-		{
-			return this.selector.children[0].textContent;
-		};
-		this.canMove = function()
-		{
-			return false;
-		};
-	};
-	
-	this.boxHolders = document.getElementById('box-holders');
-	this.boxHolders.innerHTML = "";
-	this.comparators = [];
-	this.selected = null;
-	
-	// First generate the Audio Objects for the Audio Engine
-	for (var index=0; index<audioHolderObject.audioElements.length; index++)
-	{
-		var element = audioHolderObject.audioElements[index];
+        this.exportXMLDOM = function (audioObject) {
+            var node = storage.document.createElement('value');
+            node.textContent = this.value;
+            return node;
+        };
+        this.getValue = function () {
+            return this.value;
+        };
+        this.getPresentedId = function () {
+            return this.selector.children[0].textContent;
+        };
+        this.canMove = function () {
+            return false;
+        };
+    };
+
+    this.boxHolders = document.getElementById('box-holders');
+    this.boxHolders.innerHTML = "";
+    this.comparators = [];
+    this.selected = null;
+
+    // First generate the Audio Objects for the Audio Engine
+    var label = audioHolderObject.labelStart;
+    if (label == "") {
+        switch (audioHolderObject.label) {
+            case "number":
+                label = "1";
+                break;
+            case "letter":
+                label = "a";
+                break;
+            case "none":
+                label = "";
+                break;
+            case "capital":
+            default:
+                label = "A";
+                break;
+        }
+    } else {
+        switch (audioHolderObject.label) {
+            case "number":
+                if (!isFinite(Number(label))) {
+                    label = "1";
+                }
+                break;
+            case "letter":
+                if (label.charCodeAt(0) < 97 || label.charCodeAt(0) > 122) {
+                    label = "a";
+                }
+                break;
+            case "none":
+                label = "";
+                break;
+            case "capital":
+            default:
+                if (label.charCodeAt(0) < 65 || label.charCodeAt(0) > 90) {
+                    label = "A";
+                }
+                break;
+        }
+    }
+    for (var index = 0; index < audioHolderObject.audioElements.length; index++) {
+        var element = audioHolderObject.audioElements[index];
         var audioObject = audioEngineContext.newTrack(element);
-		if (index == audioHolderObject.outsideReference || element.type == 'outside-reference')
-		{
-            var orNode = new interfaceContext.outsideReferenceDOM(audioObject,index,document.getElementById("outside-reference-holder"));
-			audioObject.bindInterface(orNode);
+        if (index == audioHolderObject.outsideReference || element.type == 'outside-reference') {
+            var orNode = new interfaceContext.outsideReferenceDOM(audioObject, index, document.getElementById("outside-reference-holder"));
+            audioObject.bindInterface(orNode);
         } else {
-            var label;
-            switch(audioObject.specification.parent.label) {
+            var node = new this.comparatorBox(audioObject, index, label);
+            switch (audioHolderObject.label) {
                 case "none":
                     label = "";
                     break;
                 case "number":
-                    label = ""+index;
+                    label = (Number(label) + 1).toString(10);
                     break;
                 case "letter":
-                    label = String.fromCharCode(97 + index);
+                    label = String.fromCharCode((label.charCodeAt(0) - 96) % 26 + 97);
                     break;
+                case "capital":
                 default:
-                    label = String.fromCharCode(65 + index);
+                    label = String.fromCharCode((label.charCodeAt(0) - 64) % 26 + 65);
                     break;
             }
-            var node = new this.comparatorBox(audioObject,index,label);
             audioObject.bindInterface(node);
             this.comparators.push(node);
             this.boxHolders.appendChild(node.box);
         }
-	}
-	return this;
+    }
+    return this;
 }
 
-function resizeWindow(event)
-{
-	document.getElementById('submit').style.left = (window.innerWidth-250)/2 + 'px';
-	var numObj = interfaceContext.comparator.comparators.length;
-	var boxW = numObj*312;
+function resizeWindow(event) {
+    document.getElementById('submit').style.left = (window.innerWidth - 250) / 2 + 'px';
+    var numObj = interfaceContext.comparator.comparators.length;
+    var boxW = numObj * 312;
     var diff = window.innerWidth - boxW;
-    while (diff < 0)
-    {
-        numObj = Math.ceil(numObj/2);
-        boxW = numObj*312;
+    while (diff < 0) {
+        numObj = Math.ceil(numObj / 2);
+        boxW = numObj * 312;
         diff = window.innerWidth - boxW;
     }
-    document.getElementById('box-holders').style.marginLeft = diff/2 + 'px';
-    document.getElementById('box-holders').style.marginRight = diff/2 + 'px';
+    document.getElementById('box-holders').style.marginLeft = diff / 2 + 'px';
+    document.getElementById('box-holders').style.marginRight = diff / 2 + 'px';
     document.getElementById('box-holders').style.width = boxW + 'px';
-    
+
     var outsideRef = document.getElementById('outside-reference');
-	if(outsideRef != null)
-	{
-		outsideRef.style.left = (window.innerWidth-120)/2 + 'px';
-	}
+    if (outsideRef != null) {
+        outsideRef.style.left = (window.innerWidth - 120) / 2 + 'px';
+    }
 }
 
-function buttonSubmitClick()
-{
-	var checks = [];
-	checks = checks.concat(testState.currentStateMap.interfaces[0].options);
-	checks = checks.concat(specification.interfaces.options);
-	var canContinue = true;
-	
-	for (var i=0; i<checks.length; i++) {
-		if (checks[i].type == 'check')
-		{
-			switch(checks[i].name) {
-			case 'fragmentPlayed':
-				// Check if all fragments have been played
-				var checkState = interfaceContext.checkAllPlayed();
-				if (checkState == false) {canContinue = false;}
-				break;
-			case  'fragmentFullPlayback':
-				// Check all fragments have been played to their full length
-				var checkState = interfaceContext.checkFragmentsFullyPlayed();
-				if (checkState == false) {canContinue = false;}
-				break;
-			case 'fragmentMoved':
-				// Check all fragment sliders have been moved.
-				var checkState = interfaceContext.checkAllMoved();
-				if (checkState == false) {canContinue = false;}
-				break;
-			case 'fragmentComments':
-				// Check all fragment sliders have been moved.
-				var checkState = interfaceContext.checkAllCommented();
-				if (checkState == false) {canContinue = false;}
-				break;
-            case 'scalerange':
-                // Check the scale has been used effectively
-                var checkState = interfaceContext.checkScaleRange(checks[i].min,checks[i].max);
-                if (checkState == false) {canContinue = false;}
-				break;
-			default:
-				console.log("WARNING - Check option "+checks[i].check+" is not supported on this interface");
-				break;
-			}
+function buttonSubmitClick() {
+    var checks = [];
+    checks = checks.concat(testState.currentStateMap.interfaces[0].options);
+    checks = checks.concat(specification.interfaces.options);
+    var canContinue = true;
 
-		}
-		if (!canContinue) {break;}
-	}
-	if (canContinue)
-	{
-	    if (audioEngineContext.status == 1) {
-	        var playback = document.getElementById('playback-button');
-	        playback.click();
-	    // This function is called when the submit button is clicked. Will check for any further tests to perform, or any post-test options
-	    } else
-	    {
-	        if (audioEngineContext.timer.testStarted == false)
-	        {
-	            interfaceContext.lightbox.post("Warning",'You have not started the test! Please click play on a sample to begin the test!');
-	            return;
-	        }
-	    }
-	    testState.advanceState();
-	}
+    for (var i = 0; i < checks.length; i++) {
+        if (checks[i].type == 'check') {
+            switch (checks[i].name) {
+                case 'fragmentPlayed':
+                    // Check if all fragments have been played
+                    var checkState = interfaceContext.checkAllPlayed();
+                    if (checkState == false) {
+                        canContinue = false;
+                    }
+                    break;
+                case 'fragmentFullPlayback':
+                    // Check all fragments have been played to their full length
+                    var checkState = interfaceContext.checkFragmentsFullyPlayed();
+                    if (checkState == false) {
+                        canContinue = false;
+                    }
+                    break;
+                case 'fragmentMoved':
+                    // Check all fragment sliders have been moved.
+                    var checkState = interfaceContext.checkAllMoved();
+                    if (checkState == false) {
+                        canContinue = false;
+                    }
+                    break;
+                case 'fragmentComments':
+                    // Check all fragment sliders have been moved.
+                    var checkState = interfaceContext.checkAllCommented();
+                    if (checkState == false) {
+                        canContinue = false;
+                    }
+                    break;
+                case 'scalerange':
+                    // Check the scale has been used effectively
+                    var checkState = interfaceContext.checkScaleRange(checks[i].min, checks[i].max);
+                    if (checkState == false) {
+                        canContinue = false;
+                    }
+                    break;
+                default:
+                    console.log("WARNING - Check option " + checks[i].check + " is not supported on this interface");
+                    break;
+            }
+
+        }
+        if (!canContinue) {
+            break;
+        }
+    }
+    if (canContinue) {
+        if (audioEngineContext.status == 1) {
+            var playback = document.getElementById('playback-button');
+            playback.click();
+            // This function is called when the submit button is clicked. Will check for any further tests to perform, or any post-test options
+        } else {
+            if (audioEngineContext.timer.testStarted == false) {
+                interfaceContext.lightbox.post("Warning", 'You have not started the test! Please click play on a sample to begin the test!');
+                return;
+            }
+        }
+        testState.advanceState();
+    }
 }
 
-function pageXMLSave(store, pageSpecification)
-{
-	// MANDATORY
-	// Saves a specific test page
-	// You can use this space to add any extra nodes to your XML <audioHolder> saves
-	// Get the current <page> information in store (remember to appendChild your data to it)
-	// pageSpecification is the current page node configuration
-	// To create new XML nodes, use storage.document.createElement();
-}
\ No newline at end of file
+function pageXMLSave(store, pageSpecification) {
+    // MANDATORY
+    // Saves a specific test page
+    // You can use this space to add any extra nodes to your XML <audioHolder> saves
+    // Get the current <page> information in store (remember to appendChild your data to it)
+    // pageSpecification is the current page node configuration
+    // To create new XML nodes, use storage.document.createElement();
+}
--- a/interfaces/timeline.js	Mon Nov 14 12:11:38 2016 +0000
+++ b/interfaces/timeline.js	Mon Nov 14 12:14:38 2016 +0000
@@ -506,7 +506,7 @@
                     break;
             }
             if (checkState == false) {
-                canContinue == false;
+                canContinue = false;
             }
         }
         if (!canContinue) {
--- a/js/core.js	Mon Nov 14 12:11:38 2016 +0000
+++ b/js/core.js	Mon Nov 14 12:14:38 2016 +0000
@@ -922,6 +922,33 @@
             console.log("Checkbox: " + node.specification.statement);
             var inputs = this.popupResponse.getElementsByTagName('input');
             node.response = [];
+            var numChecked = 0;
+            for (var i = 0; i < node.specification.options.length; i++) {
+                if (inputs[i].checked) {
+                    numChecked++;
+                }
+            }
+            if (node.specification.min != undefined) {
+                if (node.specification.max == undefined) {
+                    if (numChecked < node.specification.min) {
+                        var msg = "You must select at least " + node.specification.min + " option";
+                        if (node.specification.min > 1) {
+                            msg += "s";
+                        }
+                        interfaceContext.lightbox.post("Error", msg);
+                        return;
+                    }
+                } else {
+                    if (numChecked < node.specification.min || numChecked > node.specification.max) {
+                        if (node.specification.min == node.specification.max) {
+                            interfaceContext.lightbox.post("Error", "You must only select " + node.specification.min);
+                        } else {
+                            interfaceContext.lightbox.post("Error", "You must select between " + node.specification.min + " and " + node.specification.max);
+                        }
+                        return;
+                    }
+                }
+            }
             for (var i = 0; i < node.specification.options.length; i++) {
                 node.response.push({
                     name: node.specification.options[i].name,
@@ -1694,21 +1721,20 @@
     };
 
     this.setSynchronousLoop = function () {
-        // Pads the signals so they are all exactly the same length
-        // Get the length of the longest signal.
-        var length = 0;
+        // Pads the signals so they are all exactly the same duration
+        // Get the duration of the longest signal.
+        var duration = 0;
         var maxId;
         for (var i = 0; i < this.audioObjects.length; i++) {
-            if (length < this.audioObjects[i].buffer.buffer.length) {
-                length = this.audioObjects[i].buffer.buffer.length;
+            if (duration < this.audioObjects[i].buffer.buffer.duration) {
+                duration = this.audioObjects[i].buffer.buffer.duration;
                 maxId = i;
             }
         }
         // Extract the audio and zero-pad
         for (var ao of this.audioObjects) {
-            var lengthDiff = length - ao.buffer.buffer.length;
-            if (lengthDiff > 0) {
-                ao.buffer.buffer = ao.buffer.copyBuffer(0, samplesToSeconds(lengthDiff, ao.buffer.buffer.sampleRate));
+            if (ao.buffer.buffer.duration !== duration) {
+                ao.buffer.buffer = ao.buffer.copyBuffer(0, duration - ao.buffer.buffer.duration);
             }
         }
     };
@@ -3247,8 +3273,10 @@
                     break;
                 case "radio":
                     var child = this.parent.document.createElement('response');
-                    child.setAttribute('name', node.response.name);
-                    child.textContent = node.response.text;
+                    if (node.response !== null) {
+                        child.setAttribute('name', node.response.name);
+                        child.textContent = node.response.text;
+                    }
                     surveyresult.appendChild(child);
                     break;
                 case "checkbox":
--- a/js/specification.js	Mon Nov 14 12:11:38 2016 +0000
+++ b/js/specification.js	Mon Nov 14 12:14:38 2016 +0000
@@ -1,12 +1,12 @@
 function Specification() {
-	// Handles the decoding of the project specification XML into a simple JavaScript Object.
-	
+    // Handles the decoding of the project specification XML into a simple JavaScript Object.
+
     // <setup> attributes
-	this.interface = null;
-	this.projectReturn = null;
+    this.interface = null;
+    this.projectReturn = null;
     this.returnURL = null;
-	this.randomiseOrder = null;
-	this.poolSize = null;
+    this.randomiseOrder = null;
+    this.poolSize = null;
     this.loudness = null;
     this.sampleRate = null;
     this.calibration = null;
@@ -14,32 +14,31 @@
     this.preSilence = null;
     this.postSilence = null;
     this.playOne = null;
-    
+
     // nodes
     this.metrics = null;
     this.preTest = undefined;
     this.postTest = undefined;
-	this.pages = [];
-	this.interfaces = null;
-	this.errors = [];
-	this.schema = null;
+    this.pages = [];
+    this.interfaces = null;
+    this.errors = [];
+    this.schema = null;
     this.exitText = "Thank you.";
-	
-	this.processAttribute = function(attribute,schema,schemaRoot)
-	{
-		// attribute is the string returned from getAttribute on the XML
-		// schema is the <xs:attribute> node
-		if (schema.getAttribute('name') == undefined && schema.getAttribute('ref') != undefined)
-		{
-			schema = schemaRoot.getAllElementsByName(schema.getAttribute('ref'))[0];
-		}
-		var defaultOpt = schema.getAttribute('default');
-		if (attribute == null) {
-			attribute = defaultOpt;
-		}
-		var dataType = schema.getAttribute('type');
-		if (typeof dataType == "string") { dataType = dataType.substr(3);}
-		else {
+
+    this.processAttribute = function (attribute, schema, schemaRoot) {
+        // attribute is the string returned from getAttribute on the XML
+        // schema is the <xs:attribute> node
+        if (schema.getAttribute('name') == undefined && schema.getAttribute('ref') != undefined) {
+            schema = schemaRoot.getAllElementsByName(schema.getAttribute('ref'))[0];
+        }
+        var defaultOpt = schema.getAttribute('default');
+        if (attribute == null) {
+            attribute = defaultOpt;
+        }
+        var dataType = schema.getAttribute('type');
+        if (typeof dataType == "string") {
+            dataType = dataType.substr(3);
+        } else {
             var rest = schema.getAllElementsByTagName("xs:restriction").concat(schema.getAllElementsByTagName("xs:enumeration"));
             if (rest.length > 0) {
                 dataType = rest[0].getAttribute("base");
@@ -52,129 +51,122 @@
                 dataType = "string";
             }
         }
-		if (attribute == null)
-		{
-			return attribute;
-		}
-		switch(dataType)
-		{
-		case "boolean":
-			if (attribute == 'true'){attribute = true;}else{attribute=false;}
-			break;
-		case "negativeInteger":
-		case "positiveInteger":
-		case "nonNegativeInteger":
-		case "nonPositiveInteger":
-		case "integer":
-		case "decimal":
-		case "short":
-			attribute = Number(attribute);
-			break;
-		case "string":
-		default:
-			attribute = String(attribute);
-			break;
-		}
-		return attribute;
-	};
-	
-	this.decode = function(projectXML) {
-		this.errors = [];
-		// projectXML - DOM Parsed document
-		this.projectXML = projectXML.childNodes[0];
-		var setupNode = projectXML.getElementsByTagName('setup')[0];
-		var schemaSetup = this.schema.getAllElementsByName('setup')[0];
-		// First decode the attributes
-		var attributes = schemaSetup.getAllElementsByTagName('xs:attribute');
-		for (var i=0; i<attributes.length; i++)
-		{
-			var attributeName = attributes[i].getAttribute('name') || attributes[i].getAttribute('ref');
-			var projectAttr = setupNode.getAttribute(attributeName);
-			projectAttr = this.processAttribute(projectAttr,attributes[i],this.schema);
-			switch(typeof projectAttr)
-			{
-			case "number":
-			case "boolean":
-				eval('this.'+attributeName+' = '+projectAttr);
-				break;
-			case "string":
-				eval('this.'+attributeName+' = "'+projectAttr+'"');
-				break;
-			}
-			
-		}
-        
+        if (attribute == null) {
+            return attribute;
+        }
+        switch (dataType) {
+            case "boolean":
+                if (attribute == 'true') {
+                    attribute = true;
+                } else {
+                    attribute = false;
+                }
+                break;
+            case "negativeInteger":
+            case "positiveInteger":
+            case "nonNegativeInteger":
+            case "nonPositiveInteger":
+            case "integer":
+            case "decimal":
+            case "short":
+                attribute = Number(attribute);
+                break;
+            case "string":
+            default:
+                attribute = String(attribute);
+                break;
+        }
+        return attribute;
+    };
+
+    this.decode = function (projectXML) {
+        this.errors = [];
+        // projectXML - DOM Parsed document
+        this.projectXML = projectXML.childNodes[0];
+        var setupNode = projectXML.getElementsByTagName('setup')[0];
+        var schemaSetup = this.schema.getAllElementsByName('setup')[0];
+        // First decode the attributes
+        var attributes = schemaSetup.getAllElementsByTagName('xs:attribute');
+        for (var i = 0; i < attributes.length; i++) {
+            var attributeName = attributes[i].getAttribute('name') || attributes[i].getAttribute('ref');
+            var projectAttr = setupNode.getAttribute(attributeName);
+            projectAttr = this.processAttribute(projectAttr, attributes[i], this.schema);
+            switch (typeof projectAttr) {
+                case "number":
+                case "boolean":
+                    eval('this.' + attributeName + ' = ' + projectAttr);
+                    break;
+                case "string":
+                    eval('this.' + attributeName + ' = "' + projectAttr + '"');
+                    break;
+            }
+
+        }
+
         var exitTextNode = setupNode.getElementsByTagName('exitText');
         if (exitTextNode.length == 1) {
             this.exitText = exitTextNode[0].textContent;
         }
-		
-		this.metrics = new this.metricNode();
-		
-		this.metrics.decode(this,setupNode.getElementsByTagName('metric')[0]);
-		
-		// Now process the survey node options
-		var survey = setupNode.getElementsByTagName('survey');
-		for (var i=0; i<survey.length; i++){
-			var location = survey[i].getAttribute('location');
-            switch(location)
-            {
+
+        this.metrics = new this.metricNode();
+
+        this.metrics.decode(this, setupNode.getElementsByTagName('metric')[0]);
+
+        // Now process the survey node options
+        var survey = setupNode.getElementsByTagName('survey');
+        for (var i = 0; i < survey.length; i++) {
+            var location = survey[i].getAttribute('location');
+            switch (location) {
                 case 'pre':
                 case 'before':
-	            this.preTest = new this.surveyNode(this);
-	            this.preTest.decode(this,survey[i]);
+                    this.preTest = new this.surveyNode(this);
+                    this.preTest.decode(this, survey[i]);
                     break;
                 case 'post':
                 case 'after':
                     this.postTest = new this.surveyNode(this);
-                    this.postTest.decode(this,survey[i]);
+                    this.postTest.decode(this, survey[i]);
                     break;
             }
-		}
-		
-		var interfaceNode = setupNode.getElementsByTagName('interface');
-		if (interfaceNode.length > 1)
-		{
-			this.errors.push("Only one <interface> node in the <setup> node allowed! Others except first ingnored!");
-		}
-		this.interfaces = new this.interfaceNode(this);
-		if (interfaceNode.length != 0)
-		{
-			interfaceNode = interfaceNode[0];
-			this.interfaces.decode(this,interfaceNode,this.schema.getAllElementsByName('interface')[1]);
-		}
-		
-		// Page tags
-		var pageTags = projectXML.getElementsByTagName('page');
-		var pageSchema = this.schema.getAllElementsByName('page')[0];
-		for (var i=0; i<pageTags.length; i++)
-		{
-			var node = new this.page(this);
-			node.decode(this,pageTags[i],pageSchema);
-			this.pages.push(node);
-		}
-	};
-	
-	this.encode = function()
-	{
-		var RootDocument = document.implementation.createDocument(null,"waet");
-		var root = RootDocument.firstChild;
-        root.setAttribute("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance");
-        root.setAttribute("xsi:noNamespaceSchemaLocation","test-schema.xsd");
-		// Build setup node
+        }
+
+        var interfaceNode = setupNode.getElementsByTagName('interface');
+        if (interfaceNode.length > 1) {
+            this.errors.push("Only one <interface> node in the <setup> node allowed! Others except first ingnored!");
+        }
+        this.interfaces = new this.interfaceNode(this);
+        if (interfaceNode.length != 0) {
+            interfaceNode = interfaceNode[0];
+            this.interfaces.decode(this, interfaceNode, this.schema.getAllElementsByName('interface')[1]);
+        }
+
+        // Page tags
+        var pageTags = projectXML.getElementsByTagName('page');
+        var pageSchema = this.schema.getAllElementsByName('page')[0];
+        for (var i = 0; i < pageTags.length; i++) {
+            var node = new this.page(this);
+            node.decode(this, pageTags[i], pageSchema);
+            this.pages.push(node);
+        }
+    };
+
+    this.encode = function () {
+        var RootDocument = document.implementation.createDocument(null, "waet");
+        var root = RootDocument.firstChild;
+        root.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
+        root.setAttribute("xsi:noNamespaceSchemaLocation", "test-schema.xsd");
+        // Build setup node
         var setup = RootDocument.createElement("setup");
         var schemaSetup = this.schema.getAllElementsByName('setup')[0];
         // First decode the attributes
         var attributes = schemaSetup.getAllElementsByTagName('xs:attribute');
-        for (var i=0; i<attributes.length; i++)
-        {
+        for (var i = 0; i < attributes.length; i++) {
             var name = attributes[i].getAttribute("name");
             if (name == undefined) {
                 name = attributes[i].getAttribute("ref");
             }
-            if(eval("this."+name+" != undefined") || attributes[i].getAttribute("use") == "required")
-            {
-                eval("setup.setAttribute('"+name+"',this."+name+")");
+            if (eval("this." + name + " != undefined") || attributes[i].getAttribute("use") == "required") {
+                eval("setup.setAttribute('" + name + "',this." + name + ")");
             }
         }
         root.appendChild(setup);
@@ -188,73 +180,71 @@
         setup.appendChild(this.postTest.encode(RootDocument));
         setup.appendChild(this.metrics.encode(RootDocument));
         setup.appendChild(this.interfaces.encode(RootDocument));
-        for (var page of this.pages)
-        {
+        for (var page of this.pages) {
             root.appendChild(page.encode(RootDocument));
         }
-		return RootDocument;
-	};
-	
-	this.surveyNode = function(specification) {
-		this.location = null;
-		this.options = [];
+        return RootDocument;
+    };
+
+    this.surveyNode = function (specification) {
+        this.location = null;
+        this.options = [];
         this.parent = null;
-		this.schema = specification.schema.getAllElementsByName('survey')[0];
+        this.schema = specification.schema.getAllElementsByName('survey')[0];
         this.specification = specification;
-		
-		this.OptionNode = function(specification) {
-			this.type = undefined;
-			this.schema = specification.schema.getAllElementsByName('surveyentry')[0];
-			this.id = undefined;
+
+        this.OptionNode = function (specification) {
+            this.type = undefined;
+            this.schema = specification.schema.getAllElementsByName('surveyentry')[0];
+            this.id = undefined;
             this.name = undefined;
-			this.mandatory = undefined;
-			this.statement = undefined;
-			this.boxsize = undefined;
-			this.options = [];
-			this.min = undefined;
-			this.max = undefined;
-			this.step = undefined;
+            this.mandatory = undefined;
+            this.statement = undefined;
+            this.boxsize = undefined;
+            this.options = [];
+            this.min = undefined;
+            this.max = undefined;
+            this.step = undefined;
             this.conditions = [];
-			
-			this.decode = function(parent,child)
-			{
-				var attributeMap = this.schema.getAllElementsByTagName('xs:attribute');
-				for (var i in attributeMap){
-					if(isNaN(Number(i)) == true){break;}
-					var attributeName = attributeMap[i].getAttribute('name') || attributeMap[i].getAttribute('ref');
-					var projectAttr = child.getAttribute(attributeName);
-					projectAttr = parent.processAttribute(projectAttr,attributeMap[i],parent.schema);
-					switch(typeof projectAttr)
-					{
-					case "number":
-					case "boolean":
-						eval('this.'+attributeName+' = '+projectAttr);
-						break;
-					case "string":
-						eval('this.'+attributeName+' = "'+projectAttr+'"');
-						break;
-					}
-				}
-				this.statement = child.getElementsByTagName('statement')[0].textContent;
-				if (this.type == "checkbox" || this.type == "radio") {
-					var children = child.getElementsByTagName('option');
-					if (children.length == null) {
-						console.log('Malformed' +child.nodeName+ 'entry');
-						this.statement = 'Malformed' +child.nodeName+ 'entry';
-						this.type = 'statement';
-					} else {
-						this.options = [];
-						for (var i=0; i<children.length; i++)
-						{
-							this.options.push({
-								name: children[i].getAttribute('name'),
-								text: children[i].textContent
-							});
-						}
-					}
-				}
+
+            this.decode = function (parent, child) {
+                var attributeMap = this.schema.getAllElementsByTagName('xs:attribute');
+                for (var i in attributeMap) {
+                    if (isNaN(Number(i)) == true) {
+                        break;
+                    }
+                    var attributeName = attributeMap[i].getAttribute('name') || attributeMap[i].getAttribute('ref');
+                    var projectAttr = child.getAttribute(attributeName);
+                    projectAttr = parent.processAttribute(projectAttr, attributeMap[i], parent.schema);
+                    switch (typeof projectAttr) {
+                        case "number":
+                        case "boolean":
+                            eval('this.' + attributeName + ' = ' + projectAttr);
+                            break;
+                        case "string":
+                            eval('this.' + attributeName + ' = "' + projectAttr + '"');
+                            break;
+                    }
+                }
+                this.statement = child.getElementsByTagName('statement')[0].textContent;
+                if (this.type == "checkbox" || this.type == "radio") {
+                    var children = child.getElementsByTagName('option');
+                    if (children.length == null) {
+                        console.log('Malformed' + child.nodeName + 'entry');
+                        this.statement = 'Malformed' + child.nodeName + 'entry';
+                        this.type = 'statement';
+                    } else {
+                        this.options = [];
+                        for (var i = 0; i < children.length; i++) {
+                            this.options.push({
+                                name: children[i].getAttribute('name'),
+                                text: children[i].textContent
+                            });
+                        }
+                    }
+                }
                 var conditionElements = child.getElementsByTagName("conditional");
-                for (var i=0; i<conditionElements.length; i++) {
+                for (var i = 0; i < conditionElements.length; i++) {
                     var condition = conditionElements[i];
                     var obj = {
                         check: condition.getAttribute("check"),
@@ -264,185 +254,215 @@
                     }
                     this.conditions.push(obj);
                 }
-			};
-			
-			this.exportXML = function(doc)
-			{
-				var node = doc.createElement('surveyentry');
-				node.setAttribute('type',this.type);
-				var statement = doc.createElement('statement');
-				statement.textContent = this.statement;
-				node.appendChild(statement);
+            };
+
+            this.exportXML = function (doc) {
+                var node = doc.createElement('surveyentry');
+                node.setAttribute('type', this.type);
+                var statement = doc.createElement('statement');
+                statement.textContent = this.statement;
+                node.appendChild(statement);
                 node.id = this.id;
-                if (this.name != undefined) { node.setAttribute("name",this.name);}
-                if (this.mandatory != undefined) { node.setAttribute("mandatory",this.mandatory);}
+                if (this.name != undefined) {
+                    node.setAttribute("name", this.name);
+                }
+                if (this.mandatory != undefined) {
+                    node.setAttribute("mandatory", this.mandatory);
+                }
                 node.id = this.id;
-                if (this.name != undefined) {node.setAttribute("name",this.name);}
-                switch(this.type)
-                {
+                if (this.name != undefined) {
+                    node.setAttribute("name", this.name);
+                }
+                switch (this.type) {
                     case "checkbox":
+                        if (this.min != undefined) {
+                            node.setAttribute("min", this.min);
+                        } else {
+                            node.setAttribute("min", "0");
+                        }
+                        if (this.max != undefined) {
+                            node.setAttribute("max", this.max);
+                        } else {
+                            node.setAttribute("max", "undefined");
+                        }
                     case "radio":
-                        for (var i=0; i<this.options.length; i++)
-                        {
+                        for (var i = 0; i < this.options.length; i++) {
                             var option = this.options[i];
                             var optionNode = doc.createElement("option");
-                            optionNode.setAttribute("name",option.name);
+                            optionNode.setAttribute("name", option.name);
                             optionNode.textContent = option.text;
                             node.appendChild(optionNode);
                         }
+                        break;
                     case "number":
-                        if (this.min != undefined) {node.setAttribute("min", this.min);}
-                        if (this.max != undefined) {node.setAttribute("max", this.max);}
+                        if (this.min != undefined) {
+                            node.setAttribute("min", this.min);
+                        }
+                        if (this.max != undefined) {
+                            node.setAttribute("max", this.max);
+                        }
+                        break;
                     case "question":
-                        if (this.boxsize != undefined) {node.setAttribute("boxsize",this.boxsize);}
-                        if (this.mandatory != undefined) {node.setAttribute("mandatory",this.mandatory);}
+                        if (this.boxsize != undefined) {
+                            node.setAttribute("boxsize", this.boxsize);
+                        }
+                        if (this.mandatory != undefined) {
+                            node.setAttribute("mandatory", this.mandatory);
+                        }
+                        break;
+                    case "video":
+                        if (this.mandatory != undefined) {
+                            node.setAttribute("mandatory", this.mandatory);
+                        }
+                    case "youtube":
+                        if (this.url != undefined) {
+                            node.setAttribute("url", this.url);
+                        }
+                        break;
                     default:
                         break;
                 }
                 for (var condition of this.conditions) {
                     var conditionDOM = doc.createElement("conditional");
-                    conditionDOM.setAttribute("check",condition.check);
-                    conditionDOM.setAttribute("value",condition.value);
-                    conditionDOM.setAttribute("jumpToOnPass",condition.jumpToOnPass);
-                    conditionDOM.setAttribute("jumpToOnFail",condition.jumpToOnFail);
+                    conditionDOM.setAttribute("check", condition.check);
+                    conditionDOM.setAttribute("value", condition.value);
+                    conditionDOM.setAttribute("jumpToOnPass", condition.jumpToOnPass);
+                    conditionDOM.setAttribute("jumpToOnFail", condition.jumpToOnFail);
                     node.appendChild(conditionDOM);
                 }
-				return node;
-			};
-		};
-		this.decode = function(parent,xml) {
+                return node;
+            };
+        };
+        this.decode = function (parent, xml) {
             this.parent = parent;
-			this.location = xml.getAttribute('location');
-			if (this.location == 'before'){this.location = 'pre';}
-			else if (this.location == 'after'){this.location = 'post';}
+            this.location = xml.getAttribute('location');
+            if (this.location == 'before') {
+                this.location = 'pre';
+            } else if (this.location == 'after') {
+                this.location = 'post';
+            }
             var children = xml.getAllElementsByTagName('surveyentry');
-			for (var i=0; i<children.length; i++)
-			{
-				var node = new this.OptionNode(this.specification);
-				node.decode(parent,children[i]);
-				this.options.push(node);
-			}
+            for (var i = 0; i < children.length; i++) {
+                var node = new this.OptionNode(this.specification);
+                node.decode(parent, children[i]);
+                this.options.push(node);
+            }
             if (this.options.length == 0) {
                 console.log("Empty survey node");
                 console.log(this);
             }
-		};
-		this.encode = function(doc) {
-			var node = doc.createElement('survey');
-			node.setAttribute('location',this.location);
-			for (var i=0; i<this.options.length; i++)
-			{
-				node.appendChild(this.options[i].exportXML(doc));
-			}
-			return node;
-		};
-	};
-	
-	this.interfaceNode = function(specification)
-	{
-		this.title = null;
-		this.name = null;
-		this.options = [];
-		this.scales = [];
-		this.schema = specification.schema.getAllElementsByName('interface')[1];
-		
-		this.decode = function(parent,xml) {
-			this.name = xml.getAttribute('name');
-			var titleNode = xml.getElementsByTagName('title');
-			if (titleNode.length == 1)
-			{
-				this.title = titleNode[0].textContent;
-			}
-			var interfaceOptionNodes = xml.getElementsByTagName('interfaceoption');
-			// Extract interfaceoption node schema
-			var interfaceOptionNodeSchema = this.schema.getAllElementsByName('interfaceoption')[0];
-			var attributeMap = interfaceOptionNodeSchema.getAllElementsByTagName('xs:attribute');
-			for (var i=0; i<interfaceOptionNodes.length; i++)
-			{
-				var ioNode = interfaceOptionNodes[i];
-				var option = {};
-				for (var j=0; j<attributeMap.length; j++)
-				{
-					var attributeName = attributeMap[j].getAttribute('name') || attributeMap[j].getAttribute('ref');
-					var projectAttr = ioNode.getAttribute(attributeName);
-                    if(parent.processAttribute) {
+        };
+        this.encode = function (doc) {
+            var node = doc.createElement('survey');
+            node.setAttribute('location', this.location);
+            for (var i = 0; i < this.options.length; i++) {
+                node.appendChild(this.options[i].exportXML(doc));
+            }
+            return node;
+        };
+    };
+
+    this.interfaceNode = function (specification) {
+        this.title = null;
+        this.name = null;
+        this.options = [];
+        this.scales = [];
+        this.schema = specification.schema.getAllElementsByName('interface')[1];
+
+        this.decode = function (parent, xml) {
+            this.name = xml.getAttribute('name');
+            var titleNode = xml.getElementsByTagName('title');
+            if (titleNode.length == 1) {
+                this.title = titleNode[0].textContent;
+            }
+            var interfaceOptionNodes = xml.getElementsByTagName('interfaceoption');
+            // Extract interfaceoption node schema
+            var interfaceOptionNodeSchema = this.schema.getAllElementsByName('interfaceoption')[0];
+            var attributeMap = interfaceOptionNodeSchema.getAllElementsByTagName('xs:attribute');
+            for (var i = 0; i < interfaceOptionNodes.length; i++) {
+                var ioNode = interfaceOptionNodes[i];
+                var option = {};
+                for (var j = 0; j < attributeMap.length; j++) {
+                    var attributeName = attributeMap[j].getAttribute('name') || attributeMap[j].getAttribute('ref');
+                    var projectAttr = ioNode.getAttribute(attributeName);
+                    if (parent.processAttribute) {
                         parent.processAttribute(projectAttr, attributeMap[j], parent.schema)
                     } else {
                         parent.parent.processAttribute(projectAttr, attributeMap[j], parent.parent.schema)
                     }
-					switch(typeof projectAttr)
-					{
-					case "number":
-					case "boolean":
-						eval('option.'+attributeName+' = '+projectAttr);
-						break;
-					case "string":
-						eval('option.'+attributeName+' = "'+projectAttr+'"');
-						break;
-					}
-				}
-				this.options.push(option);
-			}
-			
-			// Now the scales nodes
-			var scaleParent = xml.getElementsByTagName('scales');
-			if (scaleParent.length == 1) {
-				scaleParent = scaleParent[0];
+                    switch (typeof projectAttr) {
+                        case "number":
+                        case "boolean":
+                            eval('option.' + attributeName + ' = ' + projectAttr);
+                            break;
+                        case "string":
+                            eval('option.' + attributeName + ' = "' + projectAttr + '"');
+                            break;
+                    }
+                }
+                this.options.push(option);
+            }
+
+            // Now the scales nodes
+            var scaleParent = xml.getElementsByTagName('scales');
+            if (scaleParent.length == 1) {
+                scaleParent = scaleParent[0];
                 var scalelabels = scaleParent.getAllElementsByTagName('scalelabel');
-				for (var i=0; i<scalelabels.length; i++) {
-					this.scales.push({
-						text: scalelabels[i].textContent,
-						position: Number(scalelabels[i].getAttribute('position'))
-					});
-				}
-			}
-		};
-		
-		this.encode = function(doc) {
-			var node = doc.createElement("interface");
+                for (var i = 0; i < scalelabels.length; i++) {
+                    this.scales.push({
+                        text: scalelabels[i].textContent,
+                        position: Number(scalelabels[i].getAttribute('position'))
+                    });
+                }
+            }
+        };
+
+        this.encode = function (doc) {
+            var node = doc.createElement("interface");
             if (typeof name == "string")
-                node.setAttribute("name",this.name);
+                node.setAttribute("name", this.name);
             if (typeof this.title == "string") {
                 var titleNode = doc.createElement("title");
                 titleNode.textContent = this.title;
                 node.appendChild(titleNode);
             }
-            for (var option of this.options)
-            {
+            for (var option of this.options) {
                 var child = doc.createElement("interfaceoption");
-                child.setAttribute("type",option.type);
-                child.setAttribute("name",option.name);
+                child.setAttribute("type", option.type);
+                child.setAttribute("name", option.name);
                 node.appendChild(child);
             }
             if (this.scales.length != 0) {
                 var scales = doc.createElement("scales");
-                for (var scale of this.scales)
-                {
+                for (var scale of this.scales) {
                     var child = doc.createElement("scalelabel");
-                    child.setAttribute("position",scale.position);
+                    child.setAttribute("position", scale.position);
                     child.textContent = scale.text;
                     scales.appendChild(child);
                 }
                 node.appendChild(scales);
             }
             return node;
-		};
-	};
-	
-    this.metricNode = function() {
+        };
+    };
+
+    this.metricNode = function () {
         this.enabled = [];
-        this.decode = function(parent, xml) {
+        this.decode = function (parent, xml) {
             var children = xml.getElementsByTagName('metricenable');
-            for (var i in children) { 
-                if (isNaN(Number(i)) == true){break;}
+            for (var i in children) {
+                if (isNaN(Number(i)) == true) {
+                    break;
+                }
                 this.enabled.push(children[i].textContent);
             }
         }
-        this.encode = function(doc) {
+        this.encode = function (doc) {
             var node = doc.createElement('metric');
-            for (var i in this.enabled)
-            {
-                if (isNaN(Number(i)) == true){break;}
+            for (var i in this.enabled) {
+                if (isNaN(Number(i)) == true) {
+                    break;
+                }
                 var child = doc.createElement('metricenable');
                 child.textContent = this.enabled[i];
                 node.appendChild(child);
@@ -450,30 +470,30 @@
             return node;
         }
     }
-    
-	this.page = function(specification) {
-		this.presentedId = undefined;
-		this.id = undefined;
+
+    this.page = function (specification) {
+        this.presentedId = undefined;
+        this.id = undefined;
         this.title = undefined;
-		this.hostURL = undefined;
-		this.randomiseOrder = undefined;
-		this.loop = undefined;
-		this.outsideReference = null;
-		this.loudness = null;
+        this.hostURL = undefined;
+        this.randomiseOrder = undefined;
+        this.loop = undefined;
+        this.outsideReference = null;
+        this.loudness = null;
         this.label = null;
-		this.preTest = null;
-		this.postTest = null;
-		this.interfaces = [];
+        this.labelStart = "";
+        this.preTest = null;
+        this.postTest = null;
+        this.interfaces = [];
         this.playOne = null;
-		this.commentBoxPrefix = "Comment on track";
-		this.audioElements = [];
-		this.commentQuestions = [];
-		this.schema = specification.schema.getAllElementsByName("page")[0];
+        this.commentBoxPrefix = "Comment on track";
+        this.audioElements = [];
+        this.commentQuestions = [];
+        this.schema = specification.schema.getAllElementsByName("page")[0];
         this.specification = specification;
         this.parent = null;
-		
-		this.decode = function(parent,xml)
-		{
+
+        this.decode = function (parent, xml) {
             this.parent = parent;
 			var attributeMap = this.schema.getAllElementsByTagName('xs:attribute');
 			for (var i=0; i<attributeMap.length; i++)
@@ -559,139 +579,129 @@
 			var AHNode = root.createElement("page");
             // First decode the attributes
             var attributes = this.schema.getAllElementsByTagName('xs:attribute');
-            for (var i=0; i<attributes.length; i++)
-            {
+            for (var i = 0; i < attributes.length; i++) {
                 var name = attributes[i].getAttribute("name");
                 if (name == undefined) {
                     name = attributes[i].getAttribute("ref");
                 }
-                if(eval("this."+name+" != undefined") || attributes[i].getAttribute("use") == "required")
-                {
-                    eval("AHNode.setAttribute('"+name+"',this."+name+")");
+                if (eval("this." + name + " != undefined") || attributes[i].getAttribute("use") == "required") {
+                    eval("AHNode.setAttribute('" + name + "',this." + name + ")");
                 }
             }
-			if(this.loudness != null) {AHNode.setAttribute("loudness",this.loudness);}
+            if (this.loudness != null) {
+                AHNode.setAttribute("loudness", this.loudness);
+            }
             // <commentboxprefix>
             var commentboxprefix = root.createElement("commentboxprefix");
             commentboxprefix.textContent = this.commentBoxPrefix;
             AHNode.appendChild(commentboxprefix);
-            
-			for (var i=0; i<this.interfaces.length; i++)
-			{
-				AHNode.appendChild(this.interfaces[i].encode(root));
-			}
-			
-			for (var i=0; i<this.audioElements.length; i++) {
-				AHNode.appendChild(this.audioElements[i].encode(root));
-			}
-			// Create <CommentQuestion>
-			for (var i=0; i<this.commentQuestions.length; i++)
-			{
-				AHNode.appendChild(this.commentQuestions[i].encode(root));
-			}
-			
-			AHNode.appendChild(this.preTest.encode(root));
+
+            for (var i = 0; i < this.interfaces.length; i++) {
+                AHNode.appendChild(this.interfaces[i].encode(root));
+            }
+
+            for (var i = 0; i < this.audioElements.length; i++) {
+                AHNode.appendChild(this.audioElements[i].encode(root));
+            }
+            // Create <CommentQuestion>
+            for (var i = 0; i < this.commentQuestions.length; i++) {
+                AHNode.appendChild(this.commentQuestions[i].encode(root));
+            }
+
+            AHNode.appendChild(this.preTest.encode(root));
             AHNode.appendChild(this.postTest.encode(root));
-			return AHNode;
-		};
-		
-		this.commentQuestionNode = function(specification) {
-			this.id = null;
+            return AHNode;
+        };
+
+        this.commentQuestionNode = function (specification) {
+            this.id = null;
             this.name = undefined;
-			this.type = undefined;
-			this.options = [];
-			this.statement = undefined;
-			this.schema = specification.schema.getAllElementsByName('commentquestion')[0];
-			this.decode = function(parent,xml)
-			{
-				this.id = xml.id;
+            this.type = undefined;
+            this.options = [];
+            this.statement = undefined;
+            this.schema = specification.schema.getAllElementsByName('commentquestion')[0];
+            this.decode = function (parent, xml) {
+                this.id = xml.id;
                 this.name = xml.getAttribute('name');
-				this.type = xml.getAttribute('type');
-				this.statement = xml.getElementsByTagName('statement')[0].textContent;
-				var optNodes = xml.getElementsByTagName('option');
-				for (var i=0; i<optNodes.length; i++)
-				{
-					var optNode = optNodes[i];
-					this.options.push({
-						name: optNode.getAttribute('name'),
-						text: optNode.textContent
-					});
-				}
-			};
-			
-			this.encode = function(root)
-			{
-				var node = root.createElement("commentquestion");
+                this.type = xml.getAttribute('type');
+                this.statement = xml.getElementsByTagName('statement')[0].textContent;
+                var optNodes = xml.getElementsByTagName('option');
+                for (var i = 0; i < optNodes.length; i++) {
+                    var optNode = optNodes[i];
+                    this.options.push({
+                        name: optNode.getAttribute('name'),
+                        text: optNode.textContent
+                    });
+                }
+            };
+
+            this.encode = function (root) {
+                var node = root.createElement("commentquestion");
                 node.id = this.id;
-                node.setAttribute("type",this.type);
-                if (this.name != undefined){node.setAttribute("name",this.name);}
+                node.setAttribute("type", this.type);
+                if (this.name != undefined) {
+                    node.setAttribute("name", this.name);
+                }
                 var statement = root.createElement("statement");
                 statement.textContent = this.statement;
                 node.appendChild(statement);
-                for (var option of this.options)
-                {
+                for (var option of this.options) {
                     var child = root.createElement("option");
-                    child.setAttribute("name",option.name);
+                    child.setAttribute("name", option.name);
                     child.textContent = option.text;
                     node.appendChild(child);
                 }
                 return node;
-			};
-		};
-		
-		this.audioElementNode = function(specification) {
-			this.url = null;
-			this.id = null;
+            };
+        };
+
+        this.audioElementNode = function (specification) {
+            this.url = null;
+            this.id = null;
             this.name = null;
-			this.parent = null;
-			this.type = null;
-			this.marker = null;
-			this.enforce = false;
-			this.gain = 0.0;
+            this.parent = null;
+            this.type = null;
+            this.marker = null;
+            this.enforce = false;
+            this.gain = 0.0;
             this.label = null;
             this.startTime = undefined;
             this.stopTime = undefined;
-			this.schema = specification.schema.getAllElementsByName('audioelement')[0];;
-			this.parent = null;
-			this.decode = function(parent,xml)
-			{
-				this.parent = parent;
-				var attributeMap = this.schema.getAllElementsByTagName('xs:attribute');
-				for (var i=0; i<attributeMap.length; i++)
-				{
-					var attributeName = attributeMap[i].getAttribute('name') || attributeMap[i].getAttribute('ref');
-					var projectAttr = xml.getAttribute(attributeName);
-					projectAttr = parent.parent.processAttribute(projectAttr,attributeMap[i],parent.parent.schema);
-					switch(typeof projectAttr)
-					{
-					case "number":
-					case "boolean":
-						eval('this.'+attributeName+' = '+projectAttr);
-						break;
-					case "string":
-						eval('this.'+attributeName+' = "'+projectAttr+'"');
-						break;
-					}
-				}
-				
-			};
-			this.encode = function(root)
-			{
-				var AENode = root.createElement("audioelement");
-				var attributes = this.schema.getAllElementsByTagName('xs:attribute');
-                for (var i=0; i<attributes.length; i++)
-                {
+            this.schema = specification.schema.getAllElementsByName('audioelement')[0];;
+            this.parent = null;
+            this.decode = function (parent, xml) {
+                this.parent = parent;
+                var attributeMap = this.schema.getAllElementsByTagName('xs:attribute');
+                for (var i = 0; i < attributeMap.length; i++) {
+                    var attributeName = attributeMap[i].getAttribute('name') || attributeMap[i].getAttribute('ref');
+                    var projectAttr = xml.getAttribute(attributeName);
+                    projectAttr = parent.parent.processAttribute(projectAttr, attributeMap[i], parent.parent.schema);
+                    switch (typeof projectAttr) {
+                        case "number":
+                        case "boolean":
+                            eval('this.' + attributeName + ' = ' + projectAttr);
+                            break;
+                        case "string":
+                            eval('this.' + attributeName + ' = "' + projectAttr + '"');
+                            break;
+                    }
+                }
+
+            };
+            this.encode = function (root) {
+                var AENode = root.createElement("audioelement");
+                var attributes = this.schema.getAllElementsByTagName('xs:attribute');
+                for (var i = 0; i < attributes.length; i++) {
                     var name = attributes[i].getAttribute("name");
                     if (name == undefined) {
                         name = attributes[i].getAttribute("ref");
                     }
-                    if(eval("this."+name+" != undefined") || attributes[i].getAttribute("use") == "required")
-                    {
-                        eval("AENode.setAttribute('"+name+"',this."+name+")");
+                    if (eval("this." + name + " != undefined") || attributes[i].getAttribute("use") == "required") {
+                        eval("AENode.setAttribute('" + name + "',this." + name + ")");
                     }
                 }
-				return AENode;
-			};
-		};
-	};
+                return AENode;
+            };
+        };
+    };
 }
--- a/python/generate_report.py	Mon Nov 14 12:11:38 2016 +0000
+++ b/python/generate_report.py	Mon Nov 14 12:14:38 2016 +0000
@@ -120,9 +120,10 @@
 
 # generate images for later use
 if render_figures:
-    subprocess.call("python timeline_view_movement.py '"+folder_name+"'", shell=True)
-    subprocess.call("python score_parser.py '"+folder_name+"'", shell=True)
-    subprocess.call("python score_plot.py '"+folder_name+"ratings/'", shell=True)
+    script_path = os.path.dirname(os.path.realpath(__file__)) # where is generate_report.py?
+    subprocess.call("python " +script_path+"/timeline_view_movement.py '"+folder_name+"'", shell=True)
+    subprocess.call("python " +script_path+"/score_parser.py '"+folder_name+"'", shell=True)
+    subprocess.call("python " +script_path+"/score_plot.py '"+folder_name+"ratings/'", shell=True)
 
 # make array of text and array of dates
 body_array = []
--- a/python/timeline_view_movement.py	Mon Nov 14 12:11:38 2016 +0000
+++ b/python/timeline_view_movement.py	Mon Nov 14 12:14:38 2016 +0000
@@ -124,9 +124,10 @@
                     stop_times_global  = []
                     listen_events = audioelement.findall("./metric/metricresult/[@name='elementListenTracker']/event")
                     for event in listen_events:
-                        # get testtime: start and stop
-                        start_times_global.append(float(event.find('testtime').get('start')))#-time_offset)
-                        stop_times_global.append(float(event.find('testtime').get('stop')))#-time_offset)
+                        if event.find('testtime') is not None:
+                            # get testtime: start and stop
+                            start_times_global.append(float(event.find('testtime').get('start')))#-time_offset)
+                            stop_times_global.append(float(event.find('testtime').get('stop')))#-time_offset)
                     
                     # display fragment name at start
                     plt.text(0,initial_position+0.02,audio_id,color=colormap[increment%len(colormap)]) #,rotation=45
@@ -289,12 +290,35 @@
                 plt.ylabel('Rating') # default
                 plt.ylim(0, 1) # rating between 0 and 1
 
-                # TO DO: 
-                # Y axis title and tick labels as specified in 'setup' for corresponding page
+                # Y axis title and tick labels as specified in 'setup'
+                # for corresponding page
+                page_setup = root.find("./waet/page[@id='"+page_name+"']") 
+                    # 'ref' of page is 'id' in page setup
+
                 # Different plots for different axes
+                interfaces = page_setup.findall("./interface")
+                interface_title = interfaces[0].find("./title")
+                scales = interfaces[0].findall("./scales") # get first interface by default
+                scalelabels = scales[0].findall("./scalelabel") # get first scale by default
+
+                labelpos = [] # array of scalelabel positions
+                labelstr = [] # array of strings at labels
+                for scalelabel in scalelabels:
+                    labelpos.append(float(scalelabel.get('position'))/100.0)
+                    labelstr.append(scalelabel.text)
+
+                # use interface name as Y axis label
+                if interface_title is not None:
+                    plt.ylabel(interface_title.text)
+                else:
+                    plt.ylabel('Rating') # default
+
+                if len(labelpos):
+                    plt.yticks(labelpos, labelstr)
             
                 #plt.show() # uncomment to show plot; comment when just saving
                 #exit()
             
+                # save as PDF
                 plt.savefig(timeline_folder+subject_id+"-"+page_name+".pdf", bbox_inches='tight')
                 plt.close()
--- a/test_create/attributes.json	Mon Nov 14 12:11:38 2016 +0000
+++ b/test_create/attributes.json	Mon Nov 14 12:14:38 2016 +0000
@@ -27,5 +27,9 @@
     "postSilence": "Post Silence",
     "poolSize": "Pool Size",
     "alwaysInclude": "Always Include",
-    "crossFade": "Cross Fade"
+    "crossFade": "Cross Fade",
+    "check": "Check",
+    "value": "Value",
+    "jumpToOnPass": "Jump To ID On Pass",
+    "jumpToOnFail": "Jump To ID On Fail"
 }
--- a/tests/examples/APE_example.xml	Mon Nov 14 12:11:38 2016 +0000
+++ b/tests/examples/APE_example.xml	Mon Nov 14 12:14:38 2016 +0000
@@ -6,7 +6,7 @@
 				<statement>Please enter your name.</statement>
                 <conditional check="equals" value="John" jumpToOnPass="test-intro" jumpToOnFail="checkboxtest"/>
 			</surveyentry>
-			<surveyentry type="checkbox" id="checkboxtest" mandatory="true">
+			<surveyentry type="checkbox" id="checkboxtest" mandatory="true" min="2" max="4">
 				<statement>Please select with which activities you have any experience (example checkbox question)</statement>
 				<option name="musician">Playing a musical instrument</option>
 				<option name="soundengineer">Recording or mixing audio</option>
--- a/xml/test-schema.xsd	Mon Nov 14 12:11:38 2016 +0000
+++ b/xml/test-schema.xsd	Mon Nov 14 12:14:38 2016 +0000
@@ -26,8 +26,8 @@
                 </xs:restriction>
             </xs:simpleType>
         </xs:attribute>
-        
-        <xs:attribute name="playOne" type="xs:boolean" default="false"/>
+
+        <xs:attribute name="playOne" type="xs:boolean" default="false" />
 
         <!-- define complex elements-->
         <xs:element name="waet">
@@ -96,6 +96,7 @@
                         </xs:restriction>
                     </xs:simpleType>
                 </xs:attribute>
+                <xs:attribute name="labelStart" use="optional" type="xs:string" default="" />
                 <xs:attribute ref="poolSize" />
                 <xs:attribute ref="alwaysInclude" />
                 <xs:attribute ref="preSilence" />
@@ -254,16 +255,16 @@
                                         <xs:attribute name="check" use="required">
                                             <xs:simpleType>
                                                 <xs:restriction base="xs:string">
-                                                    <xs:enumeration value="equals"/>
-                                                    <xs:enumeration value="lessThan"/>
-                                                    <xs:enumeration value="greaterThan"/>
-                                                    <xs:enumeration value="stringContains"/>
+                                                    <xs:enumeration value="equals" />
+                                                    <xs:enumeration value="lessThan" />
+                                                    <xs:enumeration value="greaterThan" />
+                                                    <xs:enumeration value="stringContains" />
                                                 </xs:restriction>
                                             </xs:simpleType>
                                         </xs:attribute>
-                                        <xs:attribute name="value" type="xs:string" use="optional"/>
-                                        <xs:attribute name="jumpToOnPass" type="xs:string" use="optional"/>
-                                        <xs:attribute name="jumpToOnFail" type="xs:string" use="optional"/>
+                                        <xs:attribute name="value" type="xs:string" use="optional" />
+                                        <xs:attribute name="jumpToOnPass" type="xs:string" use="optional" />
+                                        <xs:attribute name="jumpToOnFail" type="xs:string" use="optional" />
                                     </xs:complexType>
                                 </xs:element>
                             </xs:sequence>
@@ -295,7 +296,7 @@
                                     </xs:restriction>
                                 </xs:simpleType>
                             </xs:attribute>
-                            <xs:attribute name="url" type="xs:string" use="optional"/>
+                            <xs:attribute name="url" type="xs:string" use="optional" default="" />
                         </xs:complexType>
                     </xs:element>
                 </xs:sequence>