Frayer Model Generator
Define key characteristics, examples, and non-examples to fully understand a concept.
The visual Frayer Model is generated below. It is divided into four quadrants for comprehensive definition.
Define Model Components
1. Central Concept
2. Definition (Q1)
3. Key Characteristics (Q2)
4. Examples (Q3)
5. Non-Examples (Q4)
${fmg_escapeHTML(text)}
`; }; /** * Switches the active tab */ function fmg_switchTab(tabIndex) { if (fmg_currentTab === 1) { fmg_updateDataFromConfig(); } fmg_currentTab = tabIndex; fmg_tabPanes.forEach((pane, index) => { pane.classList.toggle('hidden', index !== tabIndex); pane.classList.toggle('fmg-active', index === tabIndex); }); fmg_tabLinks.forEach((link, index) => { TAB_CLASSES.active.forEach(cls => link.classList.remove(cls)); TAB_CLASSES.inactive.forEach(cls => link.classList.remove(cls)); if (index === tabIndex) { TAB_CLASSES.active.forEach(cls => link.classList.add(cls)); } else { TAB_CLASSES.inactive.forEach(cls => link.classList.add(cls)); } }); if (fmg_prevButton) fmg_prevButton.disabled = (tabIndex === 0); if (fmg_nextButton) fmg_nextButton.disabled = false; if(tabIndex === 0) { fmg_renderDashboard(); } else if (tabIndex === 1) { fmg_renderConfig(); } } // --- CONFIG TAB FUNCTIONS --- function fmg_renderConfig() { if (!fmg_inputConcept) return; fmg_inputConcept.value = fmg_data.concept; fmg_inputQ1.value = fmg_data.q1; fmg_inputQ2.value = fmg_data.q2; fmg_inputQ3.value = fmg_data.q3; fmg_inputQ4.value = fmg_data.q4; } function fmg_updateDataFromConfig() { if (!fmg_inputConcept) return; fmg_data.concept = fmg_inputConcept.value.trim(); fmg_data.q1 = fmg_inputQ1.value.trim(); fmg_data.q2 = fmg_inputQ2.value.trim(); fmg_data.q3 = fmg_inputQ3.value.trim(); fmg_data.q4 = fmg_inputQ4.value.trim(); } // --- DASHBOARD (MODEL GENERATION) FUNCTIONS --- function fmg_generateModelHTML(data) { // Generate the four quadrants const quadrants = [ { id: 1, title: 'Definition', content: fmg_formatContent(data.q1, 'none') }, { id: 2, title: 'Key Characteristics', content: fmg_formatContent(data.q2, 'disc') }, { id: 3, title: 'Examples', content: fmg_formatContent(data.q3, 'disc') }, { id: 4, title: 'Non-Examples', content: fmg_formatContent(data.q4, 'disc') } ]; let html = ''; quadrants.forEach(q => { html += `${q.title}
${q.content}
${conceptTitle}
`;
return html;
}
function fmg_renderDashboard(targetDiv = fmg_modelGrid, isPDF = false) {
if (!targetDiv) return;
targetDiv.innerHTML = fmg_generateModelHTML(fmg_data);
}
// --- PDF Generation and Management ---
function fmg_renderPdfClone() {
const modelHTML = fmg_generateModelHTML(fmg_data);
fmg_pdfRenderClone.innerHTML = `
Frayer Model: ${fmg_escapeHTML(fmg_data.concept)}
Generated: ${new Date().toLocaleDateString('en-US')}
${modelHTML}
