BhattAnsh/Quiz-Quest

Code Improvements Needed for QuizQuest Backend Models

Closed this issue · 1 comments

GSSoC Contributor

Description

I would like to propose several improvements to the backend models defined in the QuizQuest project, specifically in the src/models directory.

Current Issues:

  1. Typographical Error: The codeSchmea variable name contains a typo and should be corrected to codeSchema for consistency.
  2. Data Type for liveUntil: The liveUntil field is currently defined as a String, which should be changed to a Date type for proper date handling.
  3. Reference Type for createdBy: The createdBy field is currently an array of ObjectId. If the intention is to allow only one user to create a quiz, this should be changed to a single ObjectId.
  4. Unused Import: The import statement for mongo is unnecessary and should be removed to clean up the code.
  5. Export Consistency: Ensure that the exported model names consistently match the schema names for clarity.

Proposed Changes:

  • Correct the typo in the code schema name.
  • Change the data type of liveUntil from String to Date.
  • Modify createdBy to a single ObjectId unless multiple creators are required.
  • Remove the unused import of mongo.
  • Ensure that the exported model names align with the schema names.

Implementing these changes will enhance the maintainability and integrity of the backend code for the QuizQuest application. Thank you for considering this issue!

I have submitted a pull request for this issue, please check.