code: def validate_answer(self, value):
          
          # Check that the answer is JSON-serializable
          try:
              serialized = json.dumps(value)
          except (ValueError, TypeError):
              raise serializers.ValidationError("Answer value must be JSON-serializable")
  
          # Check the length of the serialized representation
          if len(serialized) > Submission.MAXSIZE:
              raise serializers.ValidationError("Maximum answer size exceeded.")
  
          return value
docs: Check that the answer is JSON-serializable and not too long.