🏠 Home

📚 Flashcard Maker

Create, study, and master concepts with interactive digital flashcards

Create Flashcards

Study Mode

Study Statistics

Export & Import

Spaced Repetition System

`; const printWindow = window.open('', '_blank'); printWindow.document.write(exportData); printWindow.document.close(); printWindow.print(); document.getElementById('exportResult').innerHTML = `

Print View Opened

A new window has opened with your flashcards ready for printing.

`; return; } // Create download const blob = new Blob([exportData], { type: 'text/plain' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = filename; a.click(); URL.revokeObjectURL(url); document.getElementById('exportResult').innerHTML = `

Export Complete

Your flashcards have been exported as ${filename}. The download should start automatically.

`; } function bulkImport() { const input = document.createElement('input'); input.type = 'file'; input.accept = '.txt,.csv,.json'; input.onchange = function(event) { const file = event.target.files[0]; if (file) { const reader = new FileReader(); reader.onload = function(e) { try { // Simple CSV/text parsing const content = e.target.result; const lines = content.split('\n').filter(line => line.trim()); let imported = 0; for (let i = 0; i < lines.length; i += 2) { if (i + 1 < lines.length) { const front = lines[i].replace(/^Q:\s*/, '').trim(); const back = lines[i + 1].replace(/^A:\s*/, '').trim(); if (front && back) { flashcards.push({ id: Date.now() + imported, deckName: 'Imported Deck', subject: 'other', front, back, difficulty: 'medium', created: new Date(), timesStudied: 0, timesCorrect: 0, lastReviewed: null, nextReview: new Date(), masteryLevel: 0 }); imported++; } } } saveFlashcards(); updateFlashcardList(); alert(`Successfully imported ${imported} flashcards!`); } catch (error) { alert('Error importing file. Please check the format.'); } }; reader.readAsText(file); } }; input.click(); } function optimizeSpacedRepetition() { if (flashcards.length === 0) { alert('No flashcards to optimize'); return; } const reviewInterval = parseInt(document.getElementById('reviewInterval').value); const masteryThreshold = parseInt(document.getElementById('masteryThreshold').value); const sessionLength = parseInt(document.getElementById('sessionLength').value); // Calculate optimal schedule const cardsNeedingReview = flashcards.filter(card => card.nextReview <= new Date() || card.masteryLevel < masteryThreshold); const dailyReviewCount = Math.ceil(cardsNeedingReview.length / reviewInterval); const sessionTime = Math.ceil(dailyReviewCount * 2); // 2 minutes per card average // Generate schedule const schedule = []; for (let day = 1; day <= 7; day++) { const dayCards = cardsNeedingReview.slice((day - 1) * dailyReviewCount, day * dailyReviewCount); schedule.push({ day: `Day ${day}`, cards: dayCards.length, estimatedTime: Math.min(sessionLength, dayCards.length * 2), difficulty: dayCards.filter(card => card.difficulty === 'hard').length }); } document.getElementById('spacedRepetitionResult').innerHTML = `

Optimized Learning Schedule

${cardsNeedingReview.length}
Cards to Review
${dailyReviewCount}
Cards per Day
${sessionTime}
Minutes per Day
${reviewInterval}
Day Cycle
Weekly Schedule:
${schedule.map(day => `
${day.day} ${day.cards} cards (${day.estimatedTime} min)
${day.difficulty} difficult cards included
`).join('')}
Spaced Repetition Tips:
`; } function clearAllCards() { if (confirm('Are you sure you want to delete all flashcards? This cannot be undone.')) { flashcards = []; saveFlashcards(); updateFlashcardList(); document.getElementById('studyArea').innerHTML = ''; document.getElementById('statsResult').innerHTML = ''; } } // Initialize updateFlashcardList();