Skip to content

feat(quiz): enforce time limit and max attempt rules on quiz submission#106

Merged
portableDD merged 2 commits intoNexacore-Org:mainfrom
Ibinola:feat/add-quiz-timer
Jun 2, 2025
Merged

feat(quiz): enforce time limit and max attempt rules on quiz submission#106
portableDD merged 2 commits intoNexacore-Org:mainfrom
Ibinola:feat/add-quiz-timer

Conversation

@Ibinola
Copy link
Contributor

@Ibinola Ibinola commented Jun 2, 2025

📌 Pull Request Title

Description

This PR addresses #96 by enforcing quiz submission rules:

  • ⛔ Rejects submissions if the user exceeds the allowed number of attempts.
  • ⏱️ Rejects submissions made after the quiz time limit has passed.

The validation is handled in the submitQuizAttempt service logic.

Related Issues

Closes #96

Changes Made

  • Added maxAttempts and timeLimit fields to the Quiz entity.
  • Updated QuizAttempt entity to include startTime, endTime, and attemptCount.
  • Enforced time limit and max attempt validation in submitQuizAttempt method.
  • Updated the /quizzes/attempts/:id/submit endpoint to reject invalid submissions.
  • Added utility method to validate quiz submission timing and attempt count.

How to Test

N/A

Screenshots (if applicable)

N/A

Checklist

  • My code follows the project's coding style.
  • I have tested these changes locally.
  • Documentation has been updated where necessary.

@portableDD portableDD merged commit be55546 into Nexacore-Org:main Jun 2, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Quiz Timer and Attempt Limit

2 participants