|
|
|
|
@ -59,10 +59,14 @@ class _DeckOverviewScreenState extends State<DeckOverviewScreen> {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (deckToCheck == null || deckToCheck.questions.isEmpty) {
|
|
|
|
|
if (deckToCheck == null || deckToCheck.activeQuestionCount == 0) {
|
|
|
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
|
|
|
const SnackBar(
|
|
|
|
|
content: Text('Cannot start attempt: No questions in deck'),
|
|
|
|
|
SnackBar(
|
|
|
|
|
content: Text(
|
|
|
|
|
deckToCheck != null && deckToCheck.questions.isNotEmpty && deckToCheck.config.excludeFlaggedQuestions
|
|
|
|
|
? 'Cannot start attempt: All questions are flagged. Unflag some or turn off "Exclude flagged questions" in settings.'
|
|
|
|
|
: 'Cannot start attempt: No questions in deck',
|
|
|
|
|
),
|
|
|
|
|
backgroundColor: Colors.red,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
@ -158,8 +162,8 @@ class _DeckOverviewScreenState extends State<DeckOverviewScreen> {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Check if all questions are known and includeKnownInAttempts is disabled
|
|
|
|
|
final allKnown = deckToCheck.knownCount == deckToCheck.numberOfQuestions && deckToCheck.numberOfQuestions > 0;
|
|
|
|
|
// Check if all active questions are known and includeKnownInAttempts is disabled
|
|
|
|
|
final allKnown = deckToCheck.knownCount == deckToCheck.activeQuestionCount && deckToCheck.activeQuestionCount > 0;
|
|
|
|
|
final includeKnownDisabled = !deckToCheck.config.includeKnownInAttempts;
|
|
|
|
|
|
|
|
|
|
if (allKnown && includeKnownDisabled) {
|
|
|
|
|
@ -285,7 +289,7 @@ class _DeckOverviewScreenState extends State<DeckOverviewScreen> {
|
|
|
|
|
Widget _buildProgressStats(BuildContext context) {
|
|
|
|
|
if (_deck == null) return const SizedBox.shrink();
|
|
|
|
|
|
|
|
|
|
final totalQuestions = _deck!.numberOfQuestions;
|
|
|
|
|
final totalQuestions = _deck!.activeQuestionCount;
|
|
|
|
|
final knownCount = _deck!.knownCount;
|
|
|
|
|
final unknownCount = totalQuestions - knownCount;
|
|
|
|
|
final unknownPercentage = totalQuestions > 0
|
|
|
|
|
@ -484,7 +488,7 @@ class _DeckOverviewScreenState extends State<DeckOverviewScreen> {
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
|
Text(
|
|
|
|
|
'${_deck!.knownCount} of ${_deck!.numberOfQuestions} questions known',
|
|
|
|
|
'${_deck!.knownCount} of ${_deck!.activeQuestionCount} questions known',
|
|
|
|
|
style: Theme.of(context).textTheme.bodySmall,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -505,7 +509,7 @@ class _DeckOverviewScreenState extends State<DeckOverviewScreen> {
|
|
|
|
|
children: [
|
|
|
|
|
_StatItem(
|
|
|
|
|
label: 'Total',
|
|
|
|
|
value: '${_deck!.numberOfQuestions}',
|
|
|
|
|
value: '${_deck!.activeQuestionCount}',
|
|
|
|
|
icon: Icons.quiz,
|
|
|
|
|
),
|
|
|
|
|
_StatItem(
|
|
|
|
|
@ -515,7 +519,7 @@ class _DeckOverviewScreenState extends State<DeckOverviewScreen> {
|
|
|
|
|
),
|
|
|
|
|
_StatItem(
|
|
|
|
|
label: 'Practice',
|
|
|
|
|
value: '${_deck!.numberOfQuestions - _deck!.knownCount}',
|
|
|
|
|
value: '${_deck!.activeQuestionCount - _deck!.knownCount}',
|
|
|
|
|
icon: Icons.school,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
|