# HG changeset patch # User Nicholas Jillings # Date 1543413124 0 # Node ID 5419fc9cbb15d6a9d22c83696f1d88c5c848a794 # Parent a543efc6ef1d3365582d6c87ac0f4a3a448eb21d# Parent a8455b0766cd8819bc2d9d96be83f1af3a0e5e71 Merge branch 'vnext' into Dev_main diff -r a543efc6ef1d -r 5419fc9cbb15 interfaces/ordinal.js --- 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 diff -r a543efc6ef1d -r 5419fc9cbb15 python/commentquestion_parser.py --- 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 diff -r a543efc6ef1d -r 5419fc9cbb15 python/score_parser.py --- 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 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 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