changeset 1293:c753706731f2

Fixed null/period saves on test completion. specification projectReturn is currently deprecated pending new usage.
author Nicholas Jillings <nickjillings@users.noreply.github.com>
date Thu, 10 Mar 2016 11:49:08 +0000
parents a6cfd378891c
children e7a819fe85bf
files core.js example_eval/project.xml
diffstat 2 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/core.js	Thu Mar 10 10:04:38 2016 +0000
+++ b/core.js	Thu Mar 10 11:49:08 2016 +0000
@@ -334,16 +334,17 @@
 		popup.popupContent.appendChild(a);
 	} else {
 		var xmlhttp = new XMLHttpRequest;
-		xmlhttp.open("POST",destURL,true);
+		xmlhttp.open("POST","\save.php?key="+storage.SessionKey.key,true);
 		xmlhttp.setRequestHeader('Content-Type', 'text/xml');
 		xmlhttp.onerror = function(){
 			console.log('Error saving file to server! Presenting download locally');
-			createProjectSave(null);
+			createProjectSave("local");
 		};
 		xmlhttp.onload = function() {
             console.log(xmlhttp);
             if (this.status >= 300) {
                 console.log("WARNING - Could not update at this time");
+                createProjectSave("local");
             } else {
                 var parser = new DOMParser();
                 var xmlDoc = parser.parseFromString(xmlhttp.responseText, "application/xml");
--- a/example_eval/project.xml	Thu Mar 10 10:04:38 2016 +0000
+++ b/example_eval/project.xml	Thu Mar 10 11:49:08 2016 +0000
@@ -13,7 +13,7 @@
 				<option name="hwdesigner">Designing or building audio hardware</option>
 				<option name="researcher">Research in the field of audio</option>
 			</surveyentry>
-			<surveyentry type="statement">
+			<surveyentry type="statement" id="test-intro">
 				<statement>This is an example of an 'APE'-style test, with two pages, using the test stimuli in 'example_eval/'.</statement>
 			</surveyentry>
 		</survey>
@@ -31,7 +31,7 @@
 				<option name="good">Good</option>
 				<option name="great">Great</option>
 			</surveyentry>
-			<surveyentry type="statement">
+			<surveyentry type="statement" id="thankyou">
 				<statement>Thank you for taking this listening test. Please click 'submit' and your results will appear in the 'saves/' folder.</statement>
 			</surveyentry>
 		</survey>
@@ -76,7 +76,7 @@
 		<audioelement url="3.wav" id="track-3"/>
 		<audioelement url="4.wav" id="track-4"/>
 		<survey location="before">
-			<surveyentry type="statement">
+			<surveyentry type="statement" id="test-0-intro">
 				<statement>Example of an 'APE' style interface with hidden anchor 'zero' (which needs to be below 20%), looping of the samples, randomisation of marker labels, mandatory moving of every sample, and a forced scale usage of at least 25%-75%.</statement>
 			</surveyentry>
 		</survey>
@@ -123,7 +123,7 @@
 			<option name="heavy">Heavy</option>
 		</commentquestion>
 		<survey location="before">
-			<surveyentry type="statement">
+			<surveyentry type="statement" id="test-1-intro">
 				<statement>Example of an 'APE' style interface with hidden anchor 'zero' (which needs to be below 20%), looping of the samples, randomisation of marker labels, mandatory moving of every sample, and a forced scale usage of at least 25%-75%.</statement>
 			</surveyentry>
 		</survey>