changeset 2269:64bdcd9ad9a4

Merge branch 'master' of https://github.com/BrechtDeMan/WebAudioEvaluationTool
author www-data <www-data@sucuk.dcs.qmul.ac.uk>
date Wed, 20 Apr 2016 17:22:18 +0100
parents c8f05d753f12 (current diff) 0c3111ca4566 (diff)
children 3ca6e3fb66f4
files demo.html
diffstat 4 files changed, 93 insertions(+), 47 deletions(-) [+]
line wrap: on
line diff
--- a/demo.html	Wed Apr 20 16:21:08 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-	<head>
-		<meta charset="utf-8" />
-		<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
-		Remove this if you use the .htaccess -->
-		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
-
-		<title>Web Audio Evaluation Tool</title>
-		<meta name="description" content="" />
-		<meta name="author" content="" />
-	</head>
-
-	<body>
-		<div id='topLevelBody'>
-			<h1>Web Audio Evaluation Tool</h1>
-			<h2>Start menu </h2>
-			<ul>
-				<li><a href="index.html?url=example_eval/project.xml" target="_blank">APE interface test example</a></li>
-				<li><a href="index.html?url=example_eval/mushra_example.xml" target="_blank">MUSHRA interface test example</a></li>
-				<li><a href="index.html?url=example_eval/AB_example.xml" target="_blank">AB interface test example</a></li>
-				<li><a href="index.html?url=example_eval/horizontal_example.xml" target="_blank">Horizontal interface test example</a></li>
-				<li><a href="index.html?url=example_eval/radio_example.xml" target="_blank">Radio interface test example</a></li>
-				<li><a href="test_create/test_create.html" target="_blank">Test creator</a></li>
-				<li><a href="analyse.html" target="_blank">Analysis and diagnostics of results</a></li>
-			</ul>
-			<br>
-			<ul>
-				<li><a href="LICENSE.txt" target="_blank">License</a></li>
-				<li><a href="CITING.txt" target="_blank">Citing</a></li>
-				<li><a href="docs/Instructions/Instructions.pdf" target="_blank">Instructions</a></li>
-			</ul>
-		</div>
-	</body>
-</html>
--- a/index.html	Wed Apr 20 16:21:08 2016 +0100
+++ b/index.html	Wed Apr 20 17:22:18 2016 +0100
@@ -1,6 +1,6 @@
 <!DOCTYPE html>
 <html lang="en">
-	<head>
+    <head>
 		<meta charset="utf-8" />
 
 
@@ -47,10 +47,24 @@
 	</head>
 
 	<body>
-		<!-- Load up the default page interface allowing for project setting loads, even if hard-coded-->
-		<!-- Actual test interface design should be contained in the .js for ease of dynamic content-->
 		<div id='topLevelBody'>
-            <span>Web Audio Evaluation Toolbox</span>
+			<h1>Web Audio Evaluation Tool</h1>
+			<h2>Start menu </h2>
+			<ul>
+				<li><a href="index.html?url=example_eval/project.xml" target="_blank">APE interface test example</a></li>
+				<li><a href="index.html?url=example_eval/mushra_example.xml" target="_blank">MUSHRA interface test example</a></li>
+				<li><a href="index.html?url=example_eval/AB_example.xml" target="_blank">AB interface test example</a></li>
+				<li><a href="index.html?url=example_eval/horizontal_example.xml" target="_blank">Horizontal interface test example</a></li>
+				<li><a href="index.html?url=example_eval/radio_example.xml" target="_blank">Radio interface test example</a></li>
+				<li><a href="test_create/test_create.html" target="_blank">Test creator</a></li>
+				<li><a href="analyse.html" target="_blank">Analysis and diagnostics of results</a></li>
+			</ul>
+			<br>
+			<ul>
+				<li><a href="LICENSE.txt" target="_blank">License</a></li>
+				<li><a href="CITING.txt" target="_blank">Citing</a></li>
+				<li><a href="docs/Instructions/Instructions.pdf" target="_blank">Instructions</a></li>
+			</ul>
 		</div>
         <div id="popupHolder" class="popupHolder" style="visibility: hidden; z-index: -1">
             <div id="popupContent">
--- a/python/score_parser.py	Wed Apr 20 16:21:08 2016 +0100
+++ b/python/score_parser.py	Wed Apr 20 17:22:18 2016 +0100
@@ -13,19 +13,19 @@
 # XML results files location
 if len(sys.argv) == 1:
     folder_name = "../saves"    # Looks in 'saves/' folder from 'scripts/' folder
-    print "Use: python score_parser.py [rating_folder_location]"
-    print "Using default path: " + folder_name
+    print("Use: python score_parser.py [rating_folder_location]")
+    print("Using default path: " + folder_name)
 elif len(sys.argv) == 2:
     folder_name = sys.argv[1]   # First command line argument is folder
 
 # check if folder_name exists
 if not os.path.exists(folder_name):
     #the file is not there
