flagging
This commit is contained in:
@@ -70,6 +70,12 @@ class Deck {
|
||||
/// Number of questions marked as known.
|
||||
int get knownCount => questions.where((q) => q.isKnown).length;
|
||||
|
||||
/// Number of questions the user has flagged.
|
||||
int get flaggedCount => questions.where((q) => q.isFlagged).length;
|
||||
|
||||
/// Questions that the user has flagged.
|
||||
List<Question> get flaggedQuestions => questions.where((q) => q.isFlagged).toList();
|
||||
|
||||
/// Practice percentage: (known / total) * 100
|
||||
double get practicePercentage {
|
||||
if (questions.isEmpty) return 0.0;
|
||||
|
||||
@@ -24,6 +24,9 @@ class Question {
|
||||
/// Whether this question is considered "known".
|
||||
final bool isKnown;
|
||||
|
||||
/// Whether the user has flagged this question for review.
|
||||
final bool isFlagged;
|
||||
|
||||
/// Priority points (higher = more likely to be selected).
|
||||
final int priorityPoints;
|
||||
|
||||
@@ -44,6 +47,7 @@ class Question {
|
||||
@Deprecated('Use correctAnswerIndices instead') int? correctAnswerIndex,
|
||||
this.consecutiveCorrect = 0,
|
||||
this.isKnown = false,
|
||||
this.isFlagged = false,
|
||||
this.priorityPoints = 0,
|
||||
this.lastAttemptIndex = -1,
|
||||
this.totalCorrectAttempts = 0,
|
||||
@@ -61,6 +65,7 @@ class Question {
|
||||
@Deprecated('Use correctAnswerIndices instead') int? correctAnswerIndex,
|
||||
int? consecutiveCorrect,
|
||||
bool? isKnown,
|
||||
bool? isFlagged,
|
||||
int? priorityPoints,
|
||||
int? lastAttemptIndex,
|
||||
int? totalCorrectAttempts,
|
||||
@@ -74,6 +79,7 @@ class Question {
|
||||
correctAnswerIndex: correctAnswerIndex ?? this.correctAnswerIndex,
|
||||
consecutiveCorrect: consecutiveCorrect ?? this.consecutiveCorrect,
|
||||
isKnown: isKnown ?? this.isKnown,
|
||||
isFlagged: isFlagged ?? this.isFlagged,
|
||||
priorityPoints: priorityPoints ?? this.priorityPoints,
|
||||
lastAttemptIndex: lastAttemptIndex ?? this.lastAttemptIndex,
|
||||
totalCorrectAttempts: totalCorrectAttempts ?? this.totalCorrectAttempts,
|
||||
@@ -117,6 +123,7 @@ class Question {
|
||||
correctAnswerIndices.toString() == other.correctAnswerIndices.toString() &&
|
||||
consecutiveCorrect == other.consecutiveCorrect &&
|
||||
isKnown == other.isKnown &&
|
||||
isFlagged == other.isFlagged &&
|
||||
priorityPoints == other.priorityPoints &&
|
||||
lastAttemptIndex == other.lastAttemptIndex &&
|
||||
totalCorrectAttempts == other.totalCorrectAttempts &&
|
||||
@@ -130,6 +137,7 @@ class Question {
|
||||
correctAnswerIndices.hashCode ^
|
||||
consecutiveCorrect.hashCode ^
|
||||
isKnown.hashCode ^
|
||||
isFlagged.hashCode ^
|
||||
priorityPoints.hashCode ^
|
||||
lastAttemptIndex.hashCode ^
|
||||
totalCorrectAttempts.hashCode ^
|
||||
|
||||
Reference in New Issue
Block a user