Changed around line 1
+ document.getElementById('dreamQuiz').addEventListener('submit', function(event) {
+ event.preventDefault();
+
+ const q1 = parseInt(document.getElementById('q1').value);
+ const q2 = parseInt(document.getElementById('q2').value);
+ const q3 = parseInt(document.getElementById('q3').value);
+
+ const totalScore = (q1 + q2 + q3) / 3;
+ const roundedScore = Math.round(totalScore);
+
+ document.getElementById('score').textContent = roundedScore;
+
+ let message = '';
+ if (roundedScore < 30) {
+ message = 'You have a lot of potential to grow. Start taking small steps towards your dreams today!';
+ } else if (roundedScore < 70) {
+ message = 'You\'re on the right path. Keep pushing forward and stay committed!';
+ } else {
+ message = 'You\'re doing amazing! Keep up the great work and your dreams will soon be within reach.';
+ }
+
+ document.getElementById('message').textContent = message;
+ document.getElementById('result').classList.remove('hidden');
+ });