changeset 536:efac13499354 Dev_main

Merge into dev_main
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Mon, 22 Feb 2016 12:19:43 +0000
parents 26b9c01ad2cc (current diff) 61494bd607b2 (diff)
children 2a723261ee3e
files
diffstat 7 files changed, 61 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Sun Feb 21 03:35:27 2016 +0000
+++ b/.hgignore	Mon Feb 22 12:19:43 2016 +0000
@@ -49,3 +49,5 @@
 re:^docs/DMRN+10/img/\._TestCreate\.png$
 re:^docs/DMRN+10/img/\._APE\.png$
 re:^docs/DMRN+10/img/\._MUSHRA\.png$
+example_eval/samples/*
+	
--- a/analyse.html	Sun Feb 21 03:35:27 2016 +0000
+++ b/analyse.html	Mon Feb 22 12:19:43 2016 +0000
@@ -24,7 +24,7 @@
 			xmlFileFolder = "saves";
 			// array of XML files
 			// THIS IS WHERE YOU SPECIFY RESULT XML FILES TO ANALYSE
-			var xmlFiles = ['test-0.xml','test-1.xml','test-2.xml','test-3.xml']; 
+			var xmlFiles = ['test-2.xml']; 
 							
 
 			//TODO: make retrieval of file names automatic / drag files on here
@@ -284,6 +284,7 @@
 				  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
 				  }
 				xmlhttp.open("GET",xmlFileName,false);
+				xmlhttp.overrideMimeType('text/xml');
 				xmlhttp.send();
 				return xmlhttp.responseXML; 
 			}
@@ -300,11 +301,11 @@
 						fileNameArray.push(xmlFiles[fileIndex]);
 						
 						// get root of XML file
-						root = xml.getElementsByTagName('browserevaluationresult')[0];
+						root = xml.getElementsByTagName('waetresult')[0];
 						
 						// get subject ID, add to array if not already there
-						pretest = root.getElementsByTagName('pretest')[0];
-						subjectID = pretest.getElementsByTagName('comment')[0];
+						pretestSurveyResult = root.getElementsByTagName('surveyresult')[0];
+						subjectID = pretestSurveyResult.getElementsByTagName('comment')[0];
 						if (subjectID){
 							if (subjectID.getAttribute('id')!='sessionId') { // warning in console when not available
 								console.log(xmlFiles[fileIndex]+': no SessionID available');
@@ -378,7 +379,7 @@
 					// which songs did they do
 					if (xml != null) { // if file exists
 						// get root of XML file
-						root = xml.getElementsByTagName('browserevaluationresult')[0];
+						root = xml.getElementsByTagName('waetresult')[0];
 						// go over all audioholders
 						// document.getElementById('div_survey_'+xmlFileName).innerHTML += '<strong>Audioholders: </strong>';
 						// audioholderNodes = root.getElementsByTagName('audioholder');
@@ -415,7 +416,7 @@
 
 			function makePlots() { //TODO: split into different functions
 				// TEMPORARY
-				makeTimeline(xmlFileFolder+"/"+xmlFiles[7]);
+				makeTimeline(xmlFileFolder+"/"+xmlFiles[0]);
 
 				// create value array
 				var ratings = [];  // 3D matrix of ratings (audioholder, audioelement, subject)
@@ -432,7 +433,7 @@
 					xml = readXML(xmlFileName); 
 					if (xml != null) { // if file exists
 						// get root of XML file
-						root = xml.getElementsByTagName('browserevaluationresult')[0];
+						root = xml.getElementsByTagName('waetresult')[0];
 						// go over all audioholders
 						audioholderNodes = root.getElementsByTagName('audioholder');
 						for (audioholderIndex = 0; audioholderIndex < audioholderNodes.length; audioholderIndex++) { 
@@ -594,7 +595,7 @@
 					return; // do nothing; exit function
 				}
 				// get root of XML file
-				root = xml.getElementsByTagName('browserevaluationresult')[0];
+				root = xml.getElementsByTagName('waetresult')[0];
 
 				audioholder_time = 0; 
 				previous_audioholder_time = 0; // time spent before current audioholder
--- a/core.js	Sun Feb 21 03:35:27 2016 +0000
+++ b/core.js	Mon Feb 22 12:19:43 2016 +0000
@@ -342,11 +342,13 @@
 			if (xmlhttp.status != 200 && xmlhttp.readyState == 4) {
 				createProjectSave(null);
 			} else {
-				if (xmlhttp.responseXML == null)
+				var parser = new DOMParser();
+				var xmlDoc = parser.parseFromString(xmlhttp.responseText, "application/xml");
+				if (xmlDoc == null)
 				{
 					createProjectSave('null');
 				}
-				var response = xmlhttp.responseXML.childNodes[0];
+				var response = xmlDoc.childNodes[0];
 				if (response.getAttribute('state') == "OK")
 				{
 					var file = response.getElementsByTagName('file')[0];
--- a/save.php	Sun Feb 21 03:35:27 2016 +0000
+++ b/save.php	Mon Feb 22 12:19:43 2016 +0000
@@ -1,6 +1,7 @@
 <?php
 	header('Access-Control-Allow-Origin: *');
 	header("Content-type: text/xml");
+	error_reporting(0);
 	$postText = file_get_contents('php://input');
 	$sha1_hash = sha1($postText);
 	$datetime = date('ymdHis');
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test_create/custom.css	Mon Feb 22 12:19:43 2016 +0000
@@ -0,0 +1,23 @@
+
+div#content > div.node{
+    background-color: rgb(200,228,151);
+}
+
+div#content > div#setup{
+    background-color: coral;
+}
+
+input:disabled+span{
+    text-decoration: line-through;
+}
+
+div.attribute{
+    float: none;
+}
+div.attribute input{
+    max-width: 100%;
+    width: 300px;
+}
+div.attribute input[type=radio], div.attribute input[type=checkbox]{
+    width: 10px;
+}
\ No newline at end of file
--- a/test_create/style.css	Sun Feb 21 03:35:27 2016 +0000
+++ b/test_create/style.css	Mon Feb 22 12:19:43 2016 +0000
@@ -70,6 +70,16 @@
     color: rgb(100,100,100);
 }
 
+
+div#content > div.node{
+    background-color: rgb(200,228,151);
+}
+
+div#content > div#setup{
+    background-color: coral;
+}
+
+
 div.node {
     float: left;
     padding: 10px;
@@ -87,7 +97,7 @@
 }
 div.node-attributes {
     min-width: 92%;
-    float: left;
+    float: none;
     padding: 10px;
 }
 div.attribute {
@@ -103,9 +113,16 @@
     min-width: 92%;
 }
 div.attribute input {
-    max-width: 100px;
+    max-width: 100%;
+    width: 300px;
     margin-right: 10px;
 }
 div.attribute input[type=number] {
     width: 80px;
+}
+div.attribute input[type=radio], div.attribute input[type=checkbox]{
+    width: 10px;
+}
+input:disabled+span{
+    text-decoration: line-through;
 }
\ No newline at end of file
--- a/test_create/test_create.html	Sun Feb 21 03:35:27 2016 +0000
+++ b/test_create/test_create.html	Mon Feb 22 12:19:43 2016 +0000
@@ -2,7 +2,9 @@
 <head>
     <!-- This defines the test creator tool for the Web Audio Evaluation Toolbox -->
     <link rel='stylesheet' type="text/css" href="style.css"/>
+    <link rel='stylesheet' type="text/css" href="custom.css"/>
     <script type="text/javascript">
+        window.onbeforeunload = function (e) {var message = 'If you leave the page now, any unsaved changes will be lost', e = e || window.event; if (e) { e.returnValue = message;}return message;};
         // Copy of Specifiation node from Core.js
         function Specification() {
             // Handles the decoding of the project specification XML into a simple JavaScript Object.
@@ -632,4 +634,4 @@
     <div id="blanket"></div>
     <div id="content"></div>
 </body>
-</html>
\ No newline at end of file
+</html>