Skip to content

Bug: Quiz submission accepts empty answers, storing invalid quiz records #280

Description

@anshul23102

The quiz submission endpoint stores answer records without validating that answers are non-empty and properly formatted.

Problem: Empty answers accepted and persisted to database
Impact: Broken quiz analytics, invalid score calculations, data corruption

Solution: Validate all answers before database write:

  • Check non-empty
  • Check answer format matches expected type
  • Validate against question options
  • Return 400 if validation fails

Expected NSOC points: Level 2

Checklist:

  • Not a duplicate
  • Read CONTRIBUTING.md
  • No em dashes or AI mentions

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions