allow for non-numeric values which will be ignored in calculations

This commit is contained in:
Helmut Merz 2014-05-29 11:32:46 +02:00
parent 0f03b894f4
commit 358545833f

View file

@ -98,7 +98,7 @@ class Response(object):
score = scoreMax = 0.0 score = scoreMax = 0.0
for qu in qugroup.questions: for qu in qugroup.questions:
value = self.values.get(qu) value = self.values.get(qu)
if value is None: if value is None or isinstance(value, basestring):
continue continue
if qu.revertAnswerOptions: if qu.revertAnswerOptions:
value = qu.answerRange - value - 1 value = qu.answerRange - value - 1