complete feedback added

master
gitea 2 months ago
parent 51e88a4aaf
commit 2ea573642d

@ -262,43 +262,43 @@ class DefaultDeck {
totalCorrectAttempts: 4, totalCorrectAttempts: 4,
totalAttempts: 4, totalAttempts: 4,
), ),
// Question 6 - Progress (2 consecutive correct, not yet known) // Question 6 - Known
Question( Question(
id: 'gk_6', id: 'gk_6',
prompt: 'In which year did World War II end?', prompt: 'In which year did World War II end?',
answers: ['1943', '1944', '1945', '1946'], answers: ['1943', '1944', '1945', '1946'],
correctAnswerIndices: [2], correctAnswerIndices: [2],
consecutiveCorrect: 2, consecutiveCorrect: 3,
isKnown: false, isKnown: true,
priorityPoints: 0, priorityPoints: 0,
lastAttemptIndex: 3, lastAttemptIndex: 3,
totalCorrectAttempts: 3, totalCorrectAttempts: 4,
totalAttempts: 4, totalAttempts: 4,
), ),
// Question 7 - Progress (1 consecutive correct) // Question 7 - Known
Question( Question(
id: 'gk_7', id: 'gk_7',
prompt: 'What is the smallest prime number?', prompt: 'What is the smallest prime number?',
answers: ['0', '1', '2', '3'], answers: ['0', '1', '2', '3'],
correctAnswerIndices: [2], correctAnswerIndices: [2],
consecutiveCorrect: 1, consecutiveCorrect: 3,
isKnown: false, isKnown: true,
priorityPoints: 0, priorityPoints: 0,
lastAttemptIndex: 3, lastAttemptIndex: 3,
totalCorrectAttempts: 2, totalCorrectAttempts: 4,
totalAttempts: 4, totalAttempts: 4,
), ),
// Question 8 - Some mistakes (has priority points from incorrect answers) // Question 8 - Known
Question( Question(
id: 'gk_8', id: 'gk_8',
prompt: 'Which gas makes up approximately 78% of Earth\'s atmosphere?', prompt: 'Which gas makes up approximately 78% of Earth\'s atmosphere?',
answers: ['Oxygen', 'Carbon Dioxide', 'Nitrogen', 'Argon'], answers: ['Oxygen', 'Carbon Dioxide', 'Nitrogen', 'Argon'],
correctAnswerIndices: [2], correctAnswerIndices: [2],
consecutiveCorrect: 0, consecutiveCorrect: 3,
isKnown: false, isKnown: true,
priorityPoints: 5, priorityPoints: 0,
lastAttemptIndex: 2, lastAttemptIndex: 3,
totalCorrectAttempts: 2, totalCorrectAttempts: 4,
totalAttempts: 4, totalAttempts: 4,
), ),
// Question 9 - Known // Question 9 - Known
@ -327,17 +327,17 @@ class DefaultDeck {
totalCorrectAttempts: 4, totalCorrectAttempts: 4,
totalAttempts: 4, totalAttempts: 4,
), ),
// Question 11 - Progress // Question 11 - Known
Question( Question(
id: 'gk_11', id: 'gk_11',
prompt: 'What is the speed of light in a vacuum (approximately)?', prompt: 'What is the speed of light in a vacuum (approximately)?',
answers: ['300,000 km/s', '150,000 km/s', '450,000 km/s', '600,000 km/s'], answers: ['300,000 km/s', '150,000 km/s', '450,000 km/s', '600,000 km/s'],
correctAnswerIndices: [0], correctAnswerIndices: [0],
consecutiveCorrect: 2, consecutiveCorrect: 3,
isKnown: false, isKnown: true,
priorityPoints: 0, priorityPoints: 0,
lastAttemptIndex: 3, lastAttemptIndex: 3,
totalCorrectAttempts: 3, totalCorrectAttempts: 4,
totalAttempts: 4, totalAttempts: 4,
), ),
// Question 12 - Known // Question 12 - Known
@ -353,30 +353,30 @@ class DefaultDeck {
totalCorrectAttempts: 4, totalCorrectAttempts: 4,
totalAttempts: 4, totalAttempts: 4,
), ),
// Question 13 - Some mistakes // Question 13 - Known
Question( Question(
id: 'gk_13', id: 'gk_13',
prompt: 'What is the hardest natural substance on Earth?', prompt: 'What is the hardest natural substance on Earth?',
answers: ['Gold', 'Diamond', 'Platinum', 'Titanium'], answers: ['Gold', 'Diamond', 'Platinum', 'Titanium'],
correctAnswerIndices: [1], correctAnswerIndices: [1],
consecutiveCorrect: 0, consecutiveCorrect: 3,
isKnown: false, isKnown: true,
priorityPoints: 3, priorityPoints: 0,
lastAttemptIndex: 1, lastAttemptIndex: 3,
totalCorrectAttempts: 1, totalCorrectAttempts: 4,
totalAttempts: 4, totalAttempts: 4,
), ),
// Question 14 - Progress // Question 14 - Known
Question( Question(
id: 'gk_14', id: 'gk_14',
prompt: 'How many continents are there on Earth?', prompt: 'How many continents are there on Earth?',
answers: ['5', '6', '7', '8'], answers: ['5', '6', '7', '8'],
correctAnswerIndices: [2], correctAnswerIndices: [2],
consecutiveCorrect: 1, consecutiveCorrect: 3,
isKnown: false, isKnown: true,
priorityPoints: 0, priorityPoints: 0,
lastAttemptIndex: 3, lastAttemptIndex: 3,
totalCorrectAttempts: 2, totalCorrectAttempts: 4,
totalAttempts: 4, totalAttempts: 4,
), ),
// Question 15 - Known // Question 15 - Known
@ -418,43 +418,43 @@ class DefaultDeck {
totalCorrectAttempts: 4, totalCorrectAttempts: 4,
totalAttempts: 4, totalAttempts: 4,
), ),
// Question 18 - Progress // Question 18 - Known
Question( Question(
id: 'gk_18', id: 'gk_18',
prompt: 'Which element has the atomic number 1?', prompt: 'Which element has the atomic number 1?',
answers: ['Helium', 'Hydrogen', 'Lithium', 'Carbon'], answers: ['Helium', 'Hydrogen', 'Lithium', 'Carbon'],
correctAnswerIndices: [1], correctAnswerIndices: [1],
consecutiveCorrect: 2, consecutiveCorrect: 3,
isKnown: false, isKnown: true,
priorityPoints: 0, priorityPoints: 0,
lastAttemptIndex: 3, lastAttemptIndex: 3,
totalCorrectAttempts: 3, totalCorrectAttempts: 4,
totalAttempts: 4, totalAttempts: 4,
), ),
// Question 19 - Some mistakes // Question 19 - Known
Question( Question(
id: 'gk_19', id: 'gk_19',
prompt: 'What is the largest desert in the world?', prompt: 'What is the largest desert in the world?',
answers: ['Gobi Desert', 'Sahara Desert', 'Antarctic Desert', 'Arabian Desert'], answers: ['Gobi Desert', 'Sahara Desert', 'Antarctic Desert', 'Arabian Desert'],
correctAnswerIndices: [2], correctAnswerIndices: [2],
consecutiveCorrect: 0, consecutiveCorrect: 3,
isKnown: false, isKnown: true,
priorityPoints: 5, priorityPoints: 0,
lastAttemptIndex: 0, lastAttemptIndex: 3,
totalCorrectAttempts: 1, totalCorrectAttempts: 4,
totalAttempts: 4, totalAttempts: 4,
), ),
// Question 20 - Progress // Question 20 - Not yet known (only one left!)
Question( Question(
id: 'gk_20', id: 'gk_20',
prompt: 'Who invented the telephone?', prompt: 'Who invented the telephone?',
answers: ['Thomas Edison', 'Alexander Graham Bell', 'Nikola Tesla', 'Guglielmo Marconi'], answers: ['Thomas Edison', 'Alexander Graham Bell', 'Nikola Tesla', 'Guglielmo Marconi'],
correctAnswerIndices: [1], correctAnswerIndices: [1],
consecutiveCorrect: 1, consecutiveCorrect: 2,
isKnown: false, isKnown: false,
priorityPoints: 0, priorityPoints: 0,
lastAttemptIndex: 3, lastAttemptIndex: 3,
totalCorrectAttempts: 2, totalCorrectAttempts: 3,
totalAttempts: 4, totalAttempts: 4,
), ),
]; ];

