Online Personal Learning Style Identifier

Online Personal Learning Style Identifier

Answer the questions below to discover your dominant learning style and get tailored study tips.

Learning Style Questionnaire

${index + 1}. ${q.question}

${optionsHtml}
`; quizForm.appendChild(questionEl); }); }; const handleSubmit = () => { errorMessage.textContent = ''; const formData = new FormData(quizForm); const scores = { V: 0, A: 0, K: 0 }; let answeredQuestions = 0; for (const [key, value] of formData.entries()) { scores[value]++; answeredQuestions++; } if (answeredQuestions < QUIZ_DATA.length) { errorMessage.textContent = "Please answer all questions before submitting."; return; } let dominantStyle = 'V'; if (scores.A > scores[dominantStyle]) dominantStyle = 'A'; if (scores.K > scores[dominantStyle]) dominantStyle = 'K'; lastResult = STYLE_INFO[dominantStyle]; displayResults(lastResult); }; const displayResults = (result) => { document.getElementById('quiz-section').classList.add('hidden'); submitQuizBtn.parentElement.classList.add('hidden'); resultTitle.textContent = result.name; resultDescription.textContent = result.description; resultTips.innerHTML = result.tips.map(tip => `
  • ${tip}
  • `).join(''); resultsSection.classList.remove('hidden'); }; const generatePdf = () => { if (!lastResult) return; const { jsPDF } = window.jspdf; const doc = new jsPDF(); doc.setFontSize(20); doc.text("Personal Learning Style Report", 105, 20, { align: 'center' }); doc.setFontSize(16); doc.setFont('helvetica', 'bold'); doc.text(`Your Dominant Style: ${lastResult.name}`, 14, 40); doc.setFontSize(12); doc.setFont('helvetica', 'normal'); const descriptionLines = doc.splitTextToSize(lastResult.description, 180); doc.text(descriptionLines, 14, 55); doc.autoTable({ startY: doc.lastAutoTable.finalY ? doc.lastAutoTable.finalY + 20 : 100, head: [['Recommended Study Tips']], body: lastResult.tips.map(tip => [tip]), theme: 'grid', headStyles: { fillColor: [3, 105, 161] }, // sky-700 }); doc.save('Learning_Style_Report.pdf'); }; // --- EVENT LISTENERS --- submitQuizBtn.addEventListener('click', handleSubmit); downloadPdfBtn.addEventListener('click', generatePdf); // --- INITIALIZATION --- renderQuiz(); });
    Scroll to Top