Question ${currentQuestion + 1} of ${questions.length} ${progress}% complete
${q.section}
${q.question}
Answer honestly — there are no right or wrong answers.
`; document.getElementById("bz-yes-btn").addEventListener("click", function () { answerQuestion(true); }); document.getElementById("bz-no-btn").addEventListener("click", function () { answerQuestion(false); }); } function answerQuestion(isYes) { answers[currentQuestion] = isYes; if (isYes) { score++; } currentQuestion++; if (currentQuestion < questions.length) { renderQuestion(); window.setTimeout(function () { audit.scrollIntoView({ behavior:"smooth", block:"start" }); },50); } else { showResult(); } } function showResult() { const percentage = Math.round( (score / questions.length) * 100 ); let resultTitle = ""; let resultText = ""; let resultSymbol = ""; let resultBackground = ""; let resultColor = ""; if (score >= 20) { resultSymbol = "🟢"; resultTitle = "Strong Business Resilience"; resultBackground = "#f0fdf4"; resultColor = "#15803d"; resultText = "Your business has relatively few obvious dependency risks. You have already built several useful layers of resilience."; } else if (score >= 12) { resultSymbol = "🟡"; resultTitle = "Dependency Risks Exist"; resultBackground = "#fffbeb"; resultColor = "#b45309"; resultText = "Your business has a reasonable foundation, but several dependencies could become problems if circumstances suddenly change."; } else { resultSymbol = "🔴"; resultTitle = "Your Business May Be Vulnerable"; resultBackground = "#fef2f2"; resultColor = "#b91c1c"; resultText = "Your business appears to have significant dependency risks. Start by fixing the areas that could cause the biggest disruption."; } const categories = [ "Customers & Sales", "Suppliers & Operations", "Money & Cash Flow", "Digital & People", "Growth & Resilience" ]; let categoryHTML = ""; categories.forEach(function(category) { let total = 0; let earned = 0; questions.forEach(function(q,index) { if (q.section === category) { total++; if (answers[index] === true) { earned++; } } }); const catPercent = Math.round( (earned / total) * 100 ); let label = ""; if (earned >= 4) { label = "Strong"; } else if (earned >= 3) { label = "Needs Attention"; } else { label = "Priority Area"; } categoryHTML += `
${category} ${earned}/${total} — ${label}
`; }); let risks = []; questions.forEach(function(q,index) { if (answers[index] === false) { risks.push({ risk:q.risk, advice:q.advice, index:index }); } }); let topRisks = risks.slice(0,3); let priorityHTML = ""; if (topRisks.length === 0) { priorityHTML = `
🎉 Excellent! You did not identify any obvious dependency risks.
`; } else { topRisks.forEach(function(item,index) { priorityHTML += `
${index + 1}
${item.risk}
${item.advice}
`; }); } audit.innerHTML = `
BUSINESSZINDAGI BUSINESS ASSESSMENT
🎯 Your Business Independence Score
${score} / 25
${percentage}%
${resultSymbol}
${resultTitle}
${resultText}
📊 Your Resilience Profile
${categoryHTML}
🎯 Your Top Priorities
${priorityHTML} Your next step
Don't try to fix everything at once.
Start with your weakest area and work on one practical improvement at a time.
Your answers are calculated in your browser and are not submitted anywhere.
`; document.getElementById("bz-restart-btn").addEventListener("click", function () { currentQuestion = 0; score = 0; answers = []; renderQuestion(); window.setTimeout(function () { audit.scrollIntoView({ behavior:"smooth", block:"start" }); },50); }); } renderQuestion(); })();