ac_algorithm/practice.rs
1//! Practice attempts: out-of-contest problem work (precision training,
2//! virtual contests) recorded against the same task/solution model.
3
4use std::time::SystemTime;
5
6use serde::{Deserialize, Serialize};
7
8use crate::ids::{PracticeAttemptId, SolutionId, TaskId};
9use crate::verdict::LocalVerdict;
10
11/// A recorded attempt at a task outside a rated contest.
12#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
13pub struct PracticeAttempt {
14 /// Attempt identifier.
15 pub id: PracticeAttemptId,
16 /// Task attempted.
17 pub task: TaskId,
18 /// Solution used, when one was recorded.
19 pub solution: Option<SolutionId>,
20 /// Best local outcome observed during the attempt.
21 pub outcome: Option<LocalVerdict>,
22 /// When the attempt started.
23 pub started_at: SystemTime,
24 /// When the attempt ended, if it has.
25 pub finished_at: Option<SystemTime>,
26}