Skip to content

Commit

Permalink
Update serializers.py
Browse files Browse the repository at this point in the history
  • Loading branch information
alesanchezr authored Nov 2, 2024
1 parent 560db3b commit 9f4ec01
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion breathecode/assessment/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,23 @@ class HookUserAssessmentSerializer(serpy.Serializer):
status_text = serpy.Field()

conversion_info = serpy.Field()
total_score = serpy.Field()
comment = serpy.Field()

started_at = serpy.Field()
finished_at = serpy.Field()

created_at = serpy.Field()

summary = serpy.MethodField()
def get_summary(self, obj):
total_score, last_one = obj.get_score()

last_answer = None
if last_one is not None:
last_answer = AnswerSmallSerializer(last_one).data

return {"last_answer": last_answer, "live_score": total_score}


class PublicUserAssessmentSerializer(serpy.Serializer):
id = serpy.Field()
Expand Down

0 comments on commit 9f4ec01

Please sign in to comment.