YEON PLANNING · 직관수학 (초4)
삼각형 — 4단계 문제은행
영상으로 배우고 → 직접 풀고 → 답 제출 → 해설. 변으로 나누면 정·이등변, 각으로 나누면 예각·직각·둔각 — 세 각의 합은 늘 180°.
✍️ 연플래닝 오리지널 — 「아하! 보이는 직관수학」 자체 제작. 모든 문제·정답 손검산 완료. 답안을 제출해야 해설·정답이 열립니다(먼저 스스로 풀어 보세요).
💬 더 필요한 게 있나요?
난이도 조절(더 쉽게 / 더 어렵게) · 다른 유형 · 특정 개념 집중 · 문항 수 등 무엇이든 적어 주세요. 선생님이 확인합니다. (공개 아님)
`; return s;
}
// ── 삼각형 그리기 (변·각 분류용, 좌표 계산) ──
function tri(cfg){
const {kind='정', W=230, H=200, note='', label=''} = cfg;
let P;
if(kind==='정') P=[[115,32],[45,155],[185,155]]; // 정삼각형
else if(kind==='이등변') P=[[115,30],[55,158],[175,158]];
else if(kind==='직각') P=[[50,155],[50,45],[180,155]];
else if(kind==='둔각') P=[[30,150],[205,150],[100,105]]; // 꼭지각 ~124° — 직각과 확실히 구분되게
else P=[[40,152],[195,152],[145,60]]; // 예각(부등변)
let s=``; return s;
}
const P=[
{ tier:'기초', type:'self', kind:'choice',
q:'세 변의 길이가 모두 같은 삼각형을(를) 무엇이라고 할까요?',
fig:tri({kind:'정',note:'이 삼각형의 이름은?'}),
choices:['정삼각형','이등변삼각형','직각삼각형','둔각삼각형'], answer:'정삼각형',
hint:'삼각형은 변의 길이나 각의 크기로 이름을 붙여요.',
sol:{ ans:'정삼각형', fig:tri({kind:'정',label:'정삼각형'}),
steps:['삼각형 이름은 변 또는 각의 특징에서 나와요.','세 변의 길이가 모두 같은 삼각형 → 정삼각형.','변으로: 정삼각형·이등변삼각형 / 각으로: 예각·직각·둔각삼각형']}},
{ tier:'기초', type:'self', kind:'choice',
q:'두 변의 길이가 같은 삼각형을(를) 무엇이라고 할까요?',
fig:tri({kind:'이등변',note:'이 삼각형의 이름은?'}),
choices:['정삼각형','이등변삼각형','직각삼각형','둔각삼각형'], answer:'이등변삼각형',
hint:'삼각형은 변의 길이나 각의 크기로 이름을 붙여요.',
sol:{ ans:'이등변삼각형', fig:tri({kind:'이등변',label:'이등변삼각형'}),
steps:['삼각형 이름은 변 또는 각의 특징에서 나와요.','두 변의 길이가 같은 삼각형 → 이등변삼각형.','변으로: 정삼각형·이등변삼각형 / 각으로: 예각·직각·둔각삼각형']}},
{ tier:'기초', type:'self', kind:'choice',
q:'한 각이 직각(90°)인 삼각형을(를) 무엇이라고 할까요?',
fig:tri({kind:'직각',note:'이 삼각형의 이름은?'}),
choices:['정삼각형','이등변삼각형','직각삼각형','둔각삼각형'], answer:'직각삼각형',
hint:'삼각형은 변의 길이나 각의 크기로 이름을 붙여요.',
sol:{ ans:'직각삼각형', fig:tri({kind:'직각',label:'직각삼각형'}),
steps:['삼각형 이름은 변 또는 각의 특징에서 나와요.','한 각이 직각(90°)인 삼각형 → 직각삼각형.','변으로: 정삼각형·이등변삼각형 / 각으로: 예각·직각·둔각삼각형']}},
{ tier:'기초', type:'self', kind:'choice',
q:'한 각이 둔각인 삼각형을(를) 무엇이라고 할까요?',
fig:tri({kind:'둔각',note:'이 삼각형의 이름은?'}),
choices:['정삼각형','이등변삼각형','직각삼각형','둔각삼각형'], answer:'둔각삼각형',
hint:'삼각형은 변의 길이나 각의 크기로 이름을 붙여요.',
sol:{ ans:'둔각삼각형', fig:tri({kind:'둔각',label:'둔각삼각형'}),
steps:['삼각형 이름은 변 또는 각의 특징에서 나와요.','한 각이 둔각인 삼각형 → 둔각삼각형.','변으로: 정삼각형·이등변삼각형 / 각으로: 예각·직각·둔각삼각형']}},
{ tier:'기초', type:'self', kind:'choice',
q:'세 각이 모두 예각인 삼각형을(를) 무엇이라고 할까요?',
fig:tri({kind:'예각',note:'이 삼각형의 이름은?'}),
choices:['예각삼각형','직각삼각형','둔각삼각형','정삼각형'], answer:'예각삼각형',
hint:'삼각형은 변의 길이나 각의 크기로 이름을 붙여요.',
sol:{ ans:'예각삼각형', fig:tri({kind:'예각',label:'예각삼각형'}),
steps:['삼각형 이름은 변 또는 각의 특징에서 나와요.','세 각이 모두 예각인 삼각형 → 예각삼각형.','변으로: 정삼각형·이등변삼각형 / 각으로: 예각·직각·둔각삼각형']}},
{ tier:'기초', type:'self', kind:'choice',
q:'세 변의 길이가 모두 같은 삼각형을(를) 무엇이라고 할까요?',
fig:tri({kind:'정',note:'이 삼각형의 이름은?'}),
choices:['정삼각형','이등변삼각형','직각삼각형','둔각삼각형'], answer:'정삼각형',
hint:'삼각형은 변의 길이나 각의 크기로 이름을 붙여요.',
sol:{ ans:'정삼각형', fig:tri({kind:'정',label:'정삼각형'}),
steps:['삼각형 이름은 변 또는 각의 특징에서 나와요.','세 변의 길이가 모두 같은 삼각형 → 정삼각형.','변으로: 정삼각형·이등변삼각형 / 각으로: 예각·직각·둔각삼각형']}},
{ tier:'기초', type:'self', kind:'choice',
q:'두 변의 길이가 같은 삼각형을(를) 무엇이라고 할까요?',
fig:tri({kind:'이등변',note:'이 삼각형의 이름은?'}),
choices:['정삼각형','이등변삼각형','직각삼각형','둔각삼각형'], answer:'이등변삼각형',
hint:'삼각형은 변의 길이나 각의 크기로 이름을 붙여요.',
sol:{ ans:'이등변삼각형', fig:tri({kind:'이등변',label:'이등변삼각형'}),
steps:['삼각형 이름은 변 또는 각의 특징에서 나와요.','두 변의 길이가 같은 삼각형 → 이등변삼각형.','변으로: 정삼각형·이등변삼각형 / 각으로: 예각·직각·둔각삼각형']}},
{ tier:'기초', type:'self', kind:'choice',
q:'한 각이 직각(90°)인 삼각형을(를) 무엇이라고 할까요?',
fig:tri({kind:'직각',note:'이 삼각형의 이름은?'}),
choices:['정삼각형','이등변삼각형','직각삼각형','둔각삼각형'], answer:'직각삼각형',
hint:'삼각형은 변의 길이나 각의 크기로 이름을 붙여요.',
sol:{ ans:'직각삼각형', fig:tri({kind:'직각',label:'직각삼각형'}),
steps:['삼각형 이름은 변 또는 각의 특징에서 나와요.','한 각이 직각(90°)인 삼각형 → 직각삼각형.','변으로: 정삼각형·이등변삼각형 / 각으로: 예각·직각·둔각삼각형']}},
{ tier:'기초', type:'self', kind:'choice',
q:'한 각이 둔각인 삼각형을(를) 무엇이라고 할까요?',
fig:tri({kind:'둔각',note:'이 삼각형의 이름은?'}),
choices:['정삼각형','이등변삼각형','직각삼각형','둔각삼각형'], answer:'둔각삼각형',
hint:'삼각형은 변의 길이나 각의 크기로 이름을 붙여요.',
sol:{ ans:'둔각삼각형', fig:tri({kind:'둔각',label:'둔각삼각형'}),
steps:['삼각형 이름은 변 또는 각의 특징에서 나와요.','한 각이 둔각인 삼각형 → 둔각삼각형.','변으로: 정삼각형·이등변삼각형 / 각으로: 예각·직각·둔각삼각형']}},
{ tier:'기초', type:'self', kind:'choice',
q:'세 각이 모두 예각인 삼각형을(를) 무엇이라고 할까요?',
fig:tri({kind:'예각',note:'이 삼각형의 이름은?'}),
choices:['예각삼각형','직각삼각형','둔각삼각형','정삼각형'], answer:'예각삼각형',
hint:'삼각형은 변의 길이나 각의 크기로 이름을 붙여요.',
sol:{ ans:'예각삼각형', fig:tri({kind:'예각',label:'예각삼각형'}),
steps:['삼각형 이름은 변 또는 각의 특징에서 나와요.','세 각이 모두 예각인 삼각형 → 예각삼각형.','변으로: 정삼각형·이등변삼각형 / 각으로: 예각·직각·둔각삼각형']}},
{ tier:'중급', type:'self', kind:'choice',
q:'세 각이 60°, 60°, 60° 인 삼각형은 무엇일까요?',
fig:null,
choices:['예각삼각형','직각삼각형','둔각삼각형','정삼각형'], answer:'예각삼각형',
hint:'가장 큰 각을 보세요! 90°면 직각, 90°보다 크면 둔각, 셋 다 90°보다 작으면 예각.',
sol:{ ans:'예각삼각형', fig:null,
steps:['세 각의 합: 60 + 60 + 60 = 180° ✓ (삼각형은 항상 180°)','가장 큰 각은 60°.','그래서 예각삼각형.']}},
{ tier:'중급', type:'self', kind:'choice',
q:'세 각이 50°, 50°, 80° 인 삼각형은 무엇일까요?',
fig:null,
choices:['예각삼각형','직각삼각형','둔각삼각형','정삼각형'], answer:'예각삼각형',
hint:'가장 큰 각을 보세요! 90°면 직각, 90°보다 크면 둔각, 셋 다 90°보다 작으면 예각.',
sol:{ ans:'예각삼각형', fig:null,
steps:['세 각의 합: 50 + 50 + 80 = 180° ✓ (삼각형은 항상 180°)','가장 큰 각은 80°.','그래서 예각삼각형.']}},
{ tier:'중급', type:'self', kind:'choice',
q:'세 각이 90°, 45°, 45° 인 삼각형은 무엇일까요?',
fig:null,
choices:['예각삼각형','직각삼각형','둔각삼각형','정삼각형'], answer:'직각삼각형',
hint:'가장 큰 각을 보세요! 90°면 직각, 90°보다 크면 둔각, 셋 다 90°보다 작으면 예각.',
sol:{ ans:'직각삼각형', fig:null,
steps:['세 각의 합: 90 + 45 + 45 = 180° ✓ (삼각형은 항상 180°)','가장 큰 각은 90°.','그래서 직각삼각형.']}},
{ tier:'중급', type:'self', kind:'choice',
q:'세 각이 120°, 30°, 30° 인 삼각형은 무엇일까요?',
fig:null,
choices:['예각삼각형','직각삼각형','둔각삼각형','정삼각형'], answer:'둔각삼각형',
hint:'가장 큰 각을 보세요! 90°면 직각, 90°보다 크면 둔각, 셋 다 90°보다 작으면 예각.',
sol:{ ans:'둔각삼각형', fig:null,
steps:['세 각의 합: 120 + 30 + 30 = 180° ✓ (삼각형은 항상 180°)','가장 큰 각은 120°.','그래서 둔각삼각형.']}},
{ tier:'중급', type:'self', kind:'choice',
q:'세 각이 70°, 60°, 50° 인 삼각형은 무엇일까요?',
fig:null,
choices:['예각삼각형','직각삼각형','둔각삼각형','정삼각형'], answer:'예각삼각형',
hint:'가장 큰 각을 보세요! 90°면 직각, 90°보다 크면 둔각, 셋 다 90°보다 작으면 예각.',
sol:{ ans:'예각삼각형', fig:null,
steps:['세 각의 합: 70 + 60 + 50 = 180° ✓ (삼각형은 항상 180°)','가장 큰 각은 70°.','그래서 예각삼각형.']}},
{ tier:'중급', type:'self', kind:'choice',
q:'세 각이 90°, 30°, 60° 인 삼각형은 무엇일까요?',
fig:null,
choices:['예각삼각형','직각삼각형','둔각삼각형','정삼각형'], answer:'직각삼각형',
hint:'가장 큰 각을 보세요! 90°면 직각, 90°보다 크면 둔각, 셋 다 90°보다 작으면 예각.',
sol:{ ans:'직각삼각형', fig:null,
steps:['세 각의 합: 90 + 30 + 60 = 180° ✓ (삼각형은 항상 180°)','가장 큰 각은 90°.','그래서 직각삼각형.']}},
{ tier:'중급', type:'self', kind:'choice',
q:'세 각이 100°, 40°, 40° 인 삼각형은 무엇일까요?',
fig:null,
choices:['예각삼각형','직각삼각형','둔각삼각형','정삼각형'], answer:'둔각삼각형',
hint:'가장 큰 각을 보세요! 90°면 직각, 90°보다 크면 둔각, 셋 다 90°보다 작으면 예각.',
sol:{ ans:'둔각삼각형', fig:null,
steps:['세 각의 합: 100 + 40 + 40 = 180° ✓ (삼각형은 항상 180°)','가장 큰 각은 100°.','그래서 둔각삼각형.']}},
{ tier:'중급', type:'self', kind:'choice',
q:'세 각이 80°, 60°, 40° 인 삼각형은 무엇일까요?',
fig:null,
choices:['예각삼각형','직각삼각형','둔각삼각형','정삼각형'], answer:'예각삼각형',
hint:'가장 큰 각을 보세요! 90°면 직각, 90°보다 크면 둔각, 셋 다 90°보다 작으면 예각.',
sol:{ ans:'예각삼각형', fig:null,
steps:['세 각의 합: 80 + 60 + 40 = 180° ✓ (삼각형은 항상 180°)','가장 큰 각은 80°.','그래서 예각삼각형.']}},
{ tier:'중급', type:'self', kind:'choice',
q:'세 각이 45°, 45°, 90° 인 삼각형은 무엇일까요?',
fig:null,
choices:['예각삼각형','직각삼각형','둔각삼각형','정삼각형'], answer:'직각삼각형',
hint:'가장 큰 각을 보세요! 90°면 직각, 90°보다 크면 둔각, 셋 다 90°보다 작으면 예각.',
sol:{ ans:'직각삼각형', fig:null,
steps:['세 각의 합: 45 + 45 + 90 = 180° ✓ (삼각형은 항상 180°)','가장 큰 각은 90°.','그래서 직각삼각형.']}},
{ tier:'중급', type:'self', kind:'choice',
q:'세 각이 110°, 35°, 35° 인 삼각형은 무엇일까요?',
fig:null,
choices:['예각삼각형','직각삼각형','둔각삼각형','정삼각형'], answer:'둔각삼각형',
hint:'가장 큰 각을 보세요! 90°면 직각, 90°보다 크면 둔각, 셋 다 90°보다 작으면 예각.',
sol:{ ans:'둔각삼각형', fig:null,
steps:['세 각의 합: 110 + 35 + 35 = 180° ✓ (삼각형은 항상 180°)','가장 큰 각은 110°.','그래서 둔각삼각형.']}},
{ tier:'상위', type:'self', kind:'num',
q:'삼각형의 두 각이 60°, 70° 일 때 나머지 한 각은 몇 도일까요?',
fig:null,
answer:50,
hint:'삼각형 세 각의 합은 항상 180°예요!',
sol:{ ans:'50°', fig:null,
steps:['삼각형 세 각의 합 = 180°.','180 − 60 − 70 = 50°.','이 성질은 어떤 삼각형에서도 똑같아요!']}},
{ tier:'상위', type:'self', kind:'num',
q:'삼각형의 두 각이 90°, 45° 일 때 나머지 한 각은 몇 도일까요?',
fig:null,
answer:45,
hint:'삼각형 세 각의 합은 항상 180°예요!',
sol:{ ans:'45°', fig:null,
steps:['삼각형 세 각의 합 = 180°.','180 − 90 − 45 = 45°.','이 성질은 어떤 삼각형에서도 똑같아요!']}},
{ tier:'상위', type:'self', kind:'num',
q:'삼각형의 두 각이 50°, 60° 일 때 나머지 한 각은 몇 도일까요?',
fig:null,
answer:70,
hint:'삼각형 세 각의 합은 항상 180°예요!',
sol:{ ans:'70°', fig:null,
steps:['삼각형 세 각의 합 = 180°.','180 − 50 − 60 = 70°.','이 성질은 어떤 삼각형에서도 똑같아요!']}},
{ tier:'상위', type:'self', kind:'num',
q:'삼각형의 두 각이 30°, 120° 일 때 나머지 한 각은 몇 도일까요?',
fig:null,
answer:30,
hint:'삼각형 세 각의 합은 항상 180°예요!',
sol:{ ans:'30°', fig:null,
steps:['삼각형 세 각의 합 = 180°.','180 − 30 − 120 = 30°.','이 성질은 어떤 삼각형에서도 똑같아요!']}},
{ tier:'상위', type:'self', kind:'num',
q:'삼각형의 두 각이 45°, 45° 일 때 나머지 한 각은 몇 도일까요?',
fig:null,
answer:90,
hint:'삼각형 세 각의 합은 항상 180°예요!',
sol:{ ans:'90°', fig:null,
steps:['삼각형 세 각의 합 = 180°.','180 − 45 − 45 = 90°.','이 성질은 어떤 삼각형에서도 똑같아요!']}},
{ tier:'상위', type:'self', kind:'num',
q:'삼각형의 두 각이 80°, 60° 일 때 나머지 한 각은 몇 도일까요?',
fig:null,
answer:40,
hint:'삼각형 세 각의 합은 항상 180°예요!',
sol:{ ans:'40°', fig:null,
steps:['삼각형 세 각의 합 = 180°.','180 − 80 − 60 = 40°.','이 성질은 어떤 삼각형에서도 똑같아요!']}},
{ tier:'상위', type:'self', kind:'num',
q:'삼각형의 두 각이 100°, 30° 일 때 나머지 한 각은 몇 도일까요?',
fig:null,
answer:50,
hint:'삼각형 세 각의 합은 항상 180°예요!',
sol:{ ans:'50°', fig:null,
steps:['삼각형 세 각의 합 = 180°.','180 − 100 − 30 = 50°.','이 성질은 어떤 삼각형에서도 똑같아요!']}},
{ tier:'상위', type:'self', kind:'num',
q:'삼각형의 두 각이 35°, 55° 일 때 나머지 한 각은 몇 도일까요?',
fig:null,
answer:90,
hint:'삼각형 세 각의 합은 항상 180°예요!',
sol:{ ans:'90°', fig:null,
steps:['삼각형 세 각의 합 = 180°.','180 − 35 − 55 = 90°.','이 성질은 어떤 삼각형에서도 똑같아요!']}},
{ tier:'상위', type:'self', kind:'num',
q:'삼각형의 두 각이 70°, 70° 일 때 나머지 한 각은 몇 도일까요?',
fig:null,
answer:40,
hint:'삼각형 세 각의 합은 항상 180°예요!',
sol:{ ans:'40°', fig:null,
steps:['삼각형 세 각의 합 = 180°.','180 − 70 − 70 = 40°.','이 성질은 어떤 삼각형에서도 똑같아요!']}},
{ tier:'상위', type:'self', kind:'num',
q:'삼각형의 두 각이 25°, 90° 일 때 나머지 한 각은 몇 도일까요?',
fig:null,
answer:65,
hint:'삼각형 세 각의 합은 항상 180°예요!',
sol:{ ans:'65°', fig:null,
steps:['삼각형 세 각의 합 = 180°.','180 − 25 − 90 = 65°.','이 성질은 어떤 삼각형에서도 똑같아요!']}},
{ tier:'최상위', type:'self', kind:'num',
q:'정삼각형의 한 각은 몇 도일까요?',
fig:tri({kind:'정',note:'세 각이 모두 같아요'}),
answer:60,
hint:'세 각이 모두 같고 합은 180°!',
sol:{ ans:'60°', fig:tri({kind:'정',label:'정삼각형 — 한 각 60°'}),
steps:['정삼각형은 세 각이 모두 같아요.','합이 180°이므로 180 ÷ 3 = 60°.','정삼각형 = 세 변도 세 각도 모두 같은 삼각형!']}},
{ tier:'최상위', type:'self', kind:'num',
q:'직각삼각형에서 직각이 아닌 두 각의 합은 몇 도일까요?',
fig:tri({kind:'직각',note:'직각 말고 나머지 두 각의 합은?'}),
answer:90,
hint:'세 각의 합 180°에서 직각 90°를 빼면?',
sol:{ ans:'90°', fig:null,
steps:['세 각의 합 = 180°.','직각 = 90° 이므로 나머지 두 각의 합 = 180 − 90 = 90°.','그래서 직각삼각형의 나머지 두 각은 둘 다 예각이에요!']}},
{ tier:'최상위', type:'self', kind:'choice',
q:'한 삼각형에 직각이 2개 있을 수 있을까요?',
fig:null,
choices:['있다','없다','정삼각형만 가능','알 수 없다'], answer:'없다',
hint:'90 + 90 = 180 — 그러면 나머지 한 각은 몇 도가 되나요?',
sol:{ ans:'없다', fig:null,
steps:['직각 2개면 90 + 90 = 180°.','세 각의 합이 180°인데 벌써 다 써버렸으니 나머지 각은 0°.','각이 0°면 삼각형이 안 돼요 → 있을 수 없어요!']}},
{ tier:'최상위', type:'self', kind:'num',
q:'이등변삼각형의 꼭지각이 40° 일 때 밑각 하나는 몇 도일까요?',
fig:tri({kind:'이등변',note:'꼭지각 40° — 밑각 하나는?'}),
answer:70,
hint:'이등변삼각형은 두 밑각이 같아요. 180 − 40 = 140 을 둘로 나누면?',
sol:{ ans:'70°', fig:null,
steps:['이등변삼각형은 두 밑각의 크기가 같아요.','180 − 40 = 140° 를 둘이 나눠 가짐.','140 ÷ 2 = 70°.']}},
{ tier:'최상위', type:'self', kind:'choice',
q:'세 각이 60°, 60°, 60° 인 삼각형의 변은 어떨까요?',
fig:null,
choices:['세 변이 모두 같다','두 변만 같다','모두 다르다','알 수 없다'], answer:'세 변이 모두 같다',
hint:'세 각이 같으면 변은?',
sol:{ ans:'세 변이 모두 같다 (정삼각형)', fig:null,
steps:['세 각이 모두 60° → 정삼각형.','정삼각형은 세 변의 길이도 모두 같아요.','각이 같으면 변도 같아요 — 서로 연결돼 있어요!']}},
{ tier:'최상위', type:'self', kind:'num',
q:'이등변삼각형의 밑각이 50° 일 때 꼭지각은 몇 도일까요?',
fig:tri({kind:'이등변',note:'밑각 50° — 꼭지각은?'}),
answer:80,
hint:'밑각 두 개가 모두 50°예요. 180에서 빼면?',
sol:{ ans:'80°', fig:null,
steps:['이등변삼각형은 두 밑각이 같으니 50°가 두 개.','50 + 50 = 100°.','180 − 100 = 80°.']}},
{ tier:'최상위', type:'self', kind:'choice',
q:'정삼각형은 이등변삼각형이라고 할 수 있을까요?',
fig:null,
choices:['그렇다','아니다','각이 60°일 때만','알 수 없다'], answer:'그렇다',
hint:'이등변삼각형 = 두 변이 같은 삼각형. 정삼각형은 세 변이 같은데, 그중 두 변도 같겠죠?',
sol:{ ans:'그렇다', fig:null,
steps:['이등변삼각형은 두 변이 같은 삼각형.','정삼각형은 세 변이 모두 같아요.','세 변이 같으면 두 변도 당연히 같으니 → 정삼각형은 이등변삼각형에 포함돼요!']}},
{ tier:'최상위', type:'self', kind:'choice',
q:'한 삼각형에 둔각이 2개 있을 수 있을까요?',
fig:null,
choices:['있다','없다','직각삼각형만','알 수 없다'], answer:'없다',
hint:'둔각은 90°보다 커요. 2개면 합이 벌써 180°를 넘겠죠?',
sol:{ ans:'없다', fig:null,
steps:['둔각은 90°보다 큰 각.','둔각 2개면 합이 이미 180°를 넘어요.','세 각의 합이 180°인데 두 각만으로 넘으니 → 불가능!']}},
{ tier:'최상위', type:'self', kind:'num',
q:'삼각형의 세 각이 모두 같을 때 한 각은 몇 도일까요?',
fig:tri({kind:'정',note:'세 각이 모두 같다면?'}),
answer:60,
hint:'합 180°를 셋이 똑같이 나눠 가지면?',
sol:{ ans:'60°', fig:null,
steps:['세 각이 모두 같음 → 180 ÷ 3.','= 60°.','이게 바로 정삼각형이에요!']}},
{ tier:'최상위', type:'self', kind:'num',
q:'직각삼각형에서 나머지 두 각이 같을 때 한 각은 몇 도일까요?',
fig:tri({kind:'직각',note:'나머지 두 각이 같다면?'}),
answer:45,
hint:'직각 말고 두 각의 합은 90°. 그걸 둘로 똑같이 나누면?',
sol:{ ans:'45°', fig:null,
steps:['직각삼각형의 나머지 두 각의 합 = 180 − 90 = 90°.','두 각이 같으니 90 ÷ 2 = 45°.','이건 직각이등변삼각형 — 삼각자에 있는 모양이에요!']}},
];
const TIERS=['기초','중급','상위','최상위'];
const TIER_DESC={기초:'영상만 봐도 바로 풀려요 — 배운 걸 그대로 적용.',중급:'한 번 더 생각 — 거꾸로·변형. 영상 안에 답이 있어요.',상위:'아래 학년 개념(선수 단원)을 함께 써야 풀려요.',최상위:'여러 개념·역발상·함정까지. 최고 난도.'};
let curTier='기초';
function tierProblems(t){ return P.map((p,i)=>({p,i})).filter(o=>o.p.tier===t); }
function renderTabs(){
const tb=document.getElementById('tabs'); tb.innerHTML='';
TIERS.forEach(t=>{ const n=tierProblems(t).length;
const b=document.createElement('button'); b.className='tab'+(t===curTier?' on':''); b.textContent=`${t} (${n})`;
b.onclick=()=>{curTier=t; renderTabs(); renderList();}; tb.appendChild(b); });
document.getElementById('tierNote').textContent=TIER_DESC[curTier];
}
function esc(x){return String(x).replace(/&/g,'&').replace(//g,'>');}
function renderList(){
const L=document.getElementById('list'); L.innerHTML='';
const items=tierProblems(curTier);
if(!items.length){ L.innerHTML='이 난도는 곧 채워집니다 — 파일럿은 기초·중급·상위 예시.
'; return; }
items.forEach(({p,i},k)=>{
const badge = p.type==='video' ? '🎬 영상해설' : '✍ 텍스트해설';
const pre = p.prereq ? `🔗 ${p.prereq.name}` : '';
const c=document.createElement('div'); c.className='card'; c.id='card'+i;
let ansUI = p.kind==='choice'
? ``+p.choices.map(o=>``).join('')+`
`
: `← 내 답을 쓰고 제출
`;
c.innerHTML=`
${curTier} · 문제 ${k+1} ${badge} ${pre}
${mfx(p.q)}
${p.fig?`${p.fig}
`:''}
${ansUI}
🔒 답을 제출해야 해설·정답이 열려요.
💡 힌트 — ${p.hint}
`;
L.appendChild(c);
});
}
const picked={};
// 분수 답 입력 지원: '3/4', '1 1/2', '0.75' 모두 인식
function parseAns(v){ v=String(v).trim().replace(/\s+/g,' ');
let m=/^(-?\d+)\s+(\d+)\/(\d+)$/.exec(v);
if(m){ const s=(+m[1])<0?-1:1; return s*(Math.abs(+m[1])+(+m[2])/(+m[3])); }
m=/^(-?\d+)\/(-?\d+)$/.exec(v); if(m) return (+m[1])/(+m[2]);
return parseFloat(v.replace(/[^0-9.\-]/g,''));
}
function pick(i,val,el){ picked[i]=val; document.querySelectorAll('#ch'+i+' button').forEach(b=>b.classList.remove('sel')); el.classList.add('sel'); }
function mfx(t){ if(!window.mathToHTML) return t;
// HTML 태그( 등)는 그대로 두고, 태그 사이 텍스트만 교과서식 수식으로 변환
return String(t).split(/(<[^>]+>)/).map(s=> s.charAt(0)==='<' ? s : mathToHTML(s)).join(''); }
function submit(i){
const p=P[i]; let mine;
if(p.kind==='choice'){ mine=picked[i]; if(mine==null){ alert('보기 중 하나를 먼저 고르세요.'); return; } }
else { const v=document.getElementById('in'+i).value.trim(); if(v===''){ alert('답을 먼저 입력하세요.'); return; } mine=parseAns(v); if(isNaN(mine)){ alert('숫자나 분수(예: 3/4)로 입력해 주세요.'); return; } }
const correct = p.kind==='choice' ? (mine===p.answer) : (Math.abs(mine-p.answer)<1e-6);
const vd=document.getElementById('vd'+i); vd.classList.remove('hide');
document.getElementById('lock'+i).classList.add('hide');
document.getElementById('show'+i).classList.remove('hide'); // 제출했으니 해설 열람 가능
if(correct){ vd.className='verdict ok'; vd.innerHTML='✅ 정답이에요! 잘했어요.'; reveal(i); }
else{ vd.className='verdict no'; vd.innerHTML='❌ 아쉬워요. 힌트를 보고 다시 풀어 볼까요? (해설도 열렸어요)';
document.getElementById('hint'+i).classList.remove('hide'); }
}
function reveal(i){
const p=P[i], sol=document.getElementById('sol'+i); sol.classList.remove('hide');
let steps=p.sol.steps.map(s=>`• ${mfx(s)}
`).join('');
let pre=p.prereq?``:'';
let vsol = p.type==='video' ? `🎬 이 문제 영상 해설 보기 (짧게)` : '';
sol.innerHTML=`📝 해설
${pre}${p.sol.fig?`${p.sol.fig}
`:''}${steps}정답: ${mfx(p.sol.ans)}
${vsol}`
+`🙋 이 해설이 어렵거나 더 자세히 알고 싶으면 말씀해주세요 — 상세 해설지를 새로 만들어 보내드릴게요.
`
+``;
}
/* ───────── "이 해설도 어려워요" 체크 → 하단 요청 코너로 모으기 ───────── */
const hardSet=new Set();
function toggleHard(i,on){ on?hardSet.add(i):hardSet.delete(i); syncHard(); }
function syncHard(){
const box=document.getElementById('hardList'); if(!box) return;
if(!hardSet.size){ box.style.display='none'; box.textContent=''; return; }
const names=[...hardSet].sort((a,b)=>a-b).map(i=>{
const list=tierProblems(P[i].tier); const k=list.findIndex(o=>o.i===i);
return `${P[i].tier} ${k+1}번`;
});
box.style.display='block';
box.innerHTML='🙋 해설이 어렵다고 표시한 문제: '+names.join(', ')+' — 보내기를 누르면 함께 전달돼요.';
}
/* ───────── 추가요청 보내기 (선생님 확인용 · 이 기기에 저장) ───────── */
function reqKey(){ return 'pbreq:'+location.pathname; }
function loadReq(){ try{ return JSON.parse(localStorage.getItem(reqKey())||'[]'); }catch(e){ return []; } }
function nowStr(){ const d=new Date(), p=n=>(n<10?'0':'')+n; return d.getFullYear()+'-'+p(d.getMonth()+1)+'-'+p(d.getDate())+' '+p(d.getHours())+':'+p(d.getMinutes()); }
function sendReq(){
const ta=document.getElementById('reqText'), note=document.getElementById('reqNote');
const text=(ta.value||'').trim();
const hard=[...hardSet].sort((a,b)=>a-b).map(i=>{ const list=tierProblems(P[i].tier); const k=list.findIndex(o=>o.i===i); return `${P[i].tier} ${k+1}번`; });
if(!text && !hard.length){ note.style.color='#C0503D'; note.textContent='요청 내용을 적거나, 어려운 해설을 체크해 주세요.'; return; }
const arr=loadReq(); arr.push({ date:nowStr(), text, hard, unit:'초4 삼각형' });
try{ localStorage.setItem(reqKey(), JSON.stringify(arr)); }catch(e){}
ta.value=''; hardSet.clear(); syncHard();
document.querySelectorAll('.retag input').forEach(c=>c.checked=false);
note.style.color='#2c8a55'; note.textContent='✅ 보냈어요! 선생님이 확인합니다. (이 기기에 저장됨)';
renderReq();
}
function renderReq(){
const box=document.getElementById('reqMine'); if(!box) return;
const arr=loadReq(); box.innerHTML='';
if(!arr.length) return;
box.innerHTML='📒 내가 보낸 요청 ('+arr.length+')
'
+ arr.slice().reverse().map(it=>`${it.hard&&it.hard.length?'🙋 어려운 해설: '+it.hard.join(', ')+'
':''}${(it.text||'').replace(/(내용 없음)'}
${it.date}
`).join('');
}
/* ───────── 인쇄 2모드 — 절약 인쇄(2단·컬러 유지) ───────── */
function ecoPrint(){
document.body.classList.add('eco-print');
window.addEventListener('afterprint', function h(){ document.body.classList.remove('eco-print'); window.removeEventListener('afterprint',h); });
window.print();
}
/* ───────── DrawBoard (문항별 손으로 풀기 — 화면 가득 전체화면) ───────── */
const canvas=document.getElementById('drawCanvas'), ctx=canvas.getContext('2d');
const drawOverlay=document.getElementById('drawOverlay'), drawWrap=document.getElementById('drawCanvasWrap');
let drawOn=false, tool='pen', dsize=6, dcolor='#1f2a2a', drawing=false, last=null, currentDrawQ=null;
const drawings={}; // i -> dataURL (문항별 손풀이)
const photos={}; // i -> dataURL (문항별 사진)
function sizeCanvas(restore){
const rect=drawWrap.getBoundingClientRect(), dpr=window.devicePixelRatio||1;
canvas.width=Math.round(rect.width*dpr); canvas.height=Math.round(rect.height*dpr);
canvas.style.width=rect.width+'px'; canvas.style.height=rect.height+'px';
ctx.setTransform(dpr,0,0,dpr,0,0); ctx.clearRect(0,0,rect.width,rect.height);
if(restore){ const img=new Image(); img.onload=()=>ctx.drawImage(img,0,0,rect.width,rect.height); img.src=restore; }
}
window.addEventListener('resize',()=>{ if(drawOn) sizeCanvas(drawings[currentDrawQ]); });
window.openDraw=function(i){
drawOn=true; currentDrawQ=i;
const plain=String(P[i].q).replace(/<[^>]*>/g,'');
document.getElementById('drawQref').textContent=P[i].tier+' · '+plain.slice(0,30)+'…';
drawOverlay.classList.add('on');
sizeCanvas(drawings[i]);
const el2=document.documentElement, req=el2.requestFullscreen||el2.webkitRequestFullscreen||el2.msRequestFullscreen;
if(req){ try{ req.call(el2).catch(()=>{}); }catch(e){} }
};
window.closeDraw=function(){
if(currentDrawQ!=null){
const hasInk=(()=>{ const d=ctx.getImageData(0,0,canvas.width,canvas.height).data; for(let k=3;k0) return true; return false; })();
if(hasInk){ drawings[currentDrawQ]=canvas.toDataURL('image/png'); renderThumbs(currentDrawQ); }
}
drawOn=false; currentDrawQ=null; drawOverlay.classList.remove('on');
if(document.fullscreenElement||document.webkitFullscreenElement){
(document.exitFullscreen||document.webkitExitFullscreen).call(document).catch(()=>{});
}
};
window.submitFromDraw=function(){ const i=currentDrawQ; closeDraw(); if(i!=null) submit(i); };
document.addEventListener('fullscreenchange',()=>{ if(!document.fullscreenElement && drawOn) closeDraw(); });
window.setTool=t=>{ tool=t; document.getElementById('toolPen').classList.toggle('on',t==='pen'); document.getElementById('toolErase').classList.toggle('on',t==='erase'); };
window.setSize=s=>{ dsize=s; ['szS','szM','szL'].forEach(id=>document.getElementById(id).classList.remove('on')); document.getElementById(s===3?'szS':s===12?'szL':'szM').classList.add('on'); };
window.setColor=c=>{ dcolor=c; };
window.clearDraw=()=>{ if(confirm('그린 것을 모두 지울까요?')) ctx.clearRect(0,0,canvas.width,canvas.height); };
function dpos(e){ const r=canvas.getBoundingClientRect(), t=e.touches?e.touches[0]:e; return [t.clientX-r.left, t.clientY-r.top]; }
function dstart(e){ if(!drawOn) return; e.preventDefault(); drawing=true; last=dpos(e); }
function dmove(e){ if(!drawOn||!drawing) return; e.preventDefault(); const p=dpos(e);
ctx.lineCap='round'; ctx.lineJoin='round';
if(tool==='erase'){ ctx.globalCompositeOperation='destination-out'; ctx.lineWidth=dsize*4; }
else{ ctx.globalCompositeOperation='source-over'; ctx.strokeStyle=dcolor; ctx.lineWidth=dsize; }
ctx.beginPath(); ctx.moveTo(last[0],last[1]); ctx.lineTo(p[0],p[1]); ctx.stroke(); last=p;
}
function dend(){ drawing=false; }
canvas.addEventListener('mousedown',dstart); canvas.addEventListener('mousemove',dmove); window.addEventListener('mouseup',dend);
canvas.addEventListener('touchstart',dstart,{passive:false}); canvas.addEventListener('touchmove',dmove,{passive:false}); canvas.addEventListener('touchend',dend,{passive:false});
/* ───────── 사진으로 올리기 (문항별) ───────── */
window.onPhoto=function(i,inputEl){
const file=inputEl.files&&inputEl.files[0]; if(!file) return;
const reader=new FileReader();
reader.onload=ev=>{ const img=new Image();
img.onload=()=>{ const maxW=900, sc=Math.min(1,maxW/img.width), w=Math.round(img.width*sc), h=Math.round(img.height*sc);
const cv=document.createElement('canvas'); cv.width=w; cv.height=h; cv.getContext('2d').drawImage(img,0,0,w,h);
photos[i]=cv.toDataURL('image/jpeg',0.6); renderThumbs(i); };
img.src=ev.target.result; };
reader.readAsDataURL(file); inputEl.value='';
};
window.removePhoto=function(i){ delete photos[i]; renderThumbs(i); };
window.removeDrawing=function(i){ delete drawings[i]; renderThumbs(i); };
function renderThumbs(i){
const box=document.getElementById('thumbs'+i); if(!box) return;
let h='';
if(drawings[i]) h+=`
`;
if(photos[i]) h+=`
`;
box.innerHTML=h;
const db=document.getElementById('drawBtn'+i), pb=document.getElementById('photoBtn'+i);
if(db) db.classList.toggle('has', !!drawings[i]);
if(pb) pb.classList.toggle('has', !!photos[i]);
}
// 탭을 바꿔 다시 그려도 그 문항의 손풀이·사진 썸네일이 되살아나게
const _renderList=renderList;
renderList=function(){ _renderList(); tierProblems(curTier).forEach(({p,i})=>renderThumbs(i)); };
renderTabs(); renderList(); renderReq();