export function careerChangeReadinessQuiz(form: FormTs) {
form.setTitle(() => '🔄 Are You Ready for a Career Change?');
// ============ SCORING SYSTEM ============
const scores = form.state<Record<string, number>>({});
const updateScore = (category: string, points: number) => {
scores.update(current => ({ ...current, [category]: points }));
};
const getTotalScore = () => {
const s = scores();
return Object.values(s).reduce((sum, val) => sum + (val || 0), 0);
};
const getMaxScore = () => 100;
const getScorePercentage = () => Math.round((getTotalScore() / getMaxScore()) * 100);
const getReadinessLevel = (): 'not-ready' | 'early' | 'preparing' | 'ready' | 'go-time' => {
const pct = getScorePercentage();
if (pct >= 85) return 'go-time';
if (pct >= 70) return 'ready';
if (pct >= 50) return 'preparing';
if (pct >= 30) return 'early';
return 'not-ready';
};
const getReadinessLabel = () => {
const level = getReadinessLevel();
const labels = {
'not-ready': '⏸️ Not Ready Yet',
'early': '🌱 Early Exploration',
'preparing': '📚 Actively Preparing',
'ready': '✅ Ready to Transition',
'go-time': '🚀 Go Time!'
};
return labels[level];
};
const getReadinessColor = () => {
const level = getReadinessLevel();
const colors = {
'not-ready': '#dc2626',
'early': '#ea580c',
'preparing': '#ca8a04',
'ready': '#16a34a',
'go-time': '#7c3aed'
};
return colors[level];
};
// ============ COMPLETION SCREEN ============
form.configureCompletionScreen({
type: 'text',
title: () => `${getReadinessLabel()}`,
message: () => {
const pct = getScorePercentage();
const level = getReadinessLevel();
const messages = {
'not-ready': `Your readiness score is ${pct}%. A career change may not be the right move right now. Focus on building foundations first - your report includes specific areas to develop.`,
'early': `Your readiness score is ${pct}%. You're in early exploration mode. Take time to research options and build skills before making a move.`,
'preparing': `Your readiness score is ${pct}%. You're actively preparing for a change. Continue building your runway and network. You're getting closer!`,
'ready': `Your readiness score is ${pct}%. You have the foundations in place for a successful career change. Start applying and networking actively!`,
'go-time': `Your readiness score is ${pct}%. You're exceptionally well-prepared! Take action now - the timing is right for your career pivot.`
};
return messages[level];
}
});
// ============ PAGES SETUP ============
const pages = form.addPages('quiz-pages', {
heightMode: 'current-page'
});
// ============ PAGE 1: Current Situation ============
const page1 = pages.addPage('current-situation', { mobileBreakpoint: 500 });
page1.addRow(row => {
row.addTextPanel('header1', {
label: 'Step 1 of 7: Current Situation',
computedValue: () => 'Let\'s understand where you are now',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page1.addSpacer({ height: '24px' });
page1.addRow(row => {
row.addSlider('yearsInRole', {
label: 'How many years have you been in your current role/industry?',
isRequired: true,
min: 0,
max: 30,
step: 1,
unit: 'years',
defaultValue: 5
});
});
page1.addRow(row => {
row.addEmojiRating('jobSatisfaction', {
label: 'How satisfied are you with your current job?',
isRequired: true,
preset: 'satisfaction',
size: 'lg',
showLabels: true,
alignment: 'center',
onValueChange: (val) => {
// Lower satisfaction = more ready for change
if (val === 'very-bad') updateScore('motivation', 10);
else if (val === 'bad') updateScore('motivation', 8);
else if (val === 'neutral') updateScore('motivation', 5);
else if (val === 'good') updateScore('motivation', 2);
else if (val === 'excellent') updateScore('motivation', 0);
}
});
});
page1.addRow(row => {
row.addSuggestionChips('changeReasons', {
label: 'What\'s driving your desire for change? (Select all that apply)',
isRequired: true,
suggestions: [
{ id: 'growth', name: '📈 Limited Growth' },
{ id: 'passion', name: '❤️ Follow Passion' },
{ id: 'money', name: '💰 Higher Income' },
{ id: 'balance', name: '⚖️ Work-Life Balance' },
{ id: 'values', name: '🎯 Values Alignment' },
{ id: 'burnout', name: '😓 Burnout' }
],
min: 1
});
});
// ============ PAGE 2: Financial Readiness ============
const page2 = pages.addPage('financial', { mobileBreakpoint: 500 });
page2.addRow(row => {
row.addTextPanel('header2', {
label: 'Step 2 of 7: Financial Readiness',
computedValue: () => 'Can you afford the transition period?',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page2.addSpacer({ height: '24px' });
page2.addRow(row => {
row.addRadioButton('emergencyFund', {
label: 'How many months of expenses do you have saved?',
tooltip: 'Career transitions typically take 3-6 months',
isRequired: true,
orientation: 'vertical',
options: [
{ id: '12plus', name: '🏦 12+ months (excellent runway)' },
{ id: '6-12', name: '💰 6-12 months (good runway)' },
{ id: '3-6', name: '💵 3-6 months (minimal runway)' },
{ id: 'under3', name: '⚠️ Less than 3 months' }
],
onValueChange: (val) => {
const points = { '12plus': 15, '6-12': 12, '3-6': 6, 'under3': 0 };
updateScore('financial', points[val as keyof typeof points] || 0);
}
});
});
page2.addRow(row => {
row.addRadioButton('incomeFlexibility', {
label: 'Can you accept a temporary pay cut during transition?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'significant', name: '✅ Yes, I can take 20%+ cut temporarily' },
{ id: 'some', name: '📊 Small cut (10-20%) is okay' },
{ id: 'same', name: '💼 Need same salary minimum' },
{ id: 'more', name: '📈 Need a raise to make this work' }
],
onValueChange: (val) => {
const points = { significant: 8, some: 6, same: 3, more: 0 };
updateScore('incomeFlexibility', points[val as keyof typeof points] || 0);
}
});
});
// ============ PAGE 3: Skills & Experience ============
const page3 = pages.addPage('skills', { mobileBreakpoint: 500 });
page3.addRow(row => {
row.addTextPanel('header3', {
label: 'Step 3 of 7: Skills & Experience',
computedValue: () => 'Do you have what it takes for your new direction?',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page3.addSpacer({ height: '24px' });
page3.addRow(row => {
row.addRadioButton('targetClarity', {
label: 'How clear are you on your target role/industry?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'crystal', name: '🎯 Crystal clear - specific role and companies' },
{ id: 'general', name: '📋 General direction - know the industry' },
{ id: 'exploring', name: '🔍 Still exploring options' },
{ id: 'unsure', name: '❓ Not sure what I want' }
],
onValueChange: (val) => {
const points = { crystal: 10, general: 6, exploring: 3, unsure: 0 };
updateScore('clarity', points[val as keyof typeof points] || 0);
}
});
});
page3.addRow(row => {
row.addRadioButton('skillsGap', {
label: 'How much do your current skills match your target role?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'match', name: '✅ Strong match - 80%+ transferable' },
{ id: 'partial', name: '📊 Partial match - need some upskilling' },
{ id: 'significant', name: '📚 Significant gap - need major upskilling' },
{ id: 'complete', name: '🔄 Complete pivot - starting fresh' }
],
onValueChange: (val) => {
const points = { match: 12, partial: 8, significant: 4, complete: 1 };
updateScore('skills', points[val as keyof typeof points] || 0);
}
});
});
page3.addRow(row => {
row.addSuggestionChips('upskilling', {
label: 'What have you done to prepare? (Select all that apply)',
suggestions: [
{ id: 'courses', name: '📚 Online Courses' },
{ id: 'cert', name: '🎓 Certifications' },
{ id: 'projects', name: '💻 Side Projects' },
{ id: 'volunteer', name: '🤝 Volunteering' },
{ id: 'network', name: '👥 Networking' },
{ id: 'mentor', name: '🧭 Mentorship' }
],
onValueChange: (val) => {
const points = val ? Math.min(val.length * 2, 8) : 0;
updateScore('preparation', points);
}
});
});
// ============ PAGE 4: Network & Support ============
const page4 = pages.addPage('network', { mobileBreakpoint: 500 });
page4.addRow(row => {
row.addTextPanel('header4', {
label: 'Step 4 of 7: Network & Support',
computedValue: () => 'Your network is your net worth in a career change',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page4.addSpacer({ height: '24px' });
page4.addRow(row => {
row.addRadioButton('targetNetwork', {
label: 'Do you have connections in your target industry?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'strong', name: '🤝 Yes, strong network with decision-makers' },
{ id: 'some', name: '👥 Some connections, building more' },
{ id: 'starting', name: '🌱 Just starting to network' },
{ id: 'none', name: '❌ No connections yet' }
],
onValueChange: (val) => {
const points = { strong: 10, some: 6, starting: 3, none: 0 };
updateScore('network', points[val as keyof typeof points] || 0);
}
});
});
page4.addRow(row => {
row.addRadioButton('familySupport', {
label: 'How supportive is your family/partner of this change?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'full', name: '💚 Fully supportive and encouraging' },
{ id: 'supportive', name: '👍 Supportive but cautious' },
{ id: 'neutral', name: '😐 Neutral / not involved' },
{ id: 'against', name: '⚠️ Not supportive' }
],
onValueChange: (val) => {
const points = { full: 8, supportive: 6, neutral: 3, against: 0 };
updateScore('support', points[val as keyof typeof points] || 0);
}
});
});
// ============ PAGE 5: Personal Brand ============
const page5 = pages.addPage('personal-brand', { mobileBreakpoint: 500 });
page5.addRow(row => {
row.addTextPanel('header5', {
label: 'Step 5 of 7: Personal Brand',
computedValue: () => 'Is your professional presence ready?',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page5.addSpacer({ height: '24px' });
page5.addRow(row => {
row.addMatrixQuestion('brandReadiness', {
label: 'How ready are these elements?',
isRequired: true,
rows: [
{ id: 'resume', label: 'Resume/CV', description: 'Updated for target role' },
{ id: 'linkedin', label: 'LinkedIn Profile', description: 'Optimized and active' },
{ id: 'portfolio', label: 'Portfolio/Work Samples', description: 'Relevant to new direction' }
],
columns: [
{ id: 'not', label: 'Not Started' },
{ id: 'wip', label: 'In Progress' },
{ id: 'done', label: 'Ready' }
],
selectionMode: 'single',
striped: true,
fullWidth: true,
onValueChange: (val) => {
if (!val) return;
const pointsMap: Record<string, number> = { not: 0, wip: 2, done: 4 };
let total = 0;
for (const col of Object.values(val)) {
total += pointsMap[col as string] || 0;
}
updateScore('brand', total);
}
});
});
// ============ PAGE 6: Results ============
const page6 = pages.addPage('results', { mobileBreakpoint: 500 });
page6.addRow(row => {
row.addTextPanel('header6', {
label: 'Step 6 of 7: Your Results',
computedValue: () => 'Your career change readiness assessment',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page6.addSpacer({ height: '24px' });
page6.addRow(row => {
row.addTextPanel('finalScoreLabel', {
label: '🔄 Career Change Readiness',
computedValue: () => '',
customStyles: {
fontSize: '1.2rem',
fontWeight: '700',
textAlign: 'center'
}
});
});
page6.addRow(row => {
row.addTextPanel('finalReadinessLevel', {
computedValue: () => getReadinessLabel(),
customStyles: () => ({
fontSize: '1.5rem',
fontWeight: '800',
textAlign: 'center',
color: getReadinessColor(),
padding: '15px',
background: '#f9fafb',
borderRadius: '12px',
border: `3px solid ${getReadinessColor()}`
})
});
});
page6.addRow(row => {
row.addTextPanel('scoreBreakdown', {
computedValue: () => {
const total = getTotalScore();
const pct = getScorePercentage();
return `Readiness Score: ${total}/${getMaxScore()} (${pct}%)`;
},
customStyles: {
fontSize: '1.1rem',
fontWeight: '600',
textAlign: 'center',
color: '#374151',
marginTop: '10px'
}
});
});
page6.addRow(row => {
row.addTextPanel('recommendation', {
computedValue: () => {
const level = getReadinessLevel();
const recommendations = {
'not-ready': '⏸️ Focus on building financial runway and gaining clarity on your direction before making any moves.',
'early': '🌱 Spend the next 3-6 months exploring options, building skills, and growing your network.',
'preparing': '📚 Keep building momentum! Focus on filling skill gaps and expanding your network in the target industry.',
'ready': '✅ Start applying and networking actively. Your foundations are solid - take action!',
'go-time': '🚀 Everything is aligned. Make your move with confidence. The time is now!'
};
return recommendations[level];
},
customStyles: {
fontSize: '0.95rem',
color: '#4b5563',
textAlign: 'center',
padding: '15px',
background: '#f3f4f6',
borderRadius: '8px',
marginTop: '15px',
lineHeight: '1.5'
}
});
});
const detailsSection = page6.addSubform('detailsBreakdown', {
title: '📊 Detailed Score Breakdown (click to expand)',
isCollapsible: true,
customStyles: {
marginTop: '1rem',
background: '#f9fafb',
borderRadius: '8px'
}
});
detailsSection.addRow(row => {
row.addTextPanel('motivationDetail', {
label: '🎯 Motivation',
computedValue: () => `${scores()['motivation'] || 0}/10`,
customStyles: {
fontSize: '0.9rem',
padding: '8px 12px',
background: '#dbeafe',
borderRadius: '6px'
}
}, '1fr');
row.addTextPanel('financialDetail', {
label: '💰 Financial',
computedValue: () => {
const s = scores();
const score = (s['financial'] || 0) + (s['incomeFlexibility'] || 0);
return `${score}/23`;
},
customStyles: {
fontSize: '0.9rem',
padding: '8px 12px',
background: '#d1fae5',
borderRadius: '6px'
}
}, '1fr');
});
detailsSection.addRow(row => {
row.addTextPanel('skillsDetail', {
label: '📚 Skills',
computedValue: () => {
const s = scores();
const score = (s['clarity'] || 0) + (s['skills'] || 0) + (s['preparation'] || 0);
return `${score}/30`;
},
customStyles: {
fontSize: '0.9rem',
padding: '8px 12px',
background: '#fef3c7',
borderRadius: '6px'
}
}, '1fr');
row.addTextPanel('networkDetail', {
label: '🤝 Network',
computedValue: () => {
const s = scores();
const score = (s['network'] || 0) + (s['support'] || 0);
return `${score}/18`;
},
customStyles: {
fontSize: '0.9rem',
padding: '8px 12px',
background: '#fce7f3',
borderRadius: '6px'
}
}, '1fr');
});
detailsSection.addRow(row => {
row.addTextPanel('brandDetail', {
label: '🎨 Personal Brand',
computedValue: () => `${scores()['brand'] || 0}/12`,
customStyles: {
fontSize: '0.9rem',
padding: '8px 12px',
background: '#e0e7ff',
borderRadius: '6px'
}
}, '1fr');
row.addEmpty('1fr');
});
// ============ PAGE 7: Lead Capture ============
const page7 = pages.addPage('lead-capture', { mobileBreakpoint: 500 });
page7.addRow(row => {
row.addTextPanel('header7', {
label: 'Step 7 of 7: Get Your Action Plan',
computedValue: () => 'Enter your details to receive your personalized career change roadmap',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page7.addSpacer({ height: '24px' });
page7.addRow(row => {
row.addTextbox('name', {
label: 'Your Name',
isRequired: true,
placeholder: 'Career Changer'
}, '1fr');
row.addEmail('email', {
label: 'Email',
isRequired: true,
placeholder: 'you@email.com'
}, '1fr');
});
page7.addRow(row => {
row.addDropdown('currentIndustry', {
label: 'Current Industry',
options: [
{ id: 'tech', name: 'Technology' },
{ id: 'finance', name: 'Finance' },
{ id: 'healthcare', name: 'Healthcare' },
{ id: 'education', name: 'Education' },
{ id: 'marketing', name: 'Marketing' },
{ id: 'other', name: 'Other' }
],
placeholder: 'Select industry'
}, '1fr');
row.addDropdown('targetIndustry', {
label: 'Target Industry',
options: [
{ id: 'tech', name: 'Technology' },
{ id: 'finance', name: 'Finance' },
{ id: 'healthcare', name: 'Healthcare' },
{ id: 'education', name: 'Education' },
{ id: 'marketing', name: 'Marketing' },
{ id: 'other', name: 'Other' }
],
placeholder: 'Select industry'
}, '1fr');
});
page7.addRow(row => {
row.addCheckboxList('consent', {
options: [
{ id: 'roadmap', name: '📄 Send me my personalized career change roadmap', isRequired: true },
{ id: 'tips', name: '💡 Send me weekly career transition tips' },
{ id: 'coaching', name: '📞 I\'m interested in career coaching' }
],
defaultValue: ['roadmap'],
orientation: 'vertical'
});
});
// ============ PDF REPORT ============
form.configurePdf('career-roadmap', pdf => {
pdf.configure({
filename: 'career-change-roadmap.pdf',
pageSize: 'A4',
allowUserDownload: true,
downloadButtonLabel: '📄 Download Career Roadmap',
header: {
title: 'Your Career Change Roadmap',
subtitle: 'Personalized Transition Plan'
},
footer: {
text: 'Generated by FormTs Career Change Quiz',
showPageNumbers: true
}
});
pdf.addSection('Readiness Assessment', section => {
section.addRow(row => {
row.addField('Readiness Level', getReadinessLabel());
row.addField('Overall Score', `${getScorePercentage()}%`);
});
section.addRow(row => {
row.addField('Assessment Date', new Date().toLocaleDateString());
});
});
pdf.addSection('Score Breakdown', section => {
const s = scores();
section.addTable(
['Category', 'Score', 'Status'],
[
['Motivation', `${s['motivation'] || 0}/10`, (s['motivation'] || 0) >= 7 ? '✅' : '⚠️'],
['Financial Readiness', `${(s['financial'] || 0) + (s['incomeFlexibility'] || 0)}/23`, (s['financial'] || 0) >= 10 ? '✅' : '⚠️'],
['Skills & Preparation', `${(s['clarity'] || 0) + (s['skills'] || 0) + (s['preparation'] || 0)}/30`, (s['skills'] || 0) >= 8 ? '✅' : '⚠️'],
['Network & Support', `${(s['network'] || 0) + (s['support'] || 0)}/18`, (s['network'] || 0) >= 6 ? '✅' : '⚠️'],
['Personal Brand', `${s['brand'] || 0}/12`, (s['brand'] || 0) >= 8 ? '✅' : '⚠️']
]
);
});
pdf.addPageBreak();
pdf.addSection('Your 90-Day Action Plan', section => {
const level = getReadinessLevel();
if (level === 'not-ready' || level === 'early') {
section.addText('MONTH 1: Foundation Building');
section.addText('• Build emergency fund to 6+ months');
section.addText('• Research target industries and roles');
section.addText('• Identify skill gaps');
section.addSpacer(5);
section.addText('MONTH 2-3: Skill Development');
section.addText('• Enroll in relevant courses/certifications');
section.addText('• Start networking in target industry');
section.addText('• Update LinkedIn for new direction');
} else {
section.addText('MONTH 1: Active Preparation');
section.addText('• Finalize resume and portfolio');
section.addText('• Conduct 10+ informational interviews');
section.addText('• Apply to 5-10 target positions');
section.addSpacer(5);
section.addText('MONTH 2-3: Full Launch');
section.addText('• Apply to 20+ positions');
section.addText('• Attend industry events');
section.addText('• Follow up with all applications');
}
});
pdf.addSection('Recommended Resources', section => {
section.addText('Books:');
section.addText('• "Designing Your Life" - Burnett & Evans');
section.addText('• "What Color Is Your Parachute?" - Bolles');
section.addSpacer(5);
section.addText('Tools:');
section.addText('• LinkedIn Learning for skill building');
section.addText('• Glassdoor for salary research');
section.addText('• Lunchclub for networking');
});
});
// ============ SUBMIT BUTTON ============
form.configureSubmitButton({
label: () => `🔄 Get My Roadmap (${getScorePercentage()}% Ready)`
});
form.configureSubmitBehavior({
sendToServer: true
});
}