changeset 1412:28136e188d46

Bugs #1454 #1391 buffers are pooled and loaded at the begining. Page Save not interface specific.
author Nicholas Jillings <nickjillings@users.noreply.github.com>
date Mon, 07 Dec 2015 18:42:36 +0000
parents a32295e8a6a0
children 568829c2b4a0
files ape.js core.js mushra.js
diffstat 3 files changed, 24 insertions(+), 55 deletions(-) [+]
line wrap: on
line diff
--- a/ape.js	Mon Dec 07 18:34:26 2015 +0000
+++ b/ape.js	Mon Dec 07 18:42:36 2015 +0000
@@ -642,32 +642,7 @@
 
 function pageXMLSave(store, testXML)
 {
+	// MANDATORY
 	// Saves a specific test page
-	var xmlDoc = store;
-	// Check if any session wide metrics are enabled
-	
-	var commentShow = testXML.elementComments;
-	
-	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);
-	}
-	xmlDoc.appendChild(metric);
-	var audioObjects = audioEngineContext.audioObjects;
-	for (var i=0; i<audioObjects.length; i++) 
-	{
-		var audioElement = audioEngineContext.audioObjects[i].exportXMLDOM();
-		audioElement.setAttribute('presentedId',i);
-		xmlDoc.appendChild(audioElement);
-	}
-	
-	$(interfaceContext.commentQuestions).each(function(index,element){
-		var node = element.exportXMLDOM();
-		xmlDoc.appendChild(node);
-	});
-	store = xmlDoc;
+	// You can use this space to add any extra nodes to your XML saves
 }
\ No newline at end of file
--- 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);
 	};
 	
--- a/mushra.js	Mon Dec 07 18:34:26 2015 +0000
+++ b/mushra.js	Mon Dec 07 18:42:36 2015 +0000
@@ -283,32 +283,7 @@
 
 function pageXMLSave(store, testXML)
 {
+	// MANDATORY
 	// Saves a specific test page
-	var xmlDoc = store;
-	// Check if any session wide metrics are enabled
-	
-	var commentShow = testXML.elementComments;
-	
-	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);
-	}
-	xmlDoc.appendChild(metric);
-	var audioObjects = audioEngineContext.audioObjects;
-	for (var i=0; i<audioObjects.length; i++) 
-	{
-		var audioElement = audioEngineContext.audioObjects[i].exportXMLDOM();
-		audioElement.setAttribute('presentedId',i);
-		xmlDoc.appendChild(audioElement);
-	}
-	
-	$(interfaceContext.commentQuestions).each(function(index,element){
-		var node = element.exportXMLDOM();
-		xmlDoc.appendChild(node);
-	});
-	store = xmlDoc;
+	// You can use this space to add any extra nodes to your XML saves
 }