mock data and persistence
This commit is contained in:
+326
-1
@@ -142,5 +142,330 @@ class DefaultDeck {
|
||||
config: config,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Default deck with mock attempt history and progress data
|
||||
static Deck get deckWithMockData {
|
||||
const config = DeckConfig(
|
||||
requiredConsecutiveCorrect: 3,
|
||||
defaultAttemptSize: 10,
|
||||
priorityIncreaseOnIncorrect: 5,
|
||||
priorityDecreaseOnCorrect: 2,
|
||||
immediateFeedbackEnabled: true,
|
||||
);
|
||||
|
||||
final now = DateTime.now();
|
||||
|
||||
// Create mock attempt history (4 previous attempts)
|
||||
final attemptHistory = [
|
||||
// First attempt - 6/10 correct (60%)
|
||||
AttemptHistoryEntry(
|
||||
timestamp: now.subtract(const Duration(days: 7)).millisecondsSinceEpoch,
|
||||
totalQuestions: 10,
|
||||
correctAnswers: 6,
|
||||
incorrectAnswers: 4,
|
||||
skippedAnswers: 0,
|
||||
timeSpentSeconds: 245,
|
||||
),
|
||||
// Second attempt - 7/10 correct (70%)
|
||||
AttemptHistoryEntry(
|
||||
timestamp: now.subtract(const Duration(days: 5)).millisecondsSinceEpoch,
|
||||
totalQuestions: 10,
|
||||
correctAnswers: 7,
|
||||
incorrectAnswers: 3,
|
||||
skippedAnswers: 0,
|
||||
timeSpentSeconds: 198,
|
||||
),
|
||||
// Third attempt - 8/10 correct (80%)
|
||||
AttemptHistoryEntry(
|
||||
timestamp: now.subtract(const Duration(days: 3)).millisecondsSinceEpoch,
|
||||
totalQuestions: 10,
|
||||
correctAnswers: 8,
|
||||
incorrectAnswers: 2,
|
||||
skippedAnswers: 0,
|
||||
timeSpentSeconds: 187,
|
||||
),
|
||||
// Fourth attempt - 9/10 correct (90%)
|
||||
AttemptHistoryEntry(
|
||||
timestamp: now.subtract(const Duration(days: 1)).millisecondsSinceEpoch,
|
||||
totalQuestions: 10,
|
||||
correctAnswers: 9,
|
||||
incorrectAnswers: 1,
|
||||
skippedAnswers: 0,
|
||||
timeSpentSeconds: 165,
|
||||
),
|
||||
];
|
||||
|
||||
final questions = [
|
||||
// Question 1 - Known (answered correctly 3+ times)
|
||||
Question(
|
||||
id: 'gk_1',
|
||||
prompt: 'What is the capital city of Australia?',
|
||||
answers: ['Sydney', 'Melbourne', 'Canberra', 'Perth'],
|
||||
correctAnswerIndices: [2],
|
||||
consecutiveCorrect: 3,
|
||||
isKnown: true,
|
||||
priorityPoints: 0,
|
||||
lastAttemptIndex: 3,
|
||||
totalCorrectAttempts: 4,
|
||||
totalAttempts: 4,
|
||||
),
|
||||
// Question 2 - Known
|
||||
Question(
|
||||
id: 'gk_2',
|
||||
prompt: 'Which planet is known as the Red Planet?',
|
||||
answers: ['Venus', 'Mars', 'Jupiter', 'Saturn'],
|
||||
correctAnswerIndices: [1],
|
||||
consecutiveCorrect: 3,
|
||||
isKnown: true,
|
||||
priorityPoints: 0,
|
||||
lastAttemptIndex: 3,
|
||||
totalCorrectAttempts: 4,
|
||||
totalAttempts: 4,
|
||||
),
|
||||
// Question 3 - Known
|
||||
Question(
|
||||
id: 'gk_3',
|
||||
prompt: 'What is the largest ocean on Earth?',
|
||||
answers: ['Atlantic Ocean', 'Indian Ocean', 'Arctic Ocean', 'Pacific Ocean'],
|
||||
correctAnswerIndices: [3],
|
||||
consecutiveCorrect: 3,
|
||||
isKnown: true,
|
||||
priorityPoints: 0,
|
||||
lastAttemptIndex: 3,
|
||||
totalCorrectAttempts: 4,
|
||||
totalAttempts: 4,
|
||||
),
|
||||
// Question 4 - Known
|
||||
Question(
|
||||
id: 'gk_4',
|
||||
prompt: 'Who wrote the novel "1984"?',
|
||||
answers: ['George Orwell', 'Aldous Huxley', 'Ray Bradbury', 'J.D. Salinger'],
|
||||
correctAnswerIndices: [0],
|
||||
consecutiveCorrect: 3,
|
||||
isKnown: true,
|
||||
priorityPoints: 0,
|
||||
lastAttemptIndex: 3,
|
||||
totalCorrectAttempts: 4,
|
||||
totalAttempts: 4,
|
||||
),
|
||||
// Question 5 - Known
|
||||
Question(
|
||||
id: 'gk_5',
|
||||
prompt: 'What is the chemical symbol for gold?',
|
||||
answers: ['Go', 'Gd', 'Au', 'Ag'],
|
||||
correctAnswerIndices: [2],
|
||||
consecutiveCorrect: 3,
|
||||
isKnown: true,
|
||||
priorityPoints: 0,
|
||||
lastAttemptIndex: 3,
|
||||
totalCorrectAttempts: 4,
|
||||
totalAttempts: 4,
|
||||
),
|
||||
// Question 6 - Progress (2 consecutive correct, not yet known)
|
||||
Question(
|
||||
id: 'gk_6',
|
||||
prompt: 'In which year did World War II end?',
|
||||
answers: ['1943', '1944', '1945', '1946'],
|
||||
correctAnswerIndices: [2],
|
||||
consecutiveCorrect: 2,
|
||||
isKnown: false,
|
||||
priorityPoints: 0,
|
||||
lastAttemptIndex: 3,
|
||||
totalCorrectAttempts: 3,
|
||||
totalAttempts: 4,
|
||||
),
|
||||
// Question 7 - Progress (1 consecutive correct)
|
||||
Question(
|
||||
id: 'gk_7',
|
||||
prompt: 'What is the smallest prime number?',
|
||||
answers: ['0', '1', '2', '3'],
|
||||
correctAnswerIndices: [2],
|
||||
consecutiveCorrect: 1,
|
||||
isKnown: false,
|
||||
priorityPoints: 0,
|
||||
lastAttemptIndex: 3,
|
||||
totalCorrectAttempts: 2,
|
||||
totalAttempts: 4,
|
||||
),
|
||||
// Question 8 - Some mistakes (has priority points from incorrect answers)
|
||||
Question(
|
||||
id: 'gk_8',
|
||||
prompt: 'Which gas makes up approximately 78% of Earth\'s atmosphere?',
|
||||
answers: ['Oxygen', 'Carbon Dioxide', 'Nitrogen', 'Argon'],
|
||||
correctAnswerIndices: [2],
|
||||
consecutiveCorrect: 0,
|
||||
isKnown: false,
|
||||
priorityPoints: 5,
|
||||
lastAttemptIndex: 2,
|
||||
totalCorrectAttempts: 2,
|
||||
totalAttempts: 4,
|
||||
),
|
||||
// Question 9 - Known
|
||||
Question(
|
||||
id: 'gk_9',
|
||||
prompt: 'What is the longest river in the world?',
|
||||
answers: ['Amazon River', 'Nile River', 'Yangtze River', 'Mississippi River'],
|
||||
correctAnswerIndices: [1],
|
||||
consecutiveCorrect: 3,
|
||||
isKnown: true,
|
||||
priorityPoints: 0,
|
||||
lastAttemptIndex: 3,
|
||||
totalCorrectAttempts: 4,
|
||||
totalAttempts: 4,
|
||||
),
|
||||
// Question 10 - Known
|
||||
Question(
|
||||
id: 'gk_10',
|
||||
prompt: 'Who painted the Mona Lisa?',
|
||||
answers: ['Vincent van Gogh', 'Pablo Picasso', 'Leonardo da Vinci', 'Michelangelo'],
|
||||
correctAnswerIndices: [2],
|
||||
consecutiveCorrect: 3,
|
||||
isKnown: true,
|
||||
priorityPoints: 0,
|
||||
lastAttemptIndex: 3,
|
||||
totalCorrectAttempts: 4,
|
||||
totalAttempts: 4,
|
||||
),
|
||||
// Question 11 - Progress
|
||||
Question(
|
||||
id: 'gk_11',
|
||||
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'],
|
||||
correctAnswerIndices: [0],
|
||||
consecutiveCorrect: 2,
|
||||
isKnown: false,
|
||||
priorityPoints: 0,
|
||||
lastAttemptIndex: 3,
|
||||
totalCorrectAttempts: 3,
|
||||
totalAttempts: 4,
|
||||
),
|
||||
// Question 12 - Known
|
||||
Question(
|
||||
id: 'gk_12',
|
||||
prompt: 'Which country is home to the kangaroo?',
|
||||
answers: ['New Zealand', 'Australia', 'South Africa', 'Brazil'],
|
||||
correctAnswerIndices: [1],
|
||||
consecutiveCorrect: 3,
|
||||
isKnown: true,
|
||||
priorityPoints: 0,
|
||||
lastAttemptIndex: 3,
|
||||
totalCorrectAttempts: 4,
|
||||
totalAttempts: 4,
|
||||
),
|
||||
// Question 13 - Some mistakes
|
||||
Question(
|
||||
id: 'gk_13',
|
||||
prompt: 'What is the hardest natural substance on Earth?',
|
||||
answers: ['Gold', 'Diamond', 'Platinum', 'Titanium'],
|
||||
correctAnswerIndices: [1],
|
||||
consecutiveCorrect: 0,
|
||||
isKnown: false,
|
||||
priorityPoints: 3,
|
||||
lastAttemptIndex: 1,
|
||||
totalCorrectAttempts: 1,
|
||||
totalAttempts: 4,
|
||||
),
|
||||
// Question 14 - Progress
|
||||
Question(
|
||||
id: 'gk_14',
|
||||
prompt: 'How many continents are there on Earth?',
|
||||
answers: ['5', '6', '7', '8'],
|
||||
correctAnswerIndices: [2],
|
||||
consecutiveCorrect: 1,
|
||||
isKnown: false,
|
||||
priorityPoints: 0,
|
||||
lastAttemptIndex: 3,
|
||||
totalCorrectAttempts: 2,
|
||||
totalAttempts: 4,
|
||||
),
|
||||
// Question 15 - Known
|
||||
Question(
|
||||
id: 'gk_15',
|
||||
prompt: 'What is the largest mammal in the world?',
|
||||
answers: ['African Elephant', 'Blue Whale', 'Giraffe', 'Polar Bear'],
|
||||
correctAnswerIndices: [1],
|
||||
consecutiveCorrect: 3,
|
||||
isKnown: true,
|
||||
priorityPoints: 0,
|
||||
lastAttemptIndex: 3,
|
||||
totalCorrectAttempts: 4,
|
||||
totalAttempts: 4,
|
||||
),
|
||||
// Question 16 - Known
|
||||
Question(
|
||||
id: 'gk_16',
|
||||
prompt: 'In which city is the Eiffel Tower located?',
|
||||
answers: ['London', 'Berlin', 'Paris', 'Rome'],
|
||||
correctAnswerIndices: [2],
|
||||
consecutiveCorrect: 3,
|
||||
isKnown: true,
|
||||
priorityPoints: 0,
|
||||
lastAttemptIndex: 3,
|
||||
totalCorrectAttempts: 4,
|
||||
totalAttempts: 4,
|
||||
),
|
||||
// Question 17 - Known
|
||||
Question(
|
||||
id: 'gk_17',
|
||||
prompt: 'What is the square root of 64?',
|
||||
answers: ['6', '7', '8', '9'],
|
||||
correctAnswerIndices: [2],
|
||||
consecutiveCorrect: 3,
|
||||
isKnown: true,
|
||||
priorityPoints: 0,
|
||||
lastAttemptIndex: 3,
|
||||
totalCorrectAttempts: 4,
|
||||
totalAttempts: 4,
|
||||
),
|
||||
// Question 18 - Progress
|
||||
Question(
|
||||
id: 'gk_18',
|
||||
prompt: 'Which element has the atomic number 1?',
|
||||
answers: ['Helium', 'Hydrogen', 'Lithium', 'Carbon'],
|
||||
correctAnswerIndices: [1],
|
||||
consecutiveCorrect: 2,
|
||||
isKnown: false,
|
||||
priorityPoints: 0,
|
||||
lastAttemptIndex: 3,
|
||||
totalCorrectAttempts: 3,
|
||||
totalAttempts: 4,
|
||||
),
|
||||
// Question 19 - Some mistakes
|
||||
Question(
|
||||
id: 'gk_19',
|
||||
prompt: 'What is the largest desert in the world?',
|
||||
answers: ['Gobi Desert', 'Sahara Desert', 'Antarctic Desert', 'Arabian Desert'],
|
||||
correctAnswerIndices: [2],
|
||||
consecutiveCorrect: 0,
|
||||
isKnown: false,
|
||||
priorityPoints: 5,
|
||||
lastAttemptIndex: 0,
|
||||
totalCorrectAttempts: 1,
|
||||
totalAttempts: 4,
|
||||
),
|
||||
// Question 20 - Progress
|
||||
Question(
|
||||
id: 'gk_20',
|
||||
prompt: 'Who invented the telephone?',
|
||||
answers: ['Thomas Edison', 'Alexander Graham Bell', 'Nikola Tesla', 'Guglielmo Marconi'],
|
||||
correctAnswerIndices: [1],
|
||||
consecutiveCorrect: 1,
|
||||
isKnown: false,
|
||||
priorityPoints: 0,
|
||||
lastAttemptIndex: 3,
|
||||
totalCorrectAttempts: 2,
|
||||
totalAttempts: 4,
|
||||
),
|
||||
];
|
||||
|
||||
return Deck(
|
||||
id: 'default-general-knowledge',
|
||||
title: 'General Knowledge Quiz',
|
||||
description: 'A collection of 20 general knowledge questions covering science, geography, history, and more. Perfect for testing your knowledge!',
|
||||
questions: questions,
|
||||
config: config,
|
||||
currentAttemptIndex: 4, // 4 attempts have been made
|
||||
attemptHistory: attemptHistory,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user