From c6f728b58c3d3d6ab733c868d1916ae792e4655f Mon Sep 17 00:00:00 2001 From: creedowl Date: Thu, 16 Aug 2018 13:24:44 +0800 Subject: [PATCH] fix missing output_name when import/export porblem --- problem/serializers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/problem/serializers.py b/problem/serializers.py index 01ee6771..dbea96b7 100644 --- a/problem/serializers.py +++ b/problem/serializers.py @@ -154,7 +154,7 @@ class ExportProblemSerializer(serializers.ModelSerializer): return self._html_format_value(obj.hint) def get_test_case_score(self, obj): - return [{"score": item["score"], "input_name": item["input_name"]} + return [{"score": item["score"], "input_name": item["input_name"], "output_name": item["output_name"]} for item in obj.test_case_score] if obj.rule_type == ProblemRuleType.OI else None def get_spj(self, obj): @@ -200,6 +200,7 @@ class FormatValueSerializer(serializers.Serializer): class TestCaseScoreSerializer(serializers.Serializer): score = serializers.IntegerField(min_value=1) input_name = serializers.CharField(max_length=32) + output_name = serializers.CharField(max_length=32) class TemplateSerializer(serializers.Serializer):