Business Legal Compliance Health Score
Answer the questions to generate your company's compliance score.
Your Compliance Health Score
Overall Score
Calculating...
This score reflects your answers in the assessment. See the breakdown and recommendations below.
Category Breakdown
Recommendations
Welcome!
Please complete the questionnaire in the "Compliance Assessment" tab to generate your report.
Generating PDF, please wait...
Disclaimer: This tool provides a general compliance health overview and is for informational purposes only. It is not a substitute for professional legal advice.
• ${rec.category}: ${rec.text}
`; }); } else { recList.innerHTML = `Great job! No immediate recommendations based on your answers.
`; } } // --- PDF GENERATION --- downloadPdfBtn.addEventListener('click', () => { if (!currentScore) return; const pdfLoader = document.getElementById('pdf-loader'); pdfLoader.classList.remove('hidden'); downloadPdfBtn.disabled = true; try { const { jsPDF } = window.jspdf; const doc = new jsPDF(); doc.setFontSize(20); doc.text("Business Compliance Health Report", 14, 22); doc.setFontSize(11); doc.setTextColor(100); doc.text(`Generated on: ${new Date().toLocaleDateString()}`, 14, 30); doc.setFontSize(16); doc.text(`Overall Score: ${currentScore.finalScore}%`, 14, 45); doc.autoTable({ startY: 55, head: [['Category', 'Score']], body: Object.entries(currentScore.categoryScores).map(([cat, data]) => [cat, `${data.score}%`]), theme: 'striped', headStyles: { fillColor: [41, 128, 185] } }); const finalY = doc.lastAutoTable.finalY || 60; doc.setFontSize(14); doc.text("Recommendations", 14, finalY + 15); const recBody = currentScore.recommendations.map(rec => [rec.category, rec.text]); if(recBody.length > 0) { doc.autoTable({ startY: finalY + 20, head: [['Area', 'Suggestion']], body: recBody, theme: 'grid' }); } else { doc.setFontSize(11); doc.text("No specific recommendations based on provided answers.", 14, finalY + 20); } doc.save('Compliance-Health-Report.pdf'); } catch (e) { console.error("PDF generation failed:", e); alert("An error occurred while generating the PDF."); } finally { pdfLoader.classList.add('hidden'); downloadPdfBtn.disabled = false; } }); // --- INITIALIZATION --- renderQuestions(); showTab(0); });