diff --git a/frontend/textbooks/geometry_8_ch1.html b/frontend/textbooks/geometry_8_ch1.html index f5b1e23..a86be4a 100644 --- a/frontend/textbooks/geometry_8_ch1.html +++ b/frontend/textbooks/geometry_8_ch1.html @@ -592,7 +592,7 @@ function renderMath(root){ try{ renderMathInElement(root, {delimiters:[{left:'$$',right:'$$',display:true},{left:'$',right:'$',display:false},{left:'\\[',right:'\\]',display:true},{left:'\\(',right:'\\)',display:false}],throwOnError:false}); }catch(e){} } } -function feedback(elm, ok, text){ elm.className = 'feedback ' + (ok ? 'ok' : 'fail'); elm.innerHTML = text || (ok ? '✓ Верно!' : '✗ Неверно'); } +function feedback(elm, ok, text){ if(!elm)return; elm.className = 'feedback ' + (ok ? 'ok' : 'fail'); elm.innerHTML = text || (ok ? '✓ Верно!' : '✗ Неверно'); elm.style.display='block'; } function fmt(n){ if(!isFinite(n)) return '?'; if(Number.isInteger(n)) return String(n); return Math.abs(n - Math.round(n)) < 1e-9 ? String(Math.round(n)) : (+n.toFixed(4)).toString(); } const ICONS = { diff --git a/frontend/textbooks/geometry_8_ch2.html b/frontend/textbooks/geometry_8_ch2.html index 2bd9393..16f1be5 100644 --- a/frontend/textbooks/geometry_8_ch2.html +++ b/frontend/textbooks/geometry_8_ch2.html @@ -442,7 +442,7 @@ function buildSidebar(id){ function initTheme(){ const t=localStorage.getItem('geometry8_ch2_theme')||'light'; if(t==='dark') document.documentElement.classList.add('dark'); document.getElementById('theme-lab').textContent=t==='dark'?'Светлая':'Тёмная'; document.getElementById('theme-btn').addEventListener('click',()=>{ document.documentElement.classList.toggle('dark'); const dark=document.documentElement.classList.contains('dark'); localStorage.setItem('geometry8_ch2_theme',dark?'dark':'light'); document.getElementById('theme-lab').textContent=dark?'Светлая':'Тёмная'; }); } function renderMath(root){ if(window.renderMathInElement){ try{renderMathInElement(root,{delimiters:[{left:'$$',right:'$$',display:true},{left:'$',right:'$',display:false},{left:'\\[',right:'\\]',display:true},{left:'\\(',right:'\\)',display:false}],throwOnError:false});}catch(e){} } } -function feedback(elm,ok,text){ elm.className='feedback '+(ok?'ok':'fail');elm.innerHTML=text||(ok?'✓ Верно!':'✗ Неверно'); } +function feedback(elm,ok,text){ if(!elm)return; elm.className='feedback '+(ok?'ok':'fail');elm.innerHTML=text||(ok?'✓ Верно!':'✗ Неверно'); elm.style.display='block'; } function fmt(n){ if(!isFinite(n))return '?';if(Number.isInteger(n))return String(n);return Math.abs(n-Math.round(n))<1e-9?String(Math.round(n)):(+n.toFixed(4)).toString(); } const ICONS={repeat:'',theory:'',algo:'',rule:'',example:'',oral:'',class:'',home:''}; function makeCard(kind,title,num,body){ const labels={repeat:'Повторение',theory:'Теория',algo:'Алгоритм',rule:'Правило',example:'Пример',oral:'Устно',class:'Класс',home:'Домашка'}; return `
${ICONS[kind]}
${labels[kind]||''}${title&&title!==labels[kind]?' \xb7 '+title:''}
${num?`
${num}
`:''}
${body}
`; } diff --git a/frontend/textbooks/geometry_8_ch3.html b/frontend/textbooks/geometry_8_ch3.html index c1e3d35..efa6160 100644 --- a/frontend/textbooks/geometry_8_ch3.html +++ b/frontend/textbooks/geometry_8_ch3.html @@ -372,7 +372,7 @@ function buildSidebar(id){const box=document.getElementById('sidebar-content');c function initTheme(){const t=localStorage.getItem('geometry8_ch3_theme')||'light';if(t==='dark')document.documentElement.classList.add('dark');document.getElementById('theme-lab').textContent=t==='dark'?'Светлая':'Тёмная';document.getElementById('theme-btn').addEventListener('click',()=>{document.documentElement.classList.toggle('dark');const dark=document.documentElement.classList.contains('dark');localStorage.setItem('geometry8_ch3_theme',dark?'dark':'light');document.getElementById('theme-lab').textContent=dark?'Светлая':'Тёмная';});} function renderMath(root){if(window.renderMathInElement){try{renderMathInElement(root,{delimiters:[{left:'$$',right:'$$',display:true},{left:'$',right:'$',display:false},{left:'\\[',right:'\\]',display:true},{left:'\\(',right:'\\)',display:false}],throwOnError:false});}catch(e){}}} -function feedback(elm,ok,text){elm.className='feedback '+(ok?'ok':'fail');elm.innerHTML=text||(ok?'✓ Верно!':'✗ Неверно');} +function feedback(elm,ok,text){if(!elm)return;elm.className='feedback '+(ok?'ok':'fail');elm.innerHTML=text||(ok?'✓ Верно!':'✗ Неверно');elm.style.display='block';} function fmt(n){if(!isFinite(n))return '?';if(Number.isInteger(n))return String(n);return Math.abs(n-Math.round(n))<1e-9?String(Math.round(n)):(+n.toFixed(4)).toString();} const ICONS={repeat:'',theory:'',algo:'',rule:'',example:'',oral:'',class:'',home:''}; function makeCard(kind,title,num,body){const labels={repeat:'Повторение',theory:'Теория',algo:'Алгоритм',rule:'Правило',example:'Пример',oral:'Устно',class:'Класс',home:'Домашка'};return `
${ICONS[kind]}
${labels[kind]||''}${title&&title!==labels[kind]?' \xb7 '+title:''}
${num?`
${num}
`:''}
${body}
`;}