changeset 3128:5419fc9cbb15

Merge branch 'vnext' into Dev_main
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Wed, 28 Nov 2018 13:52:04 +0000
parents a543efc6ef1d (current diff) a8455b0766cd (diff)
children a21b88d212b6
files
diffstat 3 files changed, 16 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/interfaces/ordinal.js	Wed Jul 18 17:04:53 2018 +0100
+++ b/interfaces/ordinal.js	Wed Nov 28 13:52:04 2018 +0000
@@ -374,6 +374,7 @@
         // Return the current value of the object. If there is no value, return 0
         var pos = this.getElementPosition();
         var rank = pos / (audioEngineContext.audioObjects.length - 1);
+        return rank;
     };
     this.getPresentedId = function () {
         // Return the presented ID of the object. For instance, the APE has sliders starting from 0. Whilst AB has alphabetical scale
--- a/python/commentquestion_parser.py	Wed Jul 18 17:04:53 2018 +0100
+++ b/python/commentquestion_parser.py	Wed Nov 28 13:52:04 2018 +0000
@@ -42,6 +42,7 @@
         # get the list of pages
         for page in root.findall("./page"):
             pagename = page.get("ref")
+            trackname = page.find('audioelement').get('ref')
             if pagename is None: # ignore 'empty' audio_holders
                 print("WARNING: " + filename + " contains empty audio holder. (commentquestion_parser.py)")
                 break
@@ -63,7 +64,7 @@
                 except KeyError:
                     commentStore = [];
                     questionStore[cqid] = commentStore
-                commentStore.append({"subject": subject_id, "value": response})
+                commentStore.append({"subject": subject_id, "value": response, "trackName": trackname})
 
 for page in pagestore.keys():
 	print page
@@ -73,6 +74,6 @@
 	for comment in pagestore[page].keys():
 		with open(pagedir+"/"+comment+".csv", "w") as csvfile:
 			filewriter = csv.writer(csvfile, delimiter=',')
-			filewriter.writerow(("save_id", "value"))
+			filewriter.writerow(("save_id", "value", "trackName"))
 			for entry in pagestore[page][comment]:
-				filewriter.writerow((entry["subject"], entry["value"]))
\ No newline at end of file
+				filewriter.writerow((entry["subject"], entry["value"], entry["trackName"]))
\ No newline at end of file
--- a/python/score_parser.py	Wed Jul 18 17:04:53 2018 +0100
+++ b/python/score_parser.py	Wed Nov 28 13:52:04 2018 +0000
@@ -66,13 +66,19 @@
 
             # Get the axis names
             pageConfig = root.find('./waet/page/[@id="'+page_name_root+'"]')
-            for interface in pageConfig.findall('./interface'):    # Get the <interface> nodes
-                interfaceName = interface.get("name"); # Get the axis name
-                if interfaceName == None:
-                    interfaceName = "default"   # If name not set, make name 'default'
+            if pageConfig is None:
+                interfaceName = "default"
                 if storage[page_name]['axis'].get(interfaceName) == None:
                     storage[page_name]['axis'][interfaceName] = {}  # If not in store for page, add empty dict
-                storage[page_name]['axis'][interfaceName][subject_id] = [] # Add the store for the session
+                storage[page_name]['axis'][interfaceName][subject_id] = []
+            else:
+                for interface in pageConfig.findall('./interface'):    # Get the <interface> nodes
+                    interfaceName = interface.get("name"); # Get the axis name
+                    if interfaceName == None:
+                        interfaceName = "default"   # If name not set, make name 'default'
+                    if storage[page_name]['axis'].get(interfaceName) == None:
+                        storage[page_name]['axis'][interfaceName] = {}  # If not in store for page, add empty dict
+                    storage[page_name]['axis'][interfaceName][subject_id] = [] # Add the store for the session
                     
             # header: fragment IDs in 'alphabetical' order
             # go to fragment column, or create new column if it doesn't exist yet