Attendance Master Pro
Your Comprehensive Attendance Tracking Solution
Attendance %
Classes Attended
Classes Missed
Goal Analysis
Attendance Insights
🏆 Priority Level: ${coursePriority.charAt(0).toUpperCase() + coursePriority.slice(1)}
${priorityStatus}
`; additionalInsights.innerHTML = insightsHTML;// Show result section resultSection.classList.remove('hidden');// Destroy previous chart if it exists if (chart) { chart.destroy(); }// Create new chart chart = new Chart(attendanceChart, { type: 'pie', data: { labels: ['Attended', 'Missed'], datasets: [{ data: [presentClasses, absentClasses], backgroundColor: ['#10B981', '#EF4444'] }] }, options: { responsive: true, plugins: { legend: { position: 'bottom', } } } }); });// Priority recommendation function function getPriorityRecommendation(attendancePercentage, priority) { const percentage = parseFloat(attendancePercentage); if (priority === 'high') { if (percentage < 80) return '⚠️ Critical: Low attendance for high-priority course!'; if (percentage < 90) return '🔶 Caution: Improve attendance for this high-priority course.'; return '✅ Excellent attendance for a high-priority course!'; } if (priority === 'medium') { if (percentage < 75) return '📊 Attendance needs improvement.'; if (percentage < 85) return '🟨 Good, but room for improvement.'; return '✨ Solid attendance performance.'; } if (priority === 'low') { if (percentage < 70) return '🟥 Consider increasing attendance.'; return '🟢 Satisfactory attendance for a low-priority course.'; } }// Reset functionality document.querySelector('button[type="reset"]').addEventListener('click', function() { resultSection.classList.add('hidden'); goalAnalysis.classList.add('hidden'); if (chart) { chart.destroy(); } }); });