Yazan

içinde

Çarpan ve Kat Soruları – 20 Soru

🔢 Sayılar Teorisi Quiz

15 soru ile bilginizi test edin!

0
Doğru
0
Yanlış
0
Toplam
0/20

Tebrikler!

Harika bir performans sergiledينiz!

💭 Cevabınızı yazın ve kontrol edin!
`; container.appendChild(questionCard); }); } function checkAnswer(questionId) { const question = questions.find(q => q.id === questionId); const userInput = document.getElementById(`answer${questionId}`).value.trim(); const resultDiv = document.getElementById(`result${questionId}`); const hintDiv = document.getElementById(`hint${questionId}`); if (!userInput) { resultDiv.innerHTML = '⚠️ Lütfen bir cevap yazın!'; resultDiv.className = 'result neutral'; return; } // Parse user answer const userAnswer = userInput.split(',').map(n => parseInt(n.trim())).filter(n => !isNaN(n)).sort((a, b) => a - b); const correctAnswer = [...question.answer].sort((a, b) => a - b); // Check if answers match const isCorrect = JSON.stringify(userAnswer) === JSON.stringify(correctAnswer); if (isCorrect) { resultDiv.innerHTML = '✅ Tebrikler! Doğru cevap!'; resultDiv.className = 'result correct'; hintDiv.style.display = 'none'; // Ses ve animasyon efektleri playCorrectSound(); createBravoText(resultDiv); createConfetti(resultDiv); // Update stats if this is a new correct answer if (!resultDiv.dataset.answered) { correctCount++; totalAnswered++; resultDiv.dataset.answered = 'correct'; } } else { resultDiv.innerHTML = `❌ Yanlış cevap! Tekrar deneyin.`; resultDiv.className = 'result incorrect'; hintDiv.style.display = 'block'; // Hata sesi playIncorrectSound(); // Update stats if this is a new incorrect answer if (!resultDiv.dataset.answered) { incorrectCount++; totalAnswered++; resultDiv.dataset.answered = 'incorrect'; } } updateStats(); } function showAnswer(questionId) { const question = questions.find(q => q.id === questionId); const resultDiv = document.getElementById(`result${questionId}`); const inputField = document.getElementById(`answer${questionId}`); const hintDiv = document.getElementById(`hint${questionId}`); inputField.value = question.answer.join(', '); resultDiv.innerHTML = `💡 Doğru cevap: ${question.answer.join(', ')}`; resultDiv.className = 'result neutral'; // Show detailed solution instead of hint hintDiv.innerHTML = `🔍 Detaylı Çözüm:
${question.solution}`; hintDiv.style.display = 'block'; // Don't count as answered if showing answer resultDiv.dataset.answered = 'shown'; } function checkAllAnswers() { questions.forEach(q => { const userInput = document.getElementById(`answer${q.id}`).value.trim(); if (userInput) { checkAnswer(q.id); } }); // Show final score if all questions are answered if (totalAnswered === 15) { showFinalScore(); } } function showAllAnswers() { questions.forEach(q => { showAnswer(q.id); }); } function resetAllAnswers() { questions.forEach(q => { document.getElementById(`answer${q.id}`).value = ''; const resultDiv = document.getElementById(`result${q.id}`); resultDiv.innerHTML = '💭 Cevabınızı yazın ve kontrol edin!'; resultDiv.className = 'result neutral'; resultDiv.dataset.answered = ''; document.getElementById(`hint${q.id}`).style.display = 'none'; }); correctCount = 0; incorrectCount = 0; totalAnswered = 0; updateStats(); document.getElementById('finalScore').classList.remove('show'); } function updateStats() { document.getElementById('correctCount').textContent = correctCount; document.getElementById('incorrectCount').textContent = incorrectCount; document.getElementById('totalAnswered').textContent = totalAnswered; const progress = (totalAnswered / 15) * 100; document.getElementById('progressFill').style.width = progress + '%'; } function createBigConfetti() { const colors = ['#ffd700', '#ff6b6b', '#4ecdc4', '#45b7d1', '#96ceb4', '#feca57', '#ff9ff3', '#54a0ff']; for (let i = 0; i < 50; i++) { setTimeout(() => { const confetti = document.createElement('div'); confetti.className = 'confetti-particle'; const color = colors[Math.floor(Math.random() * colors.length)]; confetti.style.background = color; confetti.style.borderRadius = Math.random() > 0.5 ? '50%' : '0%'; confetti.style.left = Math.random() * window.innerWidth + 'px'; confetti.style.top = '0px'; confetti.style.animationDelay = Math.random() * 0.5 + 's'; confetti.style.transform = `rotate(${Math.random() * 360}deg)`; // Daha büyük boyutlar const size = Math.random() * 12 + 8; confetti.style.width = size + 'px'; confetti.style.height = size + 'px'; // Daha uzun animasyon confetti.style.animation = 'bigConfetti 3s ease-out forwards'; document.body.appendChild(confetti); setTimeout(() => { if (confetti.parentNode) { confetti.parentNode.removeChild(confetti); } }, 3000); }, i * 20); } } function showFinalScore() { const finalScoreDiv = document.getElementById('finalScore'); const scoreCircle = document.getElementById('scoreCircle'); const scoreMessage = document.getElementById('scoreMessage'); const scoreDescription = document.getElementById('scoreDescription'); scoreCircle.textContent = `${correctCount}/15`; const percentage = (correctCount / 15) * 100; if (percentage >= 90) { scoreMessage.textContent = 'Mükemmel! 🌟'; scoreDescription.textContent = 'Çarpan ve katlar konusunda uzman oldunuz!'; scoreCircle.style.background = 'linear-gradient(135deg, #48bb78 0%, #38a169 100%)'; playSuccessSound(); createBigConfetti(); } else if (percentage >= 70) { scoreMessage.textContent = 'Harika! 🎉'; scoreDescription.textContent = 'Çok iyi bir performans sergiledينiz!'; scoreCircle.style.background = 'linear-gradient(135deg, #4299e1 0%, #3182ce 100%)'; playCorrectSound(); createConfetti(scoreCircle); } else if (percentage >= 50) { scoreMessage.textContent = 'İyi! 👍'; scoreDescription.textContent = 'Daha fazla pratik yaparak gelişebilirsiniz!'; scoreCircle.style.background = 'linear-gradient(135deg, #f6ad55 0%, #ed8936 100%)'; playClickSound(); } else { scoreMessage.textContent = 'Tekrar Deneyin! 💪'; scoreDescription.textContent = 'Çarpan ve katlar konusunu tekrar çalışmanızı öneririz.'; scoreCircle.style.background = 'linear-gradient(135deg, #f56565 0%, #e53e3e 100%)'; playIncorrectSound(); } finalScoreDiv.classList.add('show'); } // Initialize the page window.onload = function() { generateQuestions(); }; // Add Enter key support for inputs document.addEventListener('keydown', function(e) { if (e.key === 'Enter' && e.target.tagName === 'INPUT') { const questionId = parseInt(e.target.id.replace('answer', '')); checkAnswer(questionId); } });

Yorumlar

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir