fnp
/
edumed.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
671a4ba
)
update result csv for multiple mark criteria
author
Jan Szejko
<janek37@gmail.com>
Tue, 20 Mar 2018 11:26:51 +0000
(12:26 +0100)
committer
Jan Szejko
<janek37@gmail.com>
Tue, 20 Mar 2018 11:26:51 +0000
(12:26 +0100)
stage2/views.py
patch
|
blob
|
history
diff --git
a/stage2/views.py
b/stage2/views.py
index
a010ef4
..
11be830
100644
(file)
--- a/
stage2/views.py
+++ b/
stage2/views.py
@@
-258,11
+258,10
@@
def csv_results(request):
participant.contact.body['school'],
]
for assignment, expert in assignments_experts:
participant.contact.body['school'],
]
for assignment, expert in assignments_experts:
- try:
- row.append(
- Mark.objects.get(
- expert=expert, answer__assignment=assignment, answer__participant=participant).points)
- except Mark.DoesNotExist:
+ marks = expert.mark_set.filter(answer__assignment=assignment, answer__participant=participant)
+ if marks:
+ row.append(sum(mark.points for mark in marks))
+ else:
row.append('')
for assignment in assignments:
row.append('%.2f' % participant.answer_set.get(assignment=assignment).score())
row.append('')
for assignment in assignments:
row.append('%.2f' % participant.answer_set.get(assignment=assignment).score())