flagging and exclude

This commit is contained in:
gitea
2026-02-01 19:49:49 +01:00
parent 10a4837ee0
commit fe9c5a9fec
7 changed files with 72 additions and 23 deletions
@@ -27,11 +27,14 @@ class AttemptService {
final size = attemptSize ?? deck.config.defaultAttemptSize;
// Filter candidates based on includeKnownInAttempts setting
// Use override parameter if provided, otherwise use config
final shouldIncludeKnown = includeKnown ?? deck.config.includeKnownInAttempts;
final candidates = shouldIncludeKnown
? deck.questions
var candidates = shouldIncludeKnown
? List<Question>.from(deck.questions)
: deck.questions.where((q) => !q.isKnown).toList();
// Exclude flagged questions when config says so
if (deck.config.excludeFlaggedQuestions) {
candidates = candidates.where((q) => !q.isFlagged).toList();
}
final selected = _selector.selectQuestions(
candidates: candidates,