Mercurial > hg > webaudioevaluationtool
comparison core.js @ 601:0df685136c89
Fixed null/period saves on test completion. specification projectReturn is currently deprecated pending new usage.
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Thu, 10 Mar 2016 11:49:08 +0000 |
parents | d1d7b49fbeea |
children | 6531e3903ea1 |
comparison
equal
deleted
inserted
replaced
600:0794fefefbd8 | 601:0df685136c89 |
---|---|
332 popup.showPopup(); | 332 popup.showPopup(); |
333 popup.popupContent.innerHTML = "</span>Please save the file below to give to your test supervisor</span><br>"; | 333 popup.popupContent.innerHTML = "</span>Please save the file below to give to your test supervisor</span><br>"; |
334 popup.popupContent.appendChild(a); | 334 popup.popupContent.appendChild(a); |
335 } else { | 335 } else { |
336 var xmlhttp = new XMLHttpRequest; | 336 var xmlhttp = new XMLHttpRequest; |
337 xmlhttp.open("POST",destURL,true); | 337 xmlhttp.open("POST","\save.php?key="+storage.SessionKey.key,true); |
338 xmlhttp.setRequestHeader('Content-Type', 'text/xml'); | 338 xmlhttp.setRequestHeader('Content-Type', 'text/xml'); |
339 xmlhttp.onerror = function(){ | 339 xmlhttp.onerror = function(){ |
340 console.log('Error saving file to server! Presenting download locally'); | 340 console.log('Error saving file to server! Presenting download locally'); |
341 createProjectSave(null); | 341 createProjectSave("local"); |
342 }; | 342 }; |
343 xmlhttp.onload = function() { | 343 xmlhttp.onload = function() { |
344 console.log(xmlhttp); | 344 console.log(xmlhttp); |
345 if (this.status >= 300) { | 345 if (this.status >= 300) { |
346 console.log("WARNING - Could not update at this time"); | 346 console.log("WARNING - Could not update at this time"); |
347 createProjectSave("local"); | |
347 } else { | 348 } else { |
348 var parser = new DOMParser(); | 349 var parser = new DOMParser(); |
349 var xmlDoc = parser.parseFromString(xmlhttp.responseText, "application/xml"); | 350 var xmlDoc = parser.parseFromString(xmlhttp.responseText, "application/xml"); |
350 var response = xmlDoc.getElementsByTagName('response')[0]; | 351 var response = xmlDoc.getElementsByTagName('response')[0]; |
351 if (response.getAttribute("state") == "OK") { | 352 if (response.getAttribute("state") == "OK") { |