From 717ad3d0f51a6070cbab0ca4726f6ccdcc8dda11 Mon Sep 17 00:00:00 2001 From: Maxim Dolgolyov Date: Fri, 29 May 2026 14:29:09 +0300 Subject: [PATCH] =?UTF-8?q?feat(geom11=20ch2=20final):=20=D0=A4=D0=B8?= =?UTF-8?q?=D0=BD=D0=B0=D0=BB=20=D0=A0=D0=B0=D0=B7=D0=B4=D0=B5=D0=BB=D0=B0?= =?UTF-8?q?=202=20(5=20=D0=B1=D0=BE=D1=81=D1=81=D0=BE=D0=B2=20+=20=D0=B0?= =?UTF-8?q?=D1=87=D0=B8=D0=B2=D0=BA=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/textbooks/geometry_11_ch2.html | 213 +++++++++++++++++++++++- 1 file changed, 211 insertions(+), 2 deletions(-) diff --git a/frontend/textbooks/geometry_11_ch2.html b/frontend/textbooks/geometry_11_ch2.html index c69c71d..20a6427 100644 --- a/frontend/textbooks/geometry_11_ch2.html +++ b/frontend/textbooks/geometry_11_ch2.html @@ -306,7 +306,8 @@ const ACH_LABELS = { p3_done:"Пирамида освоено!", p4_done:"Конус освоено!", start:"Начало раздела 2!", - ch2_done:"Раздел 2 пройден!" + ch2_done:"Раздел 2 пройден!", + r2_done:"Мастер пирамиды и конуса" }; function loadProgress(){ @@ -392,7 +393,7 @@ function buildParaSelector(){ } const BUILT=new Set(); -const BUILDERS = { p3:buildP3, p4:buildP4, final2:()=>buildStub('final2') }; +const BUILDERS = { p3:buildP3, p4:buildP4, final2:buildFinal2 }; function ensureBuilt(id){ if(BUILT.has(id)) return; const fn=BUILDERS[id]; if(fn){ fn(); BUILT.add(id); } } function goTo(id){ STATE.current=id; ensureBuilt(id); @@ -1392,6 +1393,214 @@ function buildP4(){ wireReadBtn('p4'); } +/* ===== Финал Раздела 2 «Пирамида и конус» ===== */ + +function buildFinal2(){ + const box = document.getElementById('final2-body'); + if(!box) return; + let html = ''; + + /* Часть А — Шпаргалка раздела 2 (2 mini-карточки по числу § в разделе) */ + html += '
' + + '
' + + '
' + ICONS.theory + '
' + + '
Шпаргалка раздела 2
' + + '
Итог
' + + '
' + + '
' + + '

Ключевые формулы обоих параграфов раздела в одном месте — пробеги глазами перед битвой с боссами.

' + + '
' + + '
' + + '
' + + '' + + '
§ 3 · Пирамида
' + + '
' + + '
$V=\\tfrac{1}{3}S_{осн}\\cdot h$ (любая). Правильная: $S_{бок}=\\tfrac{1}{2}P_{осн}\\cdot l$ ($l$ — апофема). Связи: $b^2=R^2+h^2$, $l^2=r^2+h^2$. Усечённая: $V=\\tfrac{1}{3}h(S_1+S_2+\\sqrt{S_1 S_2})$.
' + + '
' + + '
' + + '
' + + '' + + '
§ 4 · Конус
' + + '
' + + '
$V=\\tfrac{1}{3}\\pi R^2 h$, $S_{бок}=\\pi R l$, $S_{полн}=\\pi R(R+l)$. $l^2=R^2+h^2$. Развёртка — сектор радиуса $l$ с углом $\\varphi=\\tfrac{360°\\,R}{l}$. Усечённый: $V=\\tfrac{1}{3}\\pi h(R_1^2+R_2^2+R_1 R_2)$.
' + + '
' + + '
' + + '
' + + '
'; + + /* Часть Б — анонс 5 боссов */ + html += '
' + + '
' + + '
' + ICONS.rule + '
' + + '
Боссы раздела 2
' + + '
5
' + + '
' + + '
' + + '

5 интегрированных задач — каждая комбинирует темы § 3 и § 4. За каждого побеждённого босса: +10 XP, +18% к прогрессу. Победишь всех — ачивка «Мастер пирамиды и конуса» и +50 XP бонус.

' + + '

Для расчётов с $\\pi$ используй $\\pi\\approx 3{,}14$. Допуск ответа — $\\pm 0{,}05$ (для больших чисел — $\\pm 0{,}1$).

' + + '
' + + '
'; + + html += '
'; + + /* Прогресс-итог + ачивка */ + html += '
' + + '
Прогресс по боссам
' + + '
0 / 5 боссов побеждено
' + + '
' + + '
' + + '
' + + '' + + '
'; + + html += secNav('p4', null); + + box.innerHTML = html; + renderMath(box); + + /* === Боссы === */ + const BOSSES = [ + { + n:1, color:'#059669', + title:'Циклоп Пирамиды', + tag:'§ 3', + q:'Правильная 4-угольная пирамида: сторона основания $a=6$, высота $h=4$. Найдите объём $V$.', + ans:48, tol:0.05, + hint:'$S_{осн}=a^2=36$, $V=\\tfrac{1}{3}\\cdot S_{осн}\\cdot h=\\tfrac{1}{3}\\cdot 36\\cdot 4=48$.' + }, + { + n:2, color:'#dc2626', + title:'Минотавр Конуса', + tag:'§ 4', + q:'Конус с $R=5$, $h=12$. Найдите образующую $l$.', + ans:13, tol:0.05, + hint:'$l=\\sqrt{R^2+h^2}=\\sqrt{25+144}=\\sqrt{169}=13$.' + }, + { + n:3, color:'#7c3aed', + title:'Гарпия Развёртки', + tag:'§ 4', + q:'Конус с $R=4$, $l=8$. Найдите угол развёртки боковой поверхности (в градусах).', + ans:180, tol:0.1, + hint:'$\\varphi=\\dfrac{360°\\cdot R}{l}=\\dfrac{360\\cdot 4}{8}=180°$.' + }, + { + n:4, color:'#0891b2', + title:'Дракон Усечённой', + tag:'§ 3 + § 4', + q:'Усечённый конус: $R_1=5$, $R_2=2$, $h=4$. Найдите образующую $l$.', + ans:5, tol:0.05, + hint:'$l=\\sqrt{h^2+(R_1-R_2)^2}=\\sqrt{16+9}=\\sqrt{25}=5$.' + }, + { + n:5, color:'#f59e0b', + title:'Мастер Тел Вращения', + tag:'синтез § 3 + § 4', + q:'В правильной 4-угольной пирамиде сторона основания $a=6$, высота $h=4$. Найдите длину апофемы $l$.', + ans:5, tol:0.05, + hint:'Радиус вписанной окружности квадрата: $r=a/2=3$. Апофема: $l=\\sqrt{r^2+h^2}=\\sqrt{9+16}=5$.' + } + ]; + + const cont = document.getElementById('r2-bosses-container'); + const STATE_KEY = 'geometry11_ch2_bosses'; + const BOSS_STATE = (function(){ + try{ const s = localStorage.getItem(STATE_KEY); if(s){ const p = JSON.parse(s); if(Array.isArray(p) && p.length === BOSSES.length) return p; } }catch(e){} + return BOSSES.map(()=>({defeated:false})); + })(); + function saveBosses(){ try{ localStorage.setItem(STATE_KEY, JSON.stringify(BOSS_STATE)); }catch(e){} } + + cont.innerHTML = BOSSES.map(b=>{ + return '
' + + '
' + + '' + + '
Босс '+b.n+': '+b.title+'
' + + '
'+b.tag+'
' + + '
' + + '
'+b.q+'
' + + '
' + + 'ответ =' + + '' + + '' + + '' + + '
' + + '' + + '
'; + }).join(''); + renderMath(cont); + + function refreshOverall(){ + const won = BOSS_STATE.filter(s => s.defeated).length; + const txt = document.getElementById('r2-boss-overall'); + const fill = document.getElementById('r2-boss-overall-fill'); + if(txt) txt.textContent = won + ' / ' + BOSSES.length + ' боссов побеждено'; + if(fill) fill.style.width = (won * 100 / BOSSES.length) + '%'; + if(won >= BOSSES.length){ + const reward = document.getElementById('r2-final-reward'); + if(reward && reward.style.display === 'none'){ + reward.style.display = 'block'; + if(!STATE.achievements.has('r2_done')){ + achievement('r2_done','Мастер пирамиды и конуса'); + addXp(50, 'r2-bonus'); + bumpProgress('final2', 30); + if(window.confetti){ try{ confetti(); }catch(e){} } + } + } + } + } + + BOSSES.forEach((b, idx)=>{ + const card = document.getElementById('boss2-'+b.n+'-card'); + const goBtn = document.getElementById('boss2-'+b.n+'-go'); + const hintBtn= document.getElementById('boss2-'+b.n+'-hint'); + const ansInp = document.getElementById('boss2-'+b.n+'-ans'); + if(BOSS_STATE[idx].defeated){ + card.style.background = 'linear-gradient(135deg,var(--sec-acc-soft),var(--pri-soft))'; + card.classList.add('glow'); + goBtn.disabled = true; goBtn.style.opacity = .55; goBtn.innerHTML = '✓ Повержен'; + ansInp.disabled = true; + } + goBtn.addEventListener('click', ()=>{ + if(BOSS_STATE[idx].defeated) return; + const fb = document.getElementById('boss2-'+b.n+'-fb'); + const raw = (ansInp.value||'').replace(',', '.').trim(); + const val = parseFloat(raw); + if(!isFinite(val)){ feedback(fb, false, '✗ Введи число.'); return; } + if(Math.abs(val - b.ans) <= b.tol){ + BOSS_STATE[idx].defeated = true; saveBosses(); + feedback(fb, true, '✓ Босс '+b.n+' повержен! +10 XP. '+b.hint); + addXp(10, 'boss-r2-'+b.n); + bumpProgress('final2', 18); + goBtn.disabled = true; goBtn.style.opacity = .55; goBtn.innerHTML = '✓ Повержен'; + ansInp.disabled = true; + card.style.background = 'linear-gradient(135deg,var(--sec-acc-soft),var(--pri-soft))'; + card.classList.add('glow','pulse'); + setTimeout(()=>card.classList.remove('pulse'), 900); + refreshOverall(); + } else { + feedback(fb, false, '✗ Промах. Попробуй ещё. Подсказка доступна.'); + } + }); + hintBtn.addEventListener('click', ()=>{ + const fb = document.getElementById('boss2-'+b.n+'-fb'); + fb.className = 'feedback ok'; + fb.innerHTML = 'Подсказка: '+b.hint; + fb.style.display = 'block'; + fb.style.background = 'var(--warn-bg,#fef3c7)'; + fb.style.color = '#92400e'; + fb.style.borderLeftColor = 'var(--warn,#f59e0b)'; + try{ renderMath(fb); }catch(e){} + }); + ansInp.addEventListener('keydown', e=>{ if(e.key === 'Enter') goBtn.click(); }); + }); + + refreshOverall(); +} + /* ===== STUB BUILDER — единый для всех параграфов раздела (Phase 0) ===== */ function buildStub(id){