Skip to content

Track per-team solve attempts with timestamped correctness state#30

Draft
Copilot wants to merge 18 commits into
mainfrom
copilot/store-solve-attempt-times
Draft

Track per-team solve attempts with timestamped correctness state#30
Copilot wants to merge 18 commits into
mainfrom
copilot/store-solve-attempt-times

Conversation

Copilot AI commented Apr 11, 2026

Copy link
Copy Markdown

This PR updates team progress tracking from a solved-set model to an append-only attempt history, recording both correctness and attempt time for each submission.

What changed

  • Replaced per-team solved puzzle storage with per-team Vec<SolveAttempt>.
  • Added SolveAttempt { puzzle_id, attempted_at, correct }.
  • Switched attempt timestamps to std::time::SystemTime (dropped jiff usage).
  • Updated submission flow to log every attempt (correct and incorrect).
  • Preserved existing behavior:
    • Incorrect submissions are rejected.
    • Already-solved puzzles cannot be solved again.
  • Added/kept helper logic to derive solved status from attempt history (team_has_solved_puzzle).
  • Kept state persistence compatible with the new team progress shape.

Validation

  • Rebased branch onto latest house-keeping (stacked PR base).
  • Ran make check successfully after updates.

Copilot AI linked an issue Apr 11, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add store for solve-attempt times and states Track per-team solve attempts with timestamped correctness state Apr 11, 2026
Copilot AI requested a review from jarjk April 11, 2026 14:32
@jarjk jarjk force-pushed the copilot/store-solve-attempt-times branch from 3091f5e to c82a9f1 Compare April 12, 2026 16:31
@jarjk

jarjk commented Apr 13, 2026

Copy link
Copy Markdown
Collaborator

@dependabot rebase

@jarjk

jarjk commented Apr 13, 2026

Copy link
Copy Markdown
Collaborator

@copilot rebase

jarjk and others added 2 commits April 13, 2026 12:04
Co-authored-by: jarjk <118479592+jarjk@users.noreply.github.com>
Co-authored-by: jarjk <118479592+jarjk@users.noreply.github.com>

Copilot AI commented Apr 13, 2026

Copy link
Copy Markdown
Author

@copilot rebase

Rebased as requested; branch is now updated at 6b78ab7.

@jarjk

jarjk commented Apr 22, 2026

Copy link
Copy Markdown
Collaborator

@copilot rebase

@jarjk

jarjk commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

@copilot drop jiff, use systemtime

Copilot AI and others added 4 commits April 23, 2026 19:20
Co-authored-by: jarjk <118479592+jarjk@users.noreply.github.com>
Co-authored-by: jarjk <118479592+jarjk@users.noreply.github.com>
…s' into copilot/store-solve-attempt-times

# Conflicts:
#	Cargo.toml
#	src/backend/endpoints.rs
#	src/backend/models.rs

Co-authored-by: jarjk <118479592+jarjk@users.noreply.github.com>

Copilot AI commented Apr 23, 2026

Copy link
Copy Markdown
Author

@copilot rebase

Done — rebased and updated branch at 7b5c493.

@copilot drop jiff, use systemtime

Done — removed jiff usage and switched solve-attempt timestamps to std::time::SystemTime in ffc960d.

@jarjk jarjk changed the base branch from main to house-keeping April 23, 2026 20:36
@jarjk

jarjk commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

@copilot rebase

jarjk and others added 9 commits April 23, 2026 20:41
Co-authored-by: jarjk <118479592+jarjk@users.noreply.github.com>
Co-authored-by: jarjk <118479592+jarjk@users.noreply.github.com>
Co-authored-by: jarjk <118479592+jarjk@users.noreply.github.com>
Co-authored-by: jarjk <118479592+jarjk@users.noreply.github.com>
Co-authored-by: jarjk <118479592+jarjk@users.noreply.github.com>
Co-authored-by: jarjk <118479592+jarjk@users.noreply.github.com>
Co-authored-by: jarjk <118479592+jarjk@users.noreply.github.com>
Co-authored-by: jarjk <118479592+jarjk@users.noreply.github.com>
Co-authored-by: jarjk <118479592+jarjk@users.noreply.github.com>

Copilot AI commented Apr 23, 2026

Copy link
Copy Markdown
Author

@copilot rebase

Done — rebased and updated branch at ea9765e.

Comment thread src/backend/endpoints.rs
};
solution.zeroize();
is_solution_valid.or_forbidden("érvénytelen megoldás ehhez a feladathoz")?;
let is_correct = is_solution_valid;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why new var?

Comment thread src/backend/models.rs
use std::time::UNIX_EPOCH;

#[test]
fn marks_puzzle_as_solved_only_for_correct_attempts() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this doesn't actually test anything, have a look at insta then

Base automatically changed from house-keeping to main April 24, 2026 11:28
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.

store solve-attempt times

2 participants