Relationship Style Quiz

Discover your relationship style and get personalized advice to improve your connections

Ready to gain insights about your relationship style?

This quiz has 10 simple questions about how you behave in relationships. Answer honestly for the most accurate results.

${questionData.question}
`; // Add options questionData.options.forEach((option, index) => { questionHtml += `
${option.text}
`; }); // Add navigation buttons questionHtml += `
${currentQuestion > 0 ? `` : `
` }
`; // Set question HTML document.getElementById('questions-screen').innerHTML = questionHtml; // If user already answered this question, highlight the selected option if (userAnswers[currentQuestion] !== undefined) { highlightSelectedOption(userAnswers[currentQuestion]); document.getElementById('next-button').disabled = false; document.getElementById('next-button').style.opacity = '1'; } } // Select an option function selectOption(optionIndex) { // Save user's answer userAnswers[currentQuestion] = optionIndex; // Highlight selected option highlightSelectedOption(optionIndex); // Enable next button document.getElementById('next-button').disabled = false; document.getElementById('next-button').style.opacity = '1'; } // Highlight the selected option function highlightSelectedOption(optionIndex) { // Get all options const options = document.querySelectorAll('.quiz-option'); // Remove highlight from all options options.forEach(option => { option.style.backgroundColor = '#f0f4fd'; option.style.borderColor = '#e1e5f0'; option.style.fontWeight = 'normal'; }); // Highlight selected option options[optionIndex].style.backgroundColor = '#d9e2fc'; options[optionIndex].style.borderColor = '#4a4a9b'; options[optionIndex].style.fontWeight = 'bold'; } // Move to previous question function previousQuestion() { if (currentQuestion > 0) { currentQuestion--; showQuestion(); } } // Move to next question or show results function nextQuestion() { if (currentQuestion < quizQuestions.length - 1) { currentQuestion++; showQuestion(); } else { showResults(); } } // Show quiz results function showResults() { // Hide questions screen document.getElementById('questions-screen').style.display = 'none'; // Complete progress bar document.getElementById('quiz-progress').style.width = '100%'; // Calculate results const results = calculateResults(); // Set result type document.getElementById('results-type').textContent = relationshipStyles[results.primaryStyle].title; // Set result description let descriptionHtml = relationshipStyles[results.primaryStyle].description; // Add love language if available if (results.loveLanguage) { descriptionHtml += `

Your preferred way to receive love and affection appears to be through ${getLoveLanguageText(results.loveLanguage)}, which is important information to share with your partner.

`; } document.getElementById('results-description').innerHTML = descriptionHtml; // Set advice list let adviceHtml = ''; relationshipStyles[results.primaryStyle].advice.forEach(advice => { adviceHtml += `
  • ${advice}
  • `; }); document.getElementById('advice-list').innerHTML = adviceHtml; // Show results screen document.getElementById('results-screen').style.display = 'block'; } // Get text description of love language function getLoveLanguageText(loveLanguage) { switch(loveLanguage) { case 'words': return 'Words of Affirmation (verbal compliments and appreciation)'; case 'time': return 'Quality Time (focused, undivided attention)'; case 'touch': return 'Physical Touch (physical closeness and affection)'; case 'acts': return 'Acts of Service (actions that help or support you)'; default: return 'various forms of expression'; } } // Calculate results based on user answers function calculateResults() { // Initialize counters for different relationship styles let counts = { secure: 0, anxious: 0, avoidant: 0, independent: 0 }; // Question 1: How you respond to partner's problems if (userAnswers[0] === 0) counts.independent++; // Solutions = practical if (userAnswers[0] === 1) counts.secure++; // Ask questions = analytical if (userAnswers[0] === 2) counts.secure++; // Emotional support = empathetic if (userAnswers[0] === 3) counts.anxious++; // Share stories = relational // Question 2: During disagreements if (userAnswers[1] === 0) counts.independent++; // Stand ground = assertive if (userAnswers[1] === 1) counts.secure++; // Compromise = diplomatic if (userAnswers[1] === 2) counts.secure++; // Understand first = empathetic if (userAnswers[1] === 3) counts.avoidant++; // Avoid conflict = avoidant // Question 3: Personal space if (userAnswers[2] === 0) counts.avoidant += 2; // Very important = independent if (userAnswers[2] === 1) counts.secure++; // Important = balanced if (userAnswers[2] === 2) counts.secure++; // Somewhat = connected if (userAnswers[2] === 3) counts.anxious += 2; // Not important = interdependent // Question 4: Partner not responding if (userAnswers[3] === 0) counts.independent++; // Don't think = secure if (userAnswers[3] === 1) counts.secure++; // Notice but wait = patient if (userAnswers[3] === 2) counts.anxious++; // Feel anxious = attentive if (userAnswers[3] === 3) counts.anxious += 2; // Worry = anxious // Question 5: Expressing feelings if (userAnswers[4] === 0) counts.secure++; // Very open = expressive if (userAnswers[4] === 1) counts.secure++; // When significant = selective if (userAnswers[4] === 2) counts.anxious++; // Difficult but try = reserved if (userAnswers[4] === 3) counts.avoidant += 2; // Keep to self = private // Question 6: Decision making if (userAnswers[5] === 0) counts.independent++; // Take charge = leading if (userAnswers[5] === 1) counts.secure++; // Discuss = collaborative if (userAnswers[5] === 2) counts.anxious++; // Partner's preferences = accommodating if (userAnswers[5] === 3) counts.avoidant++; // Partner leads = following // Question 7: Trust if (userAnswers[6] === 0) counts.secure++; // Trust easily = trusting if (userAnswers[6] === 1) counts.secure++; // Extend but verify = cautious if (userAnswers[6] === 2) counts.avoidant++; // Builds slowly = guarded if (userAnswers[6] === 3) counts.avoidant += 2; // Difficult = skeptical // Question 8: Boundaries if (userAnswers[7] === 0) counts.independent++; // Clear boundaries = firm if (userAnswers[7] === 1) counts.secure++; // Negotiate = flexible if (userAnswers[7] === 2) counts.anxious++; // Adjust = adaptable if (userAnswers[7] === 3) counts.avoidant++; // Rarely establish = open // Question 9: Love language let loveLanguage = ''; switch(userAnswers[8]) { case 0: loveLanguage = 'words'; break; case 1: loveLanguage = 'time'; break; case 2: loveLanguage = 'touch'; break; case 3: loveLanguage = 'acts'; break; } // Question 10: Future concerns if (userAnswers[9] === 0) counts.independent++; // Independence = autonomy if (userAnswers[9] === 1) counts.secure++; // Emotional intimacy = intimacy if (userAnswers[9] === 2) counts.anxious++; // Security = security if (userAnswers[9] === 3) counts.independent++; // Excitement = passion // Find primary style (highest score) let primaryStyle = Object.keys(counts).reduce((a, b) => counts[a] > counts[b] ? a : b); return { primaryStyle: primaryStyle, loveLanguage: loveLanguage }; } // Restart the quiz function restartQuiz() { // Reset quiz state document.getElementById('results-screen').style.display = 'none'; document.getElementById('start-screen').style.display = 'block'; document.getElementById('quiz-progress').style.width = '0%'; currentQuestion = 0; userAnswers = []; }