Simple Recommendation Quiz


What area would you like to focus on?



Select an approach:
Your Recommendation

let selectedCategory = '';

function showStep(step) { document.querySelectorAll('.quiz-step').forEach((el, idx) => { el.classList.toggle('active', 'step' + (idx + 1) === step); }); }

document.querySelectorAll('#step1 .quiz-options button').forEach(btn => { btn.onclick = function() { selectedCategory = this.getAttribute('data-category'); showSubOptions(selectedCategory); showStep('step2'); } });

function showSubOptions(category) { const subOpts = categories[category] || []; const subOptionsDiv = document.getElementById('subOptions'); subOptionsDiv.innerHTML = ''; subOpts.forEach(opt => { const button = document.createElement('button'); button.textContent = opt.name; button.onclick = function() { showResult(category, opt.name); }; subOptionsDiv.appendChild(button); }); document.getElementById('subOptionTitle').textContent = `Which approach in "${category}" appeals to you most?`; }

function showResult(category, subOptionName) { const option = (categories[category] || []).find(opt => opt.name === subOptionName); let result = `${subOptionName}`; if (option && option.desc) { result += `
${option.desc}`; } document.getElementById('resultText').innerHTML = result; showStep('step3'); }

function restartQuiz() { selectedCategory = ''; showStep('step1'); }