# HG changeset patch # User Giulio Moro # Date 1457714987 0 # Node ID 328f247984621122aa39dfd5c549ad70dd17a0b4 # Parent 6833d8c2b52e400c78693ad2eafc0f02d04b9a53 working, hacked together. diff -r 6833d8c2b52e -r 328f24798462 .hgignore --- a/.hgignore Sun Mar 06 20:55:00 2016 +0000 +++ b/.hgignore Fri Mar 11 16:49:47 2016 +0000 @@ -50,4 +50,6 @@ re:^docs/DMRN+10/img/\._APE\.png$ re:^docs/DMRN+10/img/\._MUSHRA\.png$ example_eval/samples/* - +.hgrc +*.orig + diff -r 6833d8c2b52e -r 328f24798462 assets/images/arrow-checkbox-unchecked.png Binary file assets/images/arrow-checkbox-unchecked.png has changed diff -r 6833d8c2b52e -r 328f24798462 assets/images/checkbox-checked.png Binary file assets/images/checkbox-checked.png has changed diff -r 6833d8c2b52e -r 328f24798462 assets/images/checkbox-unchecked-disabled.png Binary file assets/images/checkbox-unchecked-disabled.png has changed diff -r 6833d8c2b52e -r 328f24798462 assets/images/ok.png Binary file assets/images/ok.png has changed diff -r 6833d8c2b52e -r 328f24798462 core.js --- a/core.js Sun Mar 06 20:55:00 2016 +0000 +++ b/core.js Fri Mar 11 16:49:47 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; @@ -338,11 +338,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 { var xmlhttp = new XMLHttpRequest; - xmlhttp.open("POST",destURL,true); + destUrlFull = destURL; + 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; + } + xmlhttp.open("POST",destUrlFull,true); xmlhttp.setRequestHeader('Content-Type', 'text/xml'); xmlhttp.onerror = function(){ console.log('Error saving file to server! Presenting download locally'); @@ -368,6 +385,9 @@ popup.popupContent.innerHTML = null; popup.popupContent.textContent = "Thank you!"; window.onbeforeunload=null; + if(typeof(returnUrl) !== "undefined"){ + window.location = returnUrl; + } } else { var message = response.getElementsByTagName('message')[0]; errorSessionDump(message.textContent); diff -r 6833d8c2b52e -r 328f24798462 example_eval/ABshort.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example_eval/ABshort.xml Fri Mar 11 16:49:47 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 6833d8c2b52e -r 328f24798462 example_eval/labelling.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example_eval/labelling.xml Fri Mar 11 16:49:47 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 6833d8c2b52e -r 328f24798462 example_eval/post_survey.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example_eval/post_survey.xml Fri Mar 11 16:49:47 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 6833d8c2b52e -r 328f24798462 example_eval/pre_survey.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example_eval/pre_survey.xml Fri Mar 11 16:49:47 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 6833d8c2b52e -r 328f24798462 index.html --- a/index.html Sun Mar 06 20:55:00 2016 +0000 +++ b/index.html Fri Mar 11 16:49:47 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 ... +