react-quiz-component icon indicating copy to clipboard operation
react-quiz-component copied to clipboard

Add Submit and Quit Feature

Open obiora198 opened this issue 4 months ago • 0 comments

Add Submit and Quit Feature

What does this PR do?

  • Adds a "Submit and Quit" button to allow users to end quizzes early
  • Preserves attempted answers and calculates partial scores
  • Includes confirmation dialog to prevent accidental quitting
  • Supports localization for all text elements

Why is this needed?

  • Users may need to exit quizzes prematurely due to time constraints or other reasons
  • Provides better user experience by saving progress instead of losing all data
  • Aligns with common quiz platform functionality

Changes Made

  1. Added handleQuitQuiz function to handle early submission
  2. Implemented confirmation modal component
  3. Added localization support for quit-related text
  4. Updated CSS for new UI elements
  5. Maintained backward compatibility

Screenshots

Screenshot 2025-08-19 122348 Screenshot 2025-08-19 122404

Testing

  • [x] Tested quit functionality with completed questions
  • [x] Tested quit functionality with no questions attempted
  • [x] Verified score calculation accuracy
  • [x] Tested localization support
  • [x] Verified no breaking changes to existing features

obiora198 avatar Aug 19 '25 11:08 obiora198