export function thesisDefenseFeedbackForm(form: FormTs) {
// Thesis Defense Evaluation Form - Academic Committee Assessment
// Demonstrates: Pages (multi-page), MatrixQuestion, StarRating, RatingScale, RadioButton, dynamic styling
// ============================================
// HEADER
// ============================================
form.addRow(row => {
row.addTextPanel('header', {
label: 'Thesis Defense Evaluation',
computedValue: () => 'Committee Member Assessment Form',
customStyles: {
backgroundColor: '#7c3aed',
color: 'white',
padding: '24px',
borderRadius: '12px',
textAlign: 'center'
}
});
});
// ============================================
// MULTI-PAGE WIZARD
// ============================================
const pages = form.addPages('defensePages', { heightMode: 'current-page' });
// ============================================
// PAGE 1: Defense Information
// ============================================
const page1 = pages.addPage('info');
const infoSection = page1.addSubform('info', {
title: 'Defense Information'
});
infoSection.addRow(row => {
row.addTextbox('studentName', {
label: 'Student Name',
placeholder: 'Full name of the candidate',
isRequired: true
}, '1fr');
row.addDatepicker('defenseDate', {
label: 'Defense Date',
isRequired: true
}, '1fr');
});
infoSection.addRow(row => {
row.addTextbox('thesisTitle', {
label: 'Thesis Title',
placeholder: 'Enter the full thesis title',
isRequired: true
});
});
infoSection.addRow(row => {
row.addDropdown('degreeLevel', {
label: 'Degree Level',
options: [
{ id: 'masters', name: "Master's Thesis" },
{ id: 'phd', name: 'Doctoral Dissertation' },
{ id: 'honors', name: 'Honors Thesis' },
{ id: 'capstone', name: 'Capstone Project' }
],
isRequired: true
}, '1fr');
row.addDropdown('committeeRole', {
label: 'Your Role on Committee',
options: [
{ id: 'chair', name: 'Committee Chair' },
{ id: 'advisor', name: 'Thesis Advisor' },
{ id: 'member', name: 'Committee Member' },
{ id: 'external', name: 'External Examiner' }
],
isRequired: true
}, '1fr');
});
// Navigation for page 1
page1.addRow(row => {
row.addButton('nextToPage2', {
label: 'Continue to Evaluation',
onClick: () => pages.goToPage('evaluation'),
isDisabled: () => {
return !infoSection.textbox('studentName')?.value() ||
!infoSection.datepicker('defenseDate')?.value() ||
!infoSection.textbox('thesisTitle')?.value();
}
});
});
// ============================================
// PAGE 2: Detailed Evaluation
// ============================================
const page2 = pages.addPage('evaluation');
const writtenSection = page2.addSubform('written', {
title: 'Written Thesis Quality'
});
writtenSection.addRow(row => {
row.addMatrixQuestion('thesisMatrix', {
label: 'Rate the following aspects of the written thesis:',
rows: [
{ id: 'research', label: 'Research Question & Significance', isRequired: true },
{ id: 'literature', label: 'Literature Review', isRequired: true },
{ id: 'methodology', label: 'Research Methodology', isRequired: true },
{ id: 'analysis', label: 'Data Analysis & Results', isRequired: true },
{ id: 'conclusions', label: 'Conclusions & Implications', isRequired: true },
{ id: 'writing', label: 'Writing Quality & Organization', isRequired: true }
],
columns: [
{ id: 'unsatisfactory', label: 'Unsatisfactory' },
{ id: 'needs-work', label: 'Needs Work' },
{ id: 'satisfactory', label: 'Satisfactory' },
{ id: 'good', label: 'Good' },
{ id: 'excellent', label: 'Excellent' }
],
fullWidth: true,
striped: true
});
});
const presentationSection = page2.addSubform('presentation', {
title: 'Oral Presentation'
});
presentationSection.addRow(row => {
row.addStarRating('presentationClarity', {
label: 'Clarity of presentation',
maxStars: 5,
size: 'lg',
showCounter: true,
alignment: 'center'
});
row.addStarRating('presentationOrganization', {
label: 'Organization & flow',
maxStars: 5,
size: 'lg',
showCounter: true,
alignment: 'center'
});
});
presentationSection.addRow(row => {
row.addStarRating('visualAids', {
label: 'Use of visual aids',
maxStars: 5,
size: 'lg',
showCounter: true,
alignment: 'center'
});
row.addStarRating('timeManagement', {
label: 'Time management',
maxStars: 5,
size: 'lg',
showCounter: true,
alignment: 'center'
});
});
presentationSection.addRow(row => {
row.addSlider('presentationDuration', {
label: 'Presentation duration (minutes)',
min: 10,
max: 90,
step: 5,
showValue: true,
unit: 'min',
defaultValue: 30
});
});
// Navigation for page 2
page2.addSpacer({ height: '24px' });
page2.addRow(row => {
row.addButton('backToPage1', {
label: 'Back',
onClick: () => pages.goToPage('info')
}, '1fr');
row.addButton('nextToPage3', {
label: 'Continue to Defense Q&A',
onClick: () => pages.goToPage('qa')
}, '1fr');
});
// ============================================
// PAGE 3: Defense Q&A
// ============================================
const page3 = pages.addPage('qa');
const qaSection = page3.addSubform('qa', {
title: 'Defense & Q&A Performance'
});
qaSection.addRow(row => {
row.addRatingScale('questionResponses', {
label: 'How well did the candidate respond to committee questions?',
preset: 'likert-5',
lowLabel: 'Poorly',
highLabel: 'Excellently',
size: 'md',
alignment: 'center'
});
});
qaSection.addRow(row => {
row.addMatrixQuestion('defenseMatrix', {
label: 'Rate the candidate\'s defense performance:',
rows: [
{ id: 'knowledge', label: 'Subject Matter Knowledge', isRequired: true },
{ id: 'critical', label: 'Critical Thinking', isRequired: true },
{ id: 'composure', label: 'Composure Under Questioning', isRequired: true },
{ id: 'articulation', label: 'Articulation of Ideas', isRequired: true }
],
columns: [
{ id: 'poor', label: 'Poor' },
{ id: 'fair', label: 'Fair' },
{ id: 'good', label: 'Good' },
{ id: 'excellent', label: 'Excellent' }
],
fullWidth: true,
striped: true
});
});
qaSection.addRow(row => {
row.addCheckboxList('strengths', {
label: 'Key strengths demonstrated during defense:',
options: [
{ id: 'depth', name: 'Deep understanding of subject' },
{ id: 'confident', name: 'Confident presentation' },
{ id: 'thoughtful', name: 'Thoughtful responses' },
{ id: 'synthesis', name: 'Ability to synthesize ideas' },
{ id: 'honest', name: 'Honest about limitations' },
{ id: 'passionate', name: 'Passionate about research' }
],
orientation: 'vertical'
});
});
// Navigation for page 3
page3.addSpacer({ height: '24px' });
page3.addRow(row => {
row.addButton('backToPage2', {
label: 'Back',
onClick: () => pages.goToPage('evaluation')
}, '1fr');
row.addButton('nextToPage4', {
label: 'Continue to Decision',
onClick: () => pages.goToPage('decision')
}, '1fr');
});
// ============================================
// PAGE 4: Final Decision
// ============================================
const page4 = pages.addPage('decision');
const decisionSection = page4.addSubform('decision', {
title: 'Committee Decision',
customStyles: () => {
const decision = decisionSection.radioButton('finalDecision')?.value();
if (decision === 'pass') return { backgroundColor: '#d1fae5', padding: '16px', borderRadius: '8px' };
if (decision === 'pass-revisions') return { backgroundColor: '#fef3c7', padding: '16px', borderRadius: '8px' };
if (decision === 'fail' || decision === 'defer') return { backgroundColor: '#fee2e2', padding: '16px', borderRadius: '8px' };
return { padding: '16px', borderRadius: '8px', border: '1px solid #e5e7eb' };
}
});
decisionSection.addRow(row => {
row.addRadioButton('finalDecision', {
label: 'Your recommendation for this defense:',
options: [
{ id: 'pass', name: 'Pass - Defense successful, thesis approved' },
{ id: 'pass-revisions', name: 'Pass with Minor Revisions - Approved pending specified changes' },
{ id: 'major-revisions', name: 'Major Revisions Required - Resubmit thesis' },
{ id: 'defer', name: 'Defer Decision - Requires further deliberation' },
{ id: 'fail', name: 'Fail - Defense unsuccessful' }
],
orientation: 'vertical',
isRequired: true
});
});
// Conditional revisions section
decisionSection.addSpacer({ height: '16px' });
decisionSection.addRow(row => {
row.addTextarea('revisionRequirements', {
label: 'Required revisions (be specific):',
placeholder: 'Describe the specific changes, additions, or corrections required...',
rows: 4,
isRequired: () => {
const decision = decisionSection.radioButton('finalDecision')?.value();
return decision === 'pass-revisions' || decision === 'major-revisions';
},
isVisible: () => {
const decision = decisionSection.radioButton('finalDecision')?.value();
return decision === 'pass-revisions' || decision === 'major-revisions';
}
});
});
decisionSection.addRow(row => {
row.addDropdown('revisionReviewer', {
label: 'Who should approve the revisions?',
options: [
{ id: 'advisor', name: 'Thesis Advisor only' },
{ id: 'chair', name: 'Committee Chair' },
{ id: 'committee', name: 'Full Committee' }
],
isVisible: () => {
const decision = decisionSection.radioButton('finalDecision')?.value();
return decision === 'pass-revisions' || decision === 'major-revisions';
}
}, '1fr');
row.addDropdown('revisionDeadline', {
label: 'Revision deadline',
options: [
{ id: '2-weeks', name: '2 weeks' },
{ id: '1-month', name: '1 month' },
{ id: '3-months', name: '3 months' },
{ id: '6-months', name: '6 months' }
],
isVisible: () => {
const decision = decisionSection.radioButton('finalDecision')?.value();
return decision === 'pass-revisions' || decision === 'major-revisions';
}
}, '1fr');
});
// Comments section
const commentsSection = page4.addSubform('comments', {
title: 'Additional Comments',
isVisible: () => decisionSection.radioButton('finalDecision')?.value() !== null
});
commentsSection.addRow(row => {
row.addTextarea('privateComments', {
label: 'Comments for committee records (confidential):',
placeholder: 'Notes for committee deliberation...',
rows: 3
});
});
commentsSection.addRow(row => {
row.addTextarea('studentFeedback', {
label: () => {
const decision = decisionSection.radioButton('finalDecision')?.value();
if (decision === 'pass') return 'Congratulatory comments for the student:';
if (decision === 'fail') return 'Constructive feedback for the student:';
return 'Feedback to share with the student:';
},
placeholder: 'Constructive feedback that can be shared with the candidate...',
rows: 3
});
});
// Summary
const summarySection = page4.addSubform('summary', {
title: 'Evaluation Summary',
isVisible: () => decisionSection.radioButton('finalDecision')?.value() !== null
});
summarySection.addRow(row => {
row.addTextPanel('summaryContent', {
computedValue: () => {
const studentName = infoSection.textbox('studentName')?.value() || 'Candidate';
const decision = decisionSection.radioButton('finalDecision')?.value();
const degreeLevel = infoSection.dropdown('degreeLevel')?.value();
const defenseDate = infoSection.datepicker('defenseDate')?.value();
const strengths = qaSection.checkboxList('strengths')?.value() || [];
if (!decision) return '';
const decisionLabels: Record<string, string> = {
'pass': 'PASS - Approved',
'pass-revisions': 'PASS WITH REVISIONS',
'major-revisions': 'MAJOR REVISIONS REQUIRED',
'defer': 'DECISION DEFERRED',
'fail': 'FAIL'
};
const decisionEmojis: Record<string, string> = {
'pass': '🎓',
'pass-revisions': '📝',
'major-revisions': '📋',
'defer': '⏳',
'fail': '❌'
};
let summary = '📋 Defense Evaluation Summary\n';
summary += '═'.repeat(32) + '\n\n';
summary += `👤 Candidate: ${studentName}\n`;
if (degreeLevel) summary += `🎓 Degree: ${degreeLevel.charAt(0).toUpperCase() + degreeLevel.slice(1)}\n`;
if (defenseDate) summary += `📅 Date: ${new Date(defenseDate).toLocaleDateString()}\n`;
summary += `\n${decisionEmojis[decision] || '📌'} Decision: ${decisionLabels[decision] || decision}\n`;
if (strengths.length > 0) {
summary += `\n✨ ${strengths.length} key strength(s) noted`;
}
return summary;
},
customStyles: () => {
const decision = decisionSection.radioButton('finalDecision')?.value();
const baseStyles = {
padding: '16px',
borderRadius: '8px',
whiteSpace: 'pre-wrap',
fontFamily: 'monospace',
fontSize: '14px'
};
if (decision === 'pass') return { ...baseStyles, backgroundColor: '#d1fae5', borderLeft: '4px solid #10b981' };
if (decision === 'pass-revisions') return { ...baseStyles, backgroundColor: '#fef3c7', borderLeft: '4px solid #f59e0b' };
if (decision === 'fail' || decision === 'defer' || decision === 'major-revisions') {
return { ...baseStyles, backgroundColor: '#fee2e2', borderLeft: '4px solid #ef4444' };
}
return { ...baseStyles, backgroundColor: '#f3f4f6', borderLeft: '4px solid #6b7280' };
}
});
});
// Navigation for page 4
page4.addSpacer({ height: '24px' });
page4.addRow(row => {
row.addButton('backToPage3', {
label: 'Back',
onClick: () => pages.goToPage('qa')
});
});
// ============================================
// FORM CONFIGURATION
// ============================================
form.configureSubmitButton({
label: 'Submit Evaluation',
isVisible: () => decisionSection.radioButton('finalDecision')?.value() !== null
});
form.configureCompletionScreen({
type: 'text',
title: 'Evaluation Submitted',
message: 'Thank you for completing this thesis defense evaluation. Your assessment will be compiled with other committee members\' evaluations for the final decision record.'
});
}