changeset 2467:221688a8be4f

Merge branch 'master' into Dev_main
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Tue, 02 Aug 2016 12:26:19 +0100
parents 496fde335890 (current diff) d26623bd65e0 (diff)
children 8273da734d07
files js/core.js
diffstat 15 files changed, 44 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/README.md	Thu Jul 07 10:04:35 2016 +0100
+++ b/README.md	Tue Aug 02 12:26:19 2016 +0100
@@ -13,7 +13,7 @@
 
 ## Instructions
 
-Please refer to the [Wiki](https://github.com/BrechtDeMan/WebAudioEvaluationTool/wiki) or the documentation in ['docs/Instructions/Instructions.pdf'](https://github.com/BrechtDeMan/WebAudioEvaluationTool/raw/master/docs/Instructions/Instructions.pdf).
+Please refer to the [Wiki](https://github.com/BrechtDeMan/WebAudioEvaluationTool/wiki). 
 
 ### Preview
 The video below shows you can set up a simple test from scratch in under five minutes (click to open): 
Binary file docs/Instructions/img/mat.JPG has changed
Binary file docs/Instructions/img/pcvsmacvslinux.jpg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/media/example/attribution.txt	Tue Aug 02 12:26:19 2016 +0100
@@ -0,0 +1,6 @@
+Excerpts from 'countdown.wav' by Freesound user Corsica_S
+
+URL: https://www.freesound.org/people/Corsica_S/sounds/82986/
+
+License: Creative Commons Attribution 3.0 Unported (CC BY 3.0)
+License URL: https://creativecommons.org/licenses/by/3.0/
--- a/php/comment_parser.php	Thu Jul 07 10:04:35 2016 +0100
+++ b/php/comment_parser.php	Tue Aug 02 12:26:19 2016 +0100
@@ -1,5 +1,8 @@
 <?php
 // Comment Parser for PHP
+header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
 class audioElement {
     function __construct($id) {
         $this->id = $id;
--- a/php/get_filtered_count.php	Thu Jul 07 10:04:35 2016 +0100
+++ b/php/get_filtered_count.php	Tue Aug 02 12:26:19 2016 +0100
@@ -1,4 +1,7 @@
 <?php
+header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
 //http://stackoverflow.com/questions/4444475/transfrom-relative-path-into-absolute-url-using-php
 include "rel2abs.php";
 
--- a/php/get_filtered_score.php	Thu Jul 07 10:04:35 2016 +0100
+++ b/php/get_filtered_score.php	Tue Aug 02 12:26:19 2016 +0100
@@ -1,4 +1,7 @@
 <?php
+header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
 class nestedObject {
     function __construct($id) {
         $this->id = $id;
--- a/php/get_tests.php	Thu Jul 07 10:04:35 2016 +0100
+++ b/php/get_tests.php	Tue Aug 02 12:26:19 2016 +0100
@@ -1,4 +1,7 @@
 <?php
+header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
 /*
     Get Tests
     
--- a/php/keygen.php	Thu Jul 07 10:04:35 2016 +0100
+++ b/php/keygen.php	Tue Aug 02 12:26:19 2016 +0100
@@ -1,4 +1,7 @@
 <?php
+header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
 // This checks the key sent by the JavaScript against the current bunch of saves
 // XML Saves location - assumes it will be saves/
 $saves = glob("../saves/*.xml");
--- a/php/pool.php	Thu Jul 07 10:04:35 2016 +0100
+++ b/php/pool.php	Tue Aug 02 12:26:19 2016 +0100
@@ -1,4 +1,7 @@
 <?php
+header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
 // This works out the pool of pages to force the browser to use from the master pool set by 'modifying' the XML file
 //
 
--- a/php/pseudo.php	Thu Jul 07 10:04:35 2016 +0100
+++ b/php/pseudo.php	Tue Aug 02 12:26:19 2016 +0100
@@ -1,6 +1,9 @@
 <?php
     header('Access-Control-Allow-Origin: *');
 	header("Content-type: text/xml");
+    header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+    header("Cache-Control: post-check=0, pre-check=0", false);
+    header("Pragma: no-cache");
     $files = glob('../saves/' . '*.xml');
     $numsaves = 0;
     if ( $files !== false )
@@ -8,14 +11,14 @@
         $numsaves = count( $files );
     }
 
-    $files = glob('tests/' . '*.xml');
+    $files = glob('../tests/' . '*.xml');
     $numtests = 0;
     if ( $numtests !== false )
     {
         $numtests = count( $files );
     }
 
-    $testID = ($numsaves % $numtests)-1;
+    $testID = ($numsaves % $numtests);
 
 	readfile($files[$testID]);
-?>
\ No newline at end of file
+?>
--- a/php/save.php	Thu Jul 07 10:04:35 2016 +0100
+++ b/php/save.php	Tue Aug 02 12:26:19 2016 +0100
@@ -1,4 +1,7 @@
 <?php
+    header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+    header("Cache-Control: post-check=0, pre-check=0", false);
+    header("Pragma: no-cache");
 	error_reporting(0);
 	$saveFilenamePrefix = isset($_GET['saveFilenamePrefix']) ? $_GET['saveFilenamePrefix'].'-' : '';
 	header('Access-Control-Allow-Origin: *');
--- a/php/score_parser.php	Thu Jul 07 10:04:35 2016 +0100
+++ b/php/score_parser.php	Tue Aug 02 12:26:19 2016 +0100
@@ -1,4 +1,7 @@
 <?php
+header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
 // Value parser for WAET XML
 // testPage --> axis --> element --> value
 class nestedObject {
--- a/python/comment_parser.py	Thu Jul 07 10:04:35 2016 +0100
+++ b/python/comment_parser.py	Tue Aug 02 12:26:19 2016 +0100
@@ -74,14 +74,17 @@
                                             dialect="excel",
                                             quoting=csv.QUOTE_ALL)
                         commentstr = audioelement.find("./comment/response").text
+                        valuestr = audioelement.find("./value").text
 
                         if commentstr is None:
                            commentstr = ''
+                        if valuestr is None:
+                           valuestr = ''
 
                         # anonymous comments:
                         #writer.writerow([commentstr])  # .encode("utf-8")
                         # comments with (file) name:
-                        writer.writerow([file[:-4]] + [commentstr]) 
+                        writer.writerow([file[:-4]] + [valuestr] + [commentstr.encode("utf-8")]) 
 
                     #TODO Replace 'new line' in comment with something else?
                         
--- a/python/pythonServer.py	Thu Jul 07 10:04:35 2016 +0100
+++ b/python/pythonServer.py	Tue Aug 02 12:26:19 2016 +0100
@@ -28,6 +28,7 @@
 
 PSEUDO_PATH = '../tests/'
 pseudo_files = []
+pseudo_index = 0
 for filename in os.listdir(PSEUDO_PATH):
     print(filename)
     if filename.endswith('.xml'):
@@ -221,6 +222,7 @@
     s.end_headers()
 
 def http_do_GET(request):
+    global pseudo_index
     if(request.client_address[0] == "127.0.0.1"):
         if (request.path == "/favicon.ico"):
             send404(request)
@@ -233,7 +235,7 @@
             if (request.path == '/'):
                 request.path = '/index.html'
             elif (request.path == '/pseudo.xml'):
-                request.path = '/'+PSEUDO_PATH + pseudo_files[pseudo_index]
+                request.path = PSEUDO_PATH + pseudo_files[pseudo_index]
                 print(request.path)
                 pseudo_index += 1
                 pseudo_index %= len(pseudo_files)