changeset 692:2b3f19c4f607

Fixed bug where not defining postTest in audioHolder would crash progression.
author Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk>
date Wed, 22 Apr 2015 18:34:56 +0100
parents 06fbaccf3b58
children 55e8ab191227 3444a772d19e
files ape.js example_eval/project.xml
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ape.js	Wed Apr 22 11:00:58 2015 +0100
+++ b/ape.js	Wed Apr 22 18:34:56 2015 +0100
@@ -741,7 +741,10 @@
 		var testId = currentState.substr(8,currentState.length-7);
 		// Check if we have any post tests to perform
 		var postXML = $(testXMLSetups[testId]).find('PostTest')[0];
-		if (postXML.children.length > 0)
+		if (postXML == undefined) {
+			testEnded(testId);
+		}
+		else if (postXML.children.length > 0)
 		{
 			currentState = 'testRunPost-'+testId; 
 			showPopup();
@@ -751,7 +754,7 @@
 		
 		
 			// No post tests, check if we have another test to perform instead
-			testEnded(testId);
+			
 		}
 	}
 	console.log(currentState);
--- a/example_eval/project.xml	Wed Apr 22 11:00:58 2015 +0100
+++ b/example_eval/project.xml	Wed Apr 22 18:34:56 2015 +0100
@@ -44,6 +44,6 @@
 		<PostTest>
 			<statement>Please take a break before the next test</statement>
 			<question id="testComment">How did you find the test</question>
-		</PostTest>
+	</PostTest>
 	</audioHolder>
 </BrowserEvalProjectDocument>
\ No newline at end of file