diff core.js @ 775:bb02c801c8c9

Bugs #1454 #1391 buffers are pooled and loaded at the begining. Page Save not interface specific.
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Mon, 07 Dec 2015 18:42:36 +0000
parents 67c6048d920f
children 0795031754d7
line wrap: on
line diff
--- a/core.js	Mon Dec 07 18:34:26 2015 +0000
+++ b/core.js	Mon Dec 07 18:42:36 2015 +0000
@@ -650,7 +650,26 @@
 	this.testPageCompleted = function(store, testXML, testId) {
 		// Function called each time a test page has been completed
 		// Can be used to over-rule default behaviour
-		
+		var metric = document.createElement('metric');
+		if (audioEngineContext.metric.enableTestTimer)
+		{
+			var testTime = document.createElement('metricResult');
+			testTime.id = 'testTime';
+			testTime.textContent = audioEngineContext.timer.testDuration;
+			metric.appendChild(testTime);
+		}
+		testXML.appendChild(metric);
+		var audioObjects = audioEngineContext.audioObjects;
+		for (var i=0; i<audioObjects.length; i++) 
+		{
+			var audioElement = audioEngineContext.audioObjects[i].exportXMLDOM();
+			audioElement.setAttribute('presentedId',i);
+			testXML.appendChild(audioElement);
+		}
+		$(interfaceContext.commentQuestions).each(function(index,element){
+			var node = element.exportXMLDOM();
+			testXML.appendChild(node);
+		});
 		pageXMLSave(store, testXML);
 	};