fnp
/
edumed.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
69ed58f
)
fix stupid bug with determining the number of marks
author
Jan Szejko
<janek37@gmail.com>
Wed, 14 Mar 2018 09:41:46 +0000
(10:41 +0100)
committer
Jan Szejko
<janek37@gmail.com>
Wed, 14 Mar 2018 09:41:46 +0000
(10:41 +0100)
stage2/models.py
patch
|
blob
|
history
diff --git
a/stage2/models.py
b/stage2/models.py
index
8407ef2
..
244322d
100644
(file)
--- a/
stage2/models.py
+++ b/
stage2/models.py
@@
-175,8
+175,8
@@
class Answer(models.Model):
def total_points(self):
criterion_count = self.assignment.markcriterion_set.count()
- for expert
in self.experts.all
():
- marks = self.mark_set.filter(expert
=expert
)
+ for expert
_id in self.mark_set.values_list('expert_id', flat=True).distinct
():
+ marks = self.mark_set.filter(expert
_id=expert_id
)
if len(marks) == criterion_count:
yield sum(mark.points for mark in marks)