allow question groups without feedback element
This commit is contained in:
parent
73839ea015
commit
d05b9f7f70
1 changed files with 5 additions and 1 deletions
|
@ -107,9 +107,13 @@ class Response(object):
|
|||
if scoreMax > 0.0:
|
||||
relScore = score / scoreMax
|
||||
wScore = relScore * len(qugroup.feedbackItems) - 0.00001
|
||||
if qugroup.feedbackItems:
|
||||
feedback = qugroup.feedbackItems[int(wScore)]
|
||||
else:
|
||||
feedback = u''
|
||||
result.append(dict(
|
||||
group=qugroup,
|
||||
feedback=qugroup.feedbackItems[int(wScore)],
|
||||
feedback=feedback,
|
||||
score=relScore))
|
||||
ranks = getRanks([r['score'] for r in result])
|
||||
for idx, r in enumerate(result):
|
||||
|
|
Loading…
Add table
Reference in a new issue