@ -99,6 +99,42 @@ class _AttemptResultScreenState extends State<AttemptResultScreen> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
// 100% Completion Celebration
if (_deck != null && _deck!.knownCount == _deck!.numberOfQuestions && _deck!.numberOfQuestions > 0) ...[
Card(
color: Theme.of(context).colorScheme.primaryContainer,
child: Padding(
padding: const EdgeInsets.all(24),
child: Column(
children: [
Icon(
Icons.celebration,
size: 64,
color: Theme.of(context).colorScheme.onPrimaryContainer,
),
const SizedBox(height: 16),
Text(
'Deck Completed!',
style: Theme.of(context).textTheme.headlineMedium?.copyWith(
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.onPrimaryContainer,
),
),
const SizedBox(height: 8),
Text(
'Congratulations! You\'ve mastered all ${_deck!.numberOfQuestions} questions in this deck!',
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
color: Theme.of(context).colorScheme.onPrimaryContainer.withValues(alpha: 0.9),
),
),
],
),
),
),
const SizedBox(height: 24),
],
// Summary Card // Summary Card
Card( Card(
child: Padding( child: Padding(
@ -126,6 +162,26 @@ class _AttemptResultScreenState extends State<AttemptResultScreen> {
'${_result!.correctCount} of ${_result!.totalQuestions} correct', '${_result!.correctCount} of ${_result!.totalQuestions} correct',
style: Theme.of(context).textTheme.titleMedium, style: Theme.of(context).textTheme.titleMedium,
), ),
// Show deck progress if available
if (_deck != null && _deck!.numberOfQuestions > 0) ...[
const SizedBox(height: 16),
Divider(),
const SizedBox(height: 16),
Text(
'Deck Progress',
style: Theme.of(context).textTheme.titleSmall,
),
const SizedBox(height: 8),
Text(
'${_deck!.knownCount} of ${_deck!.numberOfQuestions} questions known',
style: Theme.of(context).textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.bold,
color: _deck!.knownCount == _deck!.numberOfQuestions
? Colors.green
: null,
),
),
],
const SizedBox(height: 24), const SizedBox(height: 24),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,

@ -353,8 +353,10 @@ class _DeckListScreenState extends State<DeckListScreen> {
itemCount: _decks.length, itemCount: _decks.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
final deck = _decks[index]; final deck = _decks[index];
final isCompleted = deck.knownCount == deck.numberOfQuestions && deck.numberOfQuestions > 0;
return Card( return Card(
margin: const EdgeInsets.only(bottom: 12), margin: const EdgeInsets.only(bottom: 12),
child: InkWell( child: InkWell(
onTap: () => _openDeck(deck), onTap: () => _openDeck(deck),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
@ -369,12 +371,46 @@ class _DeckListScreenState extends State<DeckListScreen> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Row(
children: [
Expanded(
child: Text(
deck.title, deck.title,
style: Theme.of(context).textTheme.titleMedium?.copyWith( style: Theme.of(context).textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
),
if (isCompleted) ...[
const SizedBox(width: 8),
Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: Colors.green.shade700,
borderRadius: BorderRadius.circular(12),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.check_circle,
size: 16,
color: Colors.white,
),
const SizedBox(width: 4),
Text(
'Completed',
style: Theme.of(context).textTheme.labelSmall?.copyWith(
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
],
),
),
],
],
),
if (deck.description.isNotEmpty) ...[ if (deck.description.isNotEmpty) ...[
const SizedBox(height: 4), const SizedBox(height: 4),
Text( Text(
@ -384,6 +420,7 @@ class _DeckListScreenState extends State<DeckListScreen> {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
], ],
], ],
), ),
), ),

Loading…
Cancel
Save

Powered by TurnKey Linux.