Changed around line 1
+ const factors = [
+ "Empathy", "Self-awareness", "Motivation", "Social skills", "Adaptability",
+ "Optimism", "Resilience", "Patience", "Compassion", "Active listening",
+ "Conflict resolution", "Emotional regulation", "Self-discipline", "Curiosity",
+ "Open-mindedness", "Gratitude", "Humility", "Integrity", "Courage", "Creativity",
+ "Problem-solving", "Decision-making", "Teamwork", "Leadership", "Communication",
+ "Assertiveness", "Flexibility", "Stress management", "Time management", "Self-care",
+ "Mindfulness", "Perseverance", "Confidence", "Positivity", "Generosity", "Kindness",
+ "Honesty", "Loyalty", "Respect", "Fairness", "Forgiveness", "Trustworthiness",
+ "Dependability", "Responsibility", "Accountability", "Initiative", "Vision", "Focus"
+ ];
+
+ const factorGrid = document.getElementById('factor-grid');
+ const eqScore = document.getElementById('eq-score');
+ const scoreDescription = document.getElementById('score-description');
+ const calculateBtn = document.getElementById('calculate-btn');
+
+ let selectedFactors = [];
+
+ factors.forEach(factor => {
+ const div = document.createElement('div');
+ div.textContent = factor;
+ div.addEventListener('click', () => {
+ div.classList.toggle('selected');
+ if (selectedFactors.includes(factor)) {
+ selectedFactors = selectedFactors.filter(f => f !== factor);
+ } else {
+ selectedFactors.push(factor);
+ }
+ calculateBtn.disabled = selectedFactors.length === 0;
+ });
+ factorGrid.appendChild(div);
+ });
+
+ calculateBtn.addEventListener('click', () => {
+ const score = selectedFactors.length * 2; // Simple scoring mechanism
+ eqScore.textContent = score;
+ if (score >= 80) {
+ scoreDescription.textContent = "You have a high EQ! Great job!";
+ } else if (score >= 50) {
+ scoreDescription.textContent = "Your EQ is above average. Keep improving!";
+ } else {
+ scoreDescription.textContent = "Your EQ is developing. Focus on these factors!";
+ }
+ });