changeset 2242:86fd1dbae138

scripts/evaluation_stats.py ignores outside-reference audio elements
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Fri, 15 Apr 2016 16:11:47 +0100
parents 4b527727d0c7
children 0de305726129
files scripts/evaluation_stats.py
diffstat 1 files changed, 12 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/evaluation_stats.py	Fri Apr 15 13:31:53 2016 +0100
+++ b/scripts/evaluation_stats.py	Fri Apr 15 16:11:47 2016 +0100
@@ -81,17 +81,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.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 += 1
-                if was_moved is not None and was_moved.text == 'false': 
-                    not_moved += 1
+                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.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 += 1
+                    if was_moved is not None and was_moved.text == 'false': 
+                        not_moved += 1
             
             # update global counters
             total_empty_comments += number_of_missing_comments