# HG changeset patch # User Nicholas Jillings # Date 1501658963 -3600 # Node ID eaa5dc4aedbf98d835c7659a366853f29adf012b # Parent ac6720456322aba3f0d295e0a82a42814dd930cd Further fixes to #215. Fixed for MUSHRA and for outside-reference files diff -r ac6720456322 -r eaa5dc4aedbf python/generate_report.py --- a/python/generate_report.py Wed Aug 02 08:10:46 2017 +0100 +++ b/python/generate_report.py Wed Aug 02 08:29:23 2017 +0100 @@ -227,17 +227,18 @@ # number of comments (interesting if comments not mandatory) for audioelement in audioelements: - response = audioelement.find("./comment/response") - was_played = audioelement.find("./metric/metricresult/[@name='elementFlagListenedTo']") - was_moved = audioelement.find("./metric/metricresult/[@name='elementFlagMoved']") - if response is not None and response.text is not None and len(response.text) > 1: - number_of_comments += 1 - else: - number_of_missing_comments += 1 - if was_played is not None and was_played.text == 'false': - not_played.append(audioelement.get('name')) - if was_moved is not None and was_moved.text == 'false': - not_moved.append(audioelement.get('name')) + if audioelement.get("type") != "outside-reference": + response = audioelement.find("./comment/response") + was_played = audioelement.find("./metric/metricresult/[@name='elementFlagListenedTo']") + was_moved = audioelement.find("./metric/metricresult/[@name='elementFlagMoved']") + if response is not None and response.text is not None and len(response.text) > 1: + number_of_comments += 1 + else: + number_of_missing_comments += 1 + if was_played is not None and was_played.text == 'false': + not_played.append(audioelement.get('name')) + if was_moved is not None and was_moved.text == 'false': + not_moved.append(audioelement.get('name')) # update global counters total_empty_comments += number_of_missing_comments diff -r ac6720456322 -r eaa5dc4aedbf python/score_parser.py --- a/python/score_parser.py Wed Aug 02 08:10:46 2017 +0100 +++ b/python/score_parser.py Wed Aug 02 08:29:23 2017 +0100 @@ -76,7 +76,8 @@ # get alphabetical array of fragment IDs from this subject's XML fragmentnamelist = [] # make empty list for audioelement in page.findall("./audioelement"): # iterate over all audioelements - fragmentnamelist.append(audioelement.get('ref')) # add to list + if audioelement.get("type") != "outside-reference": + fragmentnamelist.append(audioelement.get('ref')) # add to list fragmentnamelist = sorted(fragmentnamelist); # Sort the list storage[page_name]['header'] = fragmentnamelist; diff -r ac6720456322 -r eaa5dc4aedbf python/timeline_view_movement.py --- a/python/timeline_view_movement.py Wed Aug 02 08:10:46 2017 +0100 +++ b/python/timeline_view_movement.py Wed Aug 02 08:29:23 2017 +0100 @@ -112,6 +112,10 @@ if audioelement is not None: # Check it exists audio_id = str(audioelement.get('ref')) + # break if outside-reference + if audioelement.get("type") == "outside-reference": + break; + # break if no initial position.... initial_position_temp = audioelement.find("./metric/metricresult/[@name='elementInitialPosition']") if initial_position_temp is None: