TestResultView post

This commit is contained in:
cja committed 2025-06-03 13:22:01 +03:00
1 parent 8ff7729e0c
commit d84d385eb2
2 files changed
+49 -16

No files matched your search

+8 -1
View File
@@ -93,7 +93,14 @@ class TestAttemptSerializer(serializers.ModelSerializer):
class TestResultSerializer(serializers.ModelSerializer):
attempt = TestAttemptSerializer(read_only=True)
answer = serializers.PrimaryKeyRelatedField(queryset=TestAnswer.objects.all(), many=False)
question = serializers.PrimaryKeyRelatedField(
queryset=TestQuestion.objects.all(),
allow_null=True
)
answer = serializers.PrimaryKeyRelatedField(
queryset=TestAnswer.objects.all(),
allow_null=True,
many=False)
comment = serializers.CharField(allow_null=True, required=False)
class Meta: