# HG changeset patch # User Giulio Moro # Date 1457796750 0 # Node ID 0256f3748b27b408862e1de7e108cb774ce3651d # Parent 328f247984621122aa39dfd5c549ad70dd17a0b4# Parent 65c7223bd81733d5929e36aa3fd8d9673ebcd9a7 Merge diff -r 65c7223bd817 -r 0256f3748b27 .hgignore --- a/.hgignore Thu Mar 10 17:08:10 2016 +0000 +++ b/.hgignore Sat Mar 12 15:32:30 2016 +0000 @@ -51,3 +51,7 @@ re:^docs/DMRN+10/img/\._APE\.png$ re:^docs/DMRN+10/img/\._MUSHRA\.png$ re:^docs/AESPosterComp/AESposter\.pdf$ +example_eval/samples/* +.hgrc +*.orig + diff -r 65c7223bd817 -r 0256f3748b27 analyse.html --- a/analyse.html Thu Mar 10 17:08:10 2016 +0000 +++ b/analyse.html Sat Mar 12 15:32:30 2016 +0000 @@ -24,7 +24,13 @@ xmlFileFolder = "saves"; // array of XML files // THIS IS WHERE YOU SPECIFY RESULT XML FILES TO ANALYSE - var xmlFiles = ['test-2.xml']; + var xmlFiles = ["3b8692e2f7827594a2cf283ebc7ba79ba4f29149-save-3d3k50w774sw0cgc4800o8o8kwk0gk84.xml", +"3b8692e2f7827594a2cf283ebc7ba79ba4f29149-save-5t0z46181s0cwoso8480800ockk0wkww.xml", +"3b8692e2f7827594a2cf283ebc7ba79ba4f29149-save-8veul9kqv40gksgk8soso0wsws48s8o4.xml", +"3b8692e2f7827594a2cf283ebc7ba79ba4f29149-save-hxvv3zp9jk80wswgckscgc000wskkws4.xml", +"3b8692e2f7827594a2cf283ebc7ba79ba4f29149-save-i7wn9tydpckg8os48ccocsk40k8s0scc.xml", +"3b8692e2f7827594a2cf283ebc7ba79ba4f29149-save-qjbkqelkz4ssocgkgc04w8go8o8cww4o.xml", +"3b8692e2f7827594a2cf283ebc7ba79ba4f29149-save-w6jxem0ow004ks0o84g0kgw4wsw40k0w.xml"]; //TODO: make retrieval of file names automatic / drag files on here diff -r 65c7223bd817 -r 0256f3748b27 assets/images/arrow-checkbox-unchecked.png Binary file assets/images/arrow-checkbox-unchecked.png has changed diff -r 65c7223bd817 -r 0256f3748b27 assets/images/checkbox-checked.png Binary file assets/images/checkbox-checked.png has changed diff -r 65c7223bd817 -r 0256f3748b27 assets/images/checkbox-unchecked-disabled.png Binary file assets/images/checkbox-unchecked-disabled.png has changed diff -r 65c7223bd817 -r 0256f3748b27 assets/images/ok.png Binary file assets/images/ok.png has changed diff -r 65c7223bd817 -r 0256f3748b27 core.js --- a/core.js Thu Mar 10 17:08:10 2016 +0000 +++ b/core.js Sat Mar 12 15:32:30 2016 +0000 @@ -15,9 +15,9 @@ var popup; // Hold the interfacePopup object var testState; var currentTrackOrder = []; // Hold the current XML tracks in their (randomised) order -var audioEngineContext; // The custome AudioEngine object -var projectReturn; // Hold the URL for the return - +var audioEngineContext; // The custom AudioEngine object +var projectReturn; +var returnUrl; // Holds the url to be redirected to at the end of the test // Add a prototype to the bufferSourceNode to reference to the audioObject holding it AudioBufferSourceNode.prototype.owner = undefined; @@ -369,11 +369,28 @@ a.textContent = "Save File"; popup.showPopup(); - popup.popupContent.innerHTML = "Please save the file below to give to your test supervisor
"; + popup.popupContent.innerHTML = "Please save the file below to give to your test supervisor
"; popup.popupContent.appendChild(a); } else { + destUrlFull = destURL+"?key="+storage.SessionKey.key; + var saveFilenamePrefix; + // parse the querystring of destUrl, get the "id" (if any) and append it to destUrl + var qs = returnUrl.split("?"); + if(qs.length == 2){ + qs = qs[1]; + qs = qs.split("&"); + for(var n = 0; n < qs.length; n++){ + var pair = qs[n].split("="); + if (pair[0] == "id") { + saveFilenamePrefix = pair[1]; + } + } + } + if(typeof(saveFilenamePrefix) !== "undefined"){ + destUrlFull+="&saveFilenamePrefix="+saveFilenamePrefix; + } var xmlhttp = new XMLHttpRequest; - xmlhttp.open("POST","\save.php?key="+storage.SessionKey.key,true); + xmlhttp.open("POST",destUrlFull,true); xmlhttp.setRequestHeader('Content-Type', 'text/xml'); xmlhttp.onerror = function(){ console.log('Error saving file to server! Presenting download locally'); @@ -388,11 +405,15 @@ var parser = new DOMParser(); var xmlDoc = parser.parseFromString(xmlhttp.responseText, "application/xml"); var response = xmlDoc.getElementsByTagName('response')[0]; + window.onbeforeunload=null; if (response.getAttribute("state") == "OK") { var file = response.getElementsByTagName("file")[0]; + if(typeof(returnUrl) !== "undefined"){ + window.location = returnUrl; + } console.log("Save: OK, written "+file.getAttribute("bytes")+"B"); popup.popupContent.textContent = "Thank you. Your session has been saved."; - } else { + } else { var message = response.getElementsByTagName("message"); console.log("Save: Error! "+message.textContent); createProjectSave("local"); diff -r 65c7223bd817 -r 0256f3748b27 example_eval/ABshort.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example_eval/ABshort.xml Sat Mar 12 15:32:30 2016 +0000 @@ -0,0 +1,30 @@ + + + + + testTimer + elementTimer + elementInitialPosition + elementTracker + elementFlagListenedTo + elementFlagMoved + elementListenTracker + + + + + + + + + + + + Comment on fragment + + Which of these do you prefer + + + + + \ No newline at end of file diff -r 65c7223bd817 -r 0256f3748b27 example_eval/labelling.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example_eval/labelling.xml Sat Mar 12 15:32:30 2016 +0000 @@ -0,0 +1,34 @@ + + + + + testTimer + elementTimer + elementInitialPosition + elementTracker + elementFlagListenedTo + elementFlagMoved + elementListenTracker + + + + + + + + + + + + + (1) Very Annoying + (2) Annoying + (3) Slightly Annoying + (4) Audible but not Annoying + (5) Inaudible + + + + + + diff -r 65c7223bd817 -r 0256f3748b27 example_eval/post_survey.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example_eval/post_survey.xml Sat Mar 12 15:32:30 2016 +0000 @@ -0,0 +1,48 @@ + + + + + + Please enter your location. (example mandatory text question) + + + Please enter your age (example non-mandatory number question) + + + Please rate this interface (example radio button question) + + + + + + + Thank you for taking this listening test. May God be with you. + + + + testTimer + elementTimer + elementInitialPosition + elementTracker + elementFlagListenedTo + elementFlagMoved + elementListenTracker + + + + + + + + + + Comment on fragment + + SKIP THIS PAGE. I WANT 0 PAGES!!!! + + + + + \ No newline at end of file diff -r 65c7223bd817 -r 0256f3748b27 example_eval/pre_survey.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example_eval/pre_survey.xml Sat Mar 12 15:32:30 2016 +0000 @@ -0,0 +1,51 @@ + + + + + + Please enter your name. + + + Please select with which activities you have any experience (example checkbox question) + + + + + + + + This is a preliminary test for a study on the Hammond organ. You will be presented with pairs of stimuli. For each pair you will be asked to single out the one note that was produced by a heavier touch. + + Feel free to add any comments on the stimuli in the boxes at the bottom of each page of the test. + + + + testTimer + elementTimer + elementInitialPosition + elementTracker + elementFlagListenedTo + elementFlagMoved + elementListenTracker + + + + + + + + + + + + + Comment on fragment + + SKIP OVER THIS, I WANT ZERO PAGES!!! + + + + + \ No newline at end of file diff -r 65c7223bd817 -r 0256f3748b27 index.html --- a/index.html Thu Mar 10 17:08:10 2016 +0000 +++ b/index.html Sat Mar 12 15:32:30 2016 +0000 @@ -32,12 +32,17 @@ { // Split each request into searchQueries[i] = searchQueries[i].split('='); - if (searchQueries[i][0] == "url") + var key = searchQueries[i][0]; + var string = searchQueries[i][1]; + if (key === "url") { - url = searchQueries[i][1]; + url = string; + } + if (key === "returnUrl"){ + returnUrl = decodeURIComponent(string); } } - loadProjectSpec(url); + loadProjectSpec(url+"?"+Math.random()); // force resource reload, in case the server is lazy window.onbeforeunload = function() { return "Please only leave this page once you have completed the tests. Are you sure you have completed all testing?"; }; @@ -49,7 +54,8 @@
- Web Audio Evaluation Toolbox + Loading Web Audio Evaluation Toolbox ... +