|
a/OSSEval/analysis/templatetags/custom_tags.py |
|
b/OSSEval/analysis/templatetags/custom_tags.py |
|
... |
|
... |
8 |
instance = Instance.objects.get(pk=instance_id)
|
8 |
instance = Instance.objects.get(pk=instance_id)
|
9 |
question = Question.objects.get(pk=question_id)
|
9 |
question = Question.objects.get(pk=question_id)
|
10 |
try:
|
10 |
try:
|
11 |
answer = Answer.objects.get(question=question, instance=instance)
|
11 |
answer = Answer.objects.get(question=question, instance=instance)
|
12 |
choice = question.choice_set.get(order=answer.value_integer)
|
12 |
choice = question.choice_set.get(order=answer.value_integer)
|
|
|
13 |
if choice.todo != "":
|
|
|
14 |
return "<div title=\"" + choice.todo + "\">(" + str(answer.score) + ") " + choice.text + "</div>"
|
|
|
15 |
else:
|
13 |
return "(" + str(answer.score) + ") " + choice.text
|
16 |
return "(" + str(answer.score) + ") " + choice.text
|
14 |
except:
|
17 |
except:
|
15 |
return "<font color=red>not answered</font>"
|
18 |
return "<font color=red>not answered</font>"
|
16 |
|
19 |
|
17 |
|
20 |
|
18 |
@register.simple_tag
|
21 |
@register.simple_tag
|