export function childcareFeedbackSurvey(form: FormTs) {
// Childcare/Daycare Feedback Survey - Comprehensive parent satisfaction
// Demonstrates: MatrixQuestion, StarRating, EmojiRating, Dropdown, Conditional Sections
// ============================================
// HEADER
// ============================================
form.addRow(row => {
row.addTextPanel('header', {
label: 'Parent Feedback Survey',
computedValue: () => 'Help us provide the best care for your child. Your feedback shapes how we nurture and educate.',
customStyles: {
background: 'linear-gradient(135deg, #ec4899 0%, #be185d 100%)',
color: 'white',
padding: '28px',
borderRadius: '12px',
textAlign: 'center',
fontSize: '15px'
}
});
});
// ============================================
// SECTION 1: Child Information
// ============================================
const childSection = form.addSubform('child', {
title: 'About Your Child',
customStyles: { backgroundColor: '#fdf4ff', padding: '16px', borderRadius: '8px' }
});
childSection.addRow(row => {
row.addDropdown('childAge', {
label: "Child's age group",
options: [
{ id: 'infant', name: 'Infant (0-12 months)' },
{ id: 'toddler', name: 'Toddler (1-2 years)' },
{ id: 'preschool', name: 'Preschool (3-4 years)' },
{ id: 'prek', name: 'Pre-K (4-5 years)' }
],
placeholder: 'Select age group',
isRequired: true
}, '1fr');
row.addDropdown('enrollmentDuration', {
label: 'How long enrolled?',
options: [
{ id: 'less-1-month', name: 'Less than 1 month' },
{ id: '1-3-months', name: '1-3 months' },
{ id: '3-6-months', name: '3-6 months' },
{ id: '6-12-months', name: '6-12 months' },
{ id: 'over-1-year', name: 'Over 1 year' }
],
placeholder: 'Select duration',
isRequired: true
}, '1fr');
});
childSection.addRow(row => {
row.addRadioButton('scheduleType', {
label: 'Care schedule',
options: [
{ id: 'full-time', name: 'Full-time (5 days)' },
{ id: 'part-time', name: 'Part-time (2-4 days)' },
{ id: 'drop-in', name: 'Drop-in/Occasional' }
],
orientation: 'horizontal'
});
});
// ============================================
// SECTION 2: Safety & Security (Most Important)
// ============================================
const safetySection = form.addSubform('safety', {
title: 'Safety & Security',
isVisible: () => childSection.dropdown('childAge')?.value() !== null,
customStyles: { backgroundColor: '#fef2f2', padding: '16px', borderRadius: '8px' }
});
safetySection.addRow(row => {
row.addTextPanel('safetyIntro', {
computedValue: () => 'Your child\'s safety is our top priority. Please rate the following:',
customStyles: { fontStyle: 'italic', color: '#6b7280', marginBottom: '8px' }
});
});
safetySection.addRow(row => {
row.addStarRating('overallSafety', {
label: 'Overall feeling of safety and security',
maxStars: 5,
size: 'lg',
alignment: 'center'
});
});
safetySection.addRow(row => {
row.addMatrixQuestion('safetyDetails', {
label: 'Rate specific safety aspects:',
rows: [
{ id: 'secure-entry', label: 'Secure entry/exit procedures', isRequired: true },
{ id: 'supervision', label: 'Adequate supervision at all times', isRequired: true },
{ id: 'pickup-auth', label: 'Pickup authorization process', isRequired: true },
{ id: 'emergency-prep', label: 'Emergency preparedness', isRequired: false },
{ id: 'incident-report', label: 'Incident reporting', isRequired: false }
],
columns: [
{ id: 'poor', label: 'Poor' },
{ id: 'fair', label: 'Fair' },
{ id: 'good', label: 'Good' },
{ id: 'excellent', label: 'Excellent' }
],
fullWidth: true,
striped: true
});
});
// ============================================
// SECTION 3: Child Development & Learning
// ============================================
const developmentSection = form.addSubform('development', {
title: 'Development & Learning',
isVisible: () => safetySection.starRating('overallSafety')?.value() !== null,
customStyles: { backgroundColor: '#f0fdf4', padding: '16px', borderRadius: '8px' }
});
developmentSection.addRow(row => {
row.addEmojiRating('childHappiness', {
label: 'How happy is your child to attend?',
preset: 'mood',
size: 'lg',
alignment: 'center',
isRequired: true
});
});
developmentSection.addRow(row => {
row.addMatrixQuestion('developmentAreas', {
label: () => {
const age = childSection.dropdown('childAge')?.value();
if (age === 'infant') return 'Rate developmental support for your infant:';
if (age === 'toddler') return 'Rate developmental activities for your toddler:';
return 'Rate learning activities for your child:';
},
rows: () => {
const age = childSection.dropdown('childAge')?.value();
if (age === 'infant') {
return [
{ id: 'sensory', label: 'Sensory stimulation activities', isRequired: true },
{ id: 'motor', label: 'Motor skill development', isRequired: true },
{ id: 'bonding', label: 'Caregiver bonding time', isRequired: true },
{ id: 'routine', label: 'Consistent daily routines', isRequired: true }
];
}
if (age === 'toddler') {
return [
{ id: 'language', label: 'Language development', isRequired: true },
{ id: 'motor', label: 'Gross/fine motor activities', isRequired: true },
{ id: 'social', label: 'Social interaction opportunities', isRequired: true },
{ id: 'creative', label: 'Creative play and art', isRequired: true },
{ id: 'outdoor', label: 'Outdoor play time', isRequired: false }
];
}
return [
{ id: 'literacy', label: 'Pre-literacy skills', isRequired: true },
{ id: 'math', label: 'Early math concepts', isRequired: true },
{ id: 'social', label: 'Social-emotional development', isRequired: true },
{ id: 'creative', label: 'Arts and creative expression', isRequired: true },
{ id: 'stem', label: 'Science exploration', isRequired: false },
{ id: 'school-ready', label: 'School readiness preparation', isRequired: false }
];
},
columns: [
{ id: 'needs-improvement', label: 'Needs Work' },
{ id: 'satisfactory', label: 'Satisfactory' },
{ id: 'good', label: 'Good' },
{ id: 'outstanding', label: 'Outstanding' }
],
fullWidth: true,
striped: true
});
});
// ============================================
// SECTION 4: Staff Quality
// ============================================
const staffSection = form.addSubform('staff', {
title: 'Staff & Caregivers',
isVisible: () => developmentSection.emojiRating('childHappiness')?.value() !== null,
customStyles: { backgroundColor: '#eff6ff', padding: '16px', borderRadius: '8px' }
});
staffSection.addRow(row => {
row.addStarRating('staffWarmth', {
label: 'Warmth and care shown to children',
maxStars: 5,
size: 'lg',
alignment: 'center'
});
});
staffSection.addRow(row => {
row.addStarRating('staffProfessionalism', {
label: 'Professionalism',
maxStars: 5,
size: 'md'
}, '1fr');
row.addStarRating('staffResponsiveness', {
label: 'Responsiveness to concerns',
maxStars: 5,
size: 'md'
}, '1fr');
});
staffSection.addRow(row => {
row.addRatingScale('staffRatio', {
label: 'How satisfied are you with the staff-to-child ratio?',
preset: 'satisfaction',
size: 'md',
alignment: 'center'
});
});
// ============================================
// SECTION 5: Communication
// ============================================
const communicationSection = form.addSubform('communication', {
title: 'Parent Communication',
isVisible: () => staffSection.starRating('staffWarmth')?.value() !== null,
customStyles: { backgroundColor: '#fefce8', padding: '16px', borderRadius: '8px' }
});
communicationSection.addRow(row => {
row.addCheckboxList('communicationChannels', {
label: 'Which communication channels do you use? (Select all)',
options: [
{ id: 'app', name: 'Mobile app/Parent portal' },
{ id: 'email', name: 'Email updates' },
{ id: 'daily-report', name: 'Daily written reports' },
{ id: 'in-person', name: 'In-person at pickup/drop-off' },
{ id: 'newsletter', name: 'Monthly newsletter' },
{ id: 'parent-teacher', name: 'Parent-teacher conferences' }
],
orientation: 'vertical'
});
});
communicationSection.addRow(row => {
row.addStarRating('communicationQuality', {
label: 'Overall quality of communication',
maxStars: 5,
size: 'lg',
alignment: 'center'
});
});
communicationSection.addRow(row => {
row.addThumbRating('informedDaily', {
label: 'Do you feel well-informed about your child\'s daily activities?',
size: 'lg',
showLabels: true,
upLabel: 'Yes, always',
downLabel: 'Not really',
alignment: 'center'
});
});
// ============================================
// SECTION 6: Facility & Environment
// ============================================
const facilitySection = form.addSubform('facility', {
title: 'Facility & Environment',
isVisible: () => communicationSection.starRating('communicationQuality')?.value() !== null
});
facilitySection.addRow(row => {
row.addStarRating('cleanliness', {
label: 'Cleanliness',
maxStars: 5,
size: 'md'
}, '1fr');
row.addStarRating('equipment', {
label: 'Equipment & toys',
maxStars: 5,
size: 'md'
}, '1fr');
row.addStarRating('outdoorSpace', {
label: 'Outdoor play area',
maxStars: 5,
size: 'md'
}, '1fr');
});
// ============================================
// SECTION 7: Infant-Specific (Conditional)
// ============================================
const infantSection = form.addSubform('infant', {
title: 'Infant Care Specific',
isVisible: () => childSection.dropdown('childAge')?.value() === 'infant',
customStyles: { backgroundColor: '#fce7f3', padding: '16px', borderRadius: '8px' }
});
infantSection.addRow(row => {
row.addStarRating('feedingCare', {
label: 'Feeding care and attention',
maxStars: 5,
size: 'md'
}, '1fr');
row.addStarRating('diaperCare', {
label: 'Diapering and hygiene',
maxStars: 5,
size: 'md'
}, '1fr');
});
infantSection.addRow(row => {
row.addStarRating('sleepRoutine', {
label: 'Nap/sleep routine adherence',
maxStars: 5,
size: 'lg',
alignment: 'center'
});
});
// ============================================
// SECTION 8: Overall Satisfaction
// ============================================
const overallSection = form.addSubform('overall', {
title: 'Overall Experience',
isVisible: () => facilitySection.starRating('cleanliness')?.value() !== null ||
(childSection.dropdown('childAge')?.value() === 'infant' && infantSection.starRating('feedingCare')?.value() !== null)
});
overallSection.addRow(row => {
row.addRatingScale('overallSatisfaction', {
label: 'Overall, how satisfied are you with our childcare services?',
preset: 'satisfaction',
size: 'lg',
alignment: 'center',
isRequired: true
});
});
overallSection.addRow(row => {
row.addRatingScale('recommendLikelihood', {
label: 'How likely are you to recommend us to other parents?',
preset: 'nps',
showCategoryLabel: true,
showSegmentColors: true,
alignment: 'center'
});
});
overallSection.addSpacer({ height: '16px' });
overallSection.addRow(row => {
row.addTextarea('bestPart', {
label: 'What do you appreciate most about our care?',
placeholder: 'Tell us what we are doing well...',
rows: 3,
autoExpand: true
});
});
overallSection.addRow(row => {
row.addTextarea('improvements', {
label: 'What could we improve?',
placeholder: 'Share any suggestions for improvement...',
rows: 3,
autoExpand: true
});
});
// ============================================
// SECTION 9: Summary
// ============================================
const summarySection = form.addSubform('summary', {
title: 'Feedback Summary',
isVisible: () => overallSection.ratingScale('overallSatisfaction')?.value() !== null
});
summarySection.addRow(row => {
row.addTextPanel('summaryContent', {
computedValue: () => {
const age = childSection.dropdown('childAge')?.value();
const safety = safetySection.starRating('overallSafety')?.value();
const happiness = developmentSection.emojiRating('childHappiness')?.value();
const staffWarmth = staffSection.starRating('staffWarmth')?.value();
const communication = communicationSection.starRating('communicationQuality')?.value();
const overall = overallSection.ratingScale('overallSatisfaction')?.value();
const nps = overallSection.ratingScale('recommendLikelihood')?.value();
if (!overall) return '';
const ageLabels: Record<string, string> = {
'infant': 'Infant (0-12 months)',
'toddler': 'Toddler (1-2 years)',
'preschool': 'Preschool (3-4 years)',
'prek': 'Pre-K (4-5 years)'
};
const happinessLabels: Record<string, string> = {
'sad': 'Often unhappy',
'down': 'Sometimes reluctant',
'neutral': 'Neutral',
'happy': 'Usually happy',
'excited': 'Loves attending!'
};
let summary = 'Childcare Feedback Summary\n';
summary += '═'.repeat(28) + '\n\n';
summary += `Child Age Group: ${ageLabels[age || ''] || 'Not specified'}\n\n`;
if (safety) summary += `Safety Rating: ${'★'.repeat(safety)}${'☆'.repeat(5 - safety)} (${safety}/5)\n`;
if (happiness) summary += `Child Happiness: ${happinessLabels[happiness] || happiness}\n`;
if (staffWarmth) summary += `Staff Warmth: ${'★'.repeat(staffWarmth)}${'☆'.repeat(5 - staffWarmth)}\n`;
if (communication) summary += `Communication: ${'★'.repeat(communication)}${'☆'.repeat(5 - communication)}\n`;
summary += `\nOverall Satisfaction: ${overall}/5\n`;
if (nps !== null && nps !== undefined) {
const category = nps >= 9 ? 'Promoter' : nps >= 7 ? 'Passive' : 'Detractor';
summary += `Recommend Score: ${nps}/10 (${category})`;
}
return summary;
},
customStyles: () => {
const overall = overallSection.ratingScale('overallSatisfaction')?.value();
const baseStyles = {
padding: '16px',
borderRadius: '8px',
whiteSpace: 'pre-wrap',
fontFamily: 'monospace',
fontSize: '13px'
};
if (overall !== null && overall !== undefined) {
if (overall >= 4) return { ...baseStyles, backgroundColor: '#dcfce7', borderLeft: '4px solid #22c55e' };
if (overall >= 3) return { ...baseStyles, backgroundColor: '#fef3c7', borderLeft: '4px solid #f59e0b' };
return { ...baseStyles, backgroundColor: '#fee2e2', borderLeft: '4px solid #ef4444' };
}
return baseStyles;
}
});
});
// ============================================
// FORM CONFIGURATION
// ============================================
form.configureSubmitButton({
label: 'Submit Parent Feedback',
isVisible: () => overallSection.ratingScale('overallSatisfaction')?.value() !== null
});
form.configureCompletionScreen({
type: 'text',
title: 'Thank You for Your Feedback!',
message: 'Your input helps us provide the best possible care for your child. We review all feedback carefully and use it to continually improve our programs.'
});
}