Changed around line 1
+ const questions = [
+ {
+ question: "How do you prefer to make decisions?",
+ options: [
+ { text: "Based on data and analysis", score: { analyst: 2, innovator: 0, leader: 1, builder: 1 } },
+ { text: "Following my intuition", score: { analyst: 0, innovator: 2, leader: 1, builder: 1 } },
+ { text: "Consulting with others", score: { analyst: 1, innovator: 0, leader: 2, builder: 1 } },
+ { text: "Through practical experimentation", score: { analyst: 1, innovator: 1, leader: 0, builder: 2 } }
+ ]
+ },
+ // Add more questions here
+ ];
+
+ let currentQuestion = 0;
+ let scores = {
+ analyst: 0,
+ innovator: 0,
+ leader: 0,
+ builder: 0
+ };
+
+ const archetypes = {
+ analyst: {
+ title: "The Strategic Analyst",
+ description: "You excel at data-driven decision making and strategic planning. Your ideal business path involves consulting, financial services, or analytical roles."
+ },
+ innovator: {
+ title: "The Creative Innovator",
+ description: "You thrive on creativity and novel solutions. Your path lies in startups, product development, or creative industries."
+ },
+ leader: {
+ title: "The Natural Leader",
+ description: "You have a talent for inspiring and managing others. Consider business leadership, executive roles, or building your own company."
+ },
+ builder: {
+ title: "The Practical Builder",
+ description: "You excel at creating tangible results and systems. Your path includes franchising, manufacturing, or scalable service businesses."
+ }
+ };
+
+ function startQuiz() {
+ document.querySelector('.hero').classList.add('hidden');
+ document.querySelector('#quiz').classList.remove('hidden');
+ displayQuestion();
+ }
+
+ function displayQuestion() {
+ const questionEl = document.getElementById('question');
+ const optionsEl = document.getElementById('options');
+ const progressEl = document.querySelector('.progress');
+
+ progressEl.style.width = `${(currentQuestion / questions.length) * 100}%`;
+ questionEl.textContent = questions[currentQuestion].question;
+
+ optionsEl.innerHTML = '';
+ questions[currentQuestion].options.forEach((option, index) => {
+ const button = document.createElement('button');
+ button.textContent = option.text;
+ button.classList.add('option-button');
+ button.onclick = () => selectOption(index);
+ optionsEl.appendChild(button);
+ });
+ }
+
+ function selectOption(index) {
+ const option = questions[currentQuestion].options[index];
+ Object.keys(option.score).forEach(key => {
+ scores[key] += option.score[key];
+ });
+
+ currentQuestion++;
+
+ if (currentQuestion >= questions.length) {
+ showResults();
+ } else {
+ displayQuestion();
+ }
+ }
+
+ function showResults() {
+ document.querySelector('#quiz').classList.add('hidden');
+ document.querySelector('#results').classList.remove('hidden');
+
+ const topArchetype = Object.keys(scores).reduce((a, b) =>
+ scores[a] > scores[b] ? a : b
+ );
+
+ document.getElementById('archetype-title').textContent = archetypes[topArchetype].title;
+ document.getElementById('archetype-description').textContent = archetypes[topArchetype].description;
+ }
+
+ function restartQuiz() {
+ currentQuestion = 0;
+ scores = {
+ analyst: 0,
+ innovator: 0,
+ leader: 0,
+ builder: 0
+ };
+ document.querySelector('#results').classList.add('hidden');
+ document.querySelector('.hero').classList.remove('hidden');
+ }