Skip to content

feat: add submit answer and force timeout - #152

Merged
manlikeHB merged 1 commit into
songifi:refac/modular-architecturefrom
dinahmaccodes:issue136
Aug 19, 2025
Merged

feat: add submit answer and force timeout#152
manlikeHB merged 1 commit into
songifi:refac/modular-architecturefrom
dinahmaccodes:issue136

Conversation

@dinahmaccodes

@dinahmaccodes dinahmaccodes commented Aug 19, 2025

Copy link
Copy Markdown

Description

This pull request adds robust answer submission and timeout handling to the RoundPlayer model, along with comprehensive tests to ensure correct behavior and statistics tracking. The main changes are the introduction of two new methods for answer submission and timeout, as well as a suite of tests covering various scenarios.

New answer handling functionality

  • Added a submit_answer method to RoundPlayerTrait that validates answer submissions, updates player statistics (such as total/correct answers, scores, best and average times), handles timeouts, and returns detailed results.
  • Added a force_timeout method to RoundPlayerTrait to explicitly handle answer timeouts, updating statistics and returning a result indicating a timeout occurred.

Testing and validation

  • Introduced extensive unit tests for submit_answer and force_timeout, covering correct/incorrect answers, timeouts, invalid states (no active card, round completed, invalid time), and statistics accumulation including best/average time and score tracking.

All tests passing
Closes #136

image

@dinahmaccodes

dinahmaccodes commented Aug 19, 2025

Copy link
Copy Markdown
Author

@Xaxxoo @manlikeHB
Please review

@manlikeHB manlikeHB left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! LGTM!

@manlikeHB
manlikeHB merged commit 649f5ea into songifi:refac/modular-architecture Aug 19, 2025
1 check 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.

2 participants