import '../models/question.dart'; /// A single attempt/quiz session. class Attempt { /// Unique identifier for this attempt. final String id; /// List of questions included in this attempt. final List questions; /// Timestamp when the attempt was started (milliseconds since epoch). final int startTime; const Attempt({ required this.id, required this.questions, required this.startTime, }); /// Creates a copy of this attempt with the given fields replaced. Attempt copyWith({ String? id, List? questions, int? startTime, }) { return Attempt( id: id ?? this.id, questions: questions ?? this.questions, startTime: startTime ?? this.startTime, ); } /// Number of questions in this attempt. int get questionCount => questions.length; }