From 0f1b530c89862d2c00e61273bd0c731a144034df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjam=C3=ADn=20Mravec?= Date: Sat, 11 Nov 2023 17:40:07 +0100 Subject: [PATCH] Added stats to problem administation --- competition/serializers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/competition/serializers.py b/competition/serializers.py index 516ee7fb..3cc12a7c 100644 --- a/competition/serializers.py +++ b/competition/serializers.py @@ -195,7 +195,7 @@ class ProblemWithSolutionsSerializer(serializers.ModelSerializer): solution_set = SolutionAdministrationSerializer(many=True) correction = ProblemCorrectionSerializer(many=False) series = SeriesSerializer() - + histogram = serializers.SerializerMethodField('get_series_histogram') total_solutions = serializers.SerializerMethodField('get_series_num_solutions') @@ -207,7 +207,7 @@ class Meta: def get_series_histogram(self, obj): return models.Problem.get_stats(obj).get('histogram') - + def get_series_num_solutions(self, obj): return models.Problem.get_stats(obj).get('num_solutions')