comparison scripts/evaluation_stats.py @ 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 3358d04605db
children
comparison
equal deleted inserted replaced
2241:4b527727d0c7 2242:86fd1dbae138
79 audioelements = audioholder.findall("./audioelement") # get audioelements 79 audioelements = audioholder.findall("./audioelement") # get audioelements
80 number_of_fragments += len(audioelements) # add length of this list to total 80 number_of_fragments += len(audioelements) # add length of this list to total
81 81
82 # number of comments (interesting if comments not mandatory) 82 # number of comments (interesting if comments not mandatory)
83 for audioelement in audioelements: 83 for audioelement in audioelements:
84 response = audioelement.find("./comment/response") 84 if audioelement.get("type") != "outside-reference":
85 was_played = audioelement.find("./metric/metricresult/[@name='elementFlagListenedTo']") 85 response = audioelement.find("./comment/response")
86 was_moved = audioelement.find("./metric/metricresult/[@name='elementFlagMoved']") 86 was_played = audioelement.find("./metric/metricresult/[@name='elementFlagListenedTo']")
87 if response.text is not None and len(response.text) > 1: 87 was_moved = audioelement.find("./metric/metricresult/[@name='elementFlagMoved']")
88 number_of_comments += 1 88 if response.text is not None and len(response.text) > 1:
89 else: 89 number_of_comments += 1
90 number_of_missing_comments += 1 90 else:
91 if was_played is not None and was_played.text == 'false': 91 number_of_missing_comments += 1
92 not_played += 1 92 if was_played is not None and was_played.text == 'false':
93 if was_moved is not None and was_moved.text == 'false': 93 not_played += 1
94 not_moved += 1 94 if was_moved is not None and was_moved.text == 'false':
95 not_moved += 1
95 96
96 # update global counters 97 # update global counters
97 total_empty_comments += number_of_missing_comments 98 total_empty_comments += number_of_missing_comments
98 total_not_played += not_played 99 total_not_played += not_played
99 total_not_moved += not_moved 100 total_not_moved += not_moved