-    print "Folder '"+folder_name+"' does not exist."
+    print("Folder '"+folder_name+"' does not exist.")
     sys.exit() # terminate script execution
 elif not os.access(os.path.dirname(folder_name), os.W_OK):
     #the file does exist but write privileges are not given
-    print "No write privileges in folder '"+folder_name+"'."
+    print("No write privileges in folder '"+folder_name+"'.")
 
     
 # CODE
@@ -47,11 +47,11 @@
             page_name = page.get('ref') # get page reference ID
                        
             if page_name is None: # ignore 'empty' audio_holders
-                print "WARNING: " + file_name + " contains empty audio holder. (score_parser.py)"
+                print("WARNING: " + file_name + " contains empty audio holder. (score_parser.py)")
                 break
                 
             if page.get('state') != "complete":
-                print "WARNING:" + file_name + " contains incomplete page " +page_name+ ". (score_parser.py)"
+                print("WARNING: " + file_name + " contains incomplete page " +page_name+ ". (score_parser.py)")
                 break;
 
             file_name = folder_name+'/ratings/'+page_name+'-ratings.csv' # score file name
@@ -77,7 +77,7 @@
             if os.path.isfile(file_name):
                 with open(file_name, 'r') as readfile:
                     filereader = csv.reader(readfile, delimiter=',')
-                    headerrow = filereader.next()
+                    headerrow = next(filereader)
 
                 # If file hasn't been opened yet this time, remove all rows except header
                 if file_name not in file_history:
@@ -97,7 +97,7 @@
                         filewriter.writerow(headerrow + newfragments) # write new header
                         with open(file_name, 'r') as readfile:
                             filereader = csv.reader(readfile, delimiter=',')
-                            filereader.next() # skip header
+                            next(filereader) # skip header
                             for row in filereader: # rewrite row plus empty cells for every new fragment name
                                 filewriter.writerow(row + ['']*len(newfragments))
                     os.rename('temp.csv', file_name) # replace old file with temp file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test.html	Wed Apr 20 17:22:18 2016 +0100
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+
+
+		<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
+		Remove this if you use the .htaccess -->
+		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
+
+		<title>Web Audio Evaluation Tool</title>
+		<meta name="description" content="" />
+		<meta name="author" content="" />
+		
+		<!-- Load up the default core JS and CSS files-->
+		<link rel='stylesheet' type='text/css' href='css/core.css'>
+		<!-- Use jQuery hosted from Google CDN -->
+		<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>-->
+		<script type="text/javascript" src="js/jquery-2.1.4.js"></script>
+        <script type="text/javascript" src='js/specification.js'></script>
+		<script type="text/javascript" src='js/core.js'></script>
+		<script type="text/javascript" src='js/loudness.js'></script>
+		<script type="text/javascript" src='js/xmllint.js'></script>
+        <script type="text/javascript" src='js/WAVE.js'></script>
+		<script type="text/javascript">
+			// SEARCH QUERY: By using the GET Request option ?url=loca/path/to/project.xml in the URL bar, you can load a project quickly
+			if (window.location.search.length != 0)
+			{
+				var search = window.location.search.split('?')[1];
+				// Now split the requests into pairs
+				var searchQueries = search.split('&');
+				for (var i in searchQueries)
+				{
+					// Split each request into
+					searchQueries[i] = searchQueries[i].split('=');
+					if (searchQueries[i][0] == "url")
+					{
+						url = decodeURI(searchQueries[i][1]);
+					}
+				}
+				loadProjectSpec(url);
+				window.onbeforeunload = function() {
+					return "Please only leave this page once you have completed the tests. Are you sure you have completed all testing?";
+				};
+			}
+		</script>
+	</head>
+
+	<body>
+		<!-- Load up the default page interface allowing for project setting loads, even if hard-coded-->
+		<!-- Actual test interface design should be contained in the .js for ease of dynamic content-->
+		<div id='topLevelBody'>
+            <span>Web Audio Evaluation Toolbox</span>
+		</div>
+        <div id="popupHolder" class="popupHolder" style="visibility: hidden; z-index: -1">
+            <div id="popupContent">
+                <div id="popupTitleHolder" style="text-align: center">
+                    <span id="popupTitle"></span>
+                </div>
+                <div id="popupResponse"></div>
+            </div>
+            <button id="popup-proceed" class="popupButton">Next</button>
+            <button id="popup-previous" class="popupButton">Back</button>
+        </div>
+        <div class="testHalt" style="visibility: hidden; z-index: -2"></div>
+	</body>
+</html>