changeset 499:841de347591e Dev_main

Merge
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Mon, 01 Feb 2016 10:38:54 +0000
parents 47ab6c962962 (diff) da8b22838465 (current diff)
children ee23bf531ec4
files core.js
diffstat 1 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/core.js	Fri Jan 29 11:39:29 2016 +0000
+++ b/core.js	Mon Feb 01 10:38:54 2016 +0000
@@ -2757,7 +2757,7 @@
 			// Update the playhead position, startPlay must be called
 			if (this.timePerPixel > 0) {
 				var time = this.playbackObject.getCurrentPosition();
-				if (time > 0) {
+				if (time > 0 && time < this.maxTime) {
 					var width = 490;
 					var pix = Math.floor(time/this.timePerPixel);
 					this.scrubberHead.style.left = pix+'px';
@@ -2873,6 +2873,7 @@
 					// Anchor is not set below
 					console.log('Anchor node not below marker value');
 					alert('Please keep listening');
+                    this.storeErrorNode('Anchor node not below marker value');
 					return false;
 				}
 			}
@@ -2888,7 +2889,8 @@
 			{
 				if (ao.interfaceDOM.getValue() < (ao.specification.marker/100) && ao.specification.marker > 0) {
 					// Anchor is not set below
-					console.log('Reference node not below marker value');
+					console.log('Reference node not above marker value');
+                    this.storeErrorNode('Reference node not above marker value');
 					alert('Please keep listening');
 					return false;
 				}
@@ -2946,6 +2948,7 @@
 			}
 			str_start += ". Please keep listening";
 			console.log("[ALERT]: "+str_start);
+            this.storeErrorNode("[ALERT]: "+str_start);
 			alert(str_start);
 		}
 	};
@@ -2977,6 +2980,7 @@
 		str +='.';
 		alert(str);
 		console.log(str);
+        this.storeErrorNode(str);
 		return false;
 	};
 	this.checkAllPlayed = function()
@@ -3007,8 +3011,18 @@
 		str +='.';
 		alert(str);
 		console.log(str);
+        this.storeErrorNode(str);
 		return false;
 	};
+    
+    this.storeErrorNode = function(errorMessage)
+    {
+        var time = audioEngineContext.timer.getTestTime();
+        var node = storage.document.createElement('error');
+        node.setAttribute('time',time);
+        node.textContent = errorMessage;
+        testState.currentStore.XMLDOM.appendChild(node);
+    };
 }
 
 function Storage()