YEON PLANNING · 직관수학 (초4)

각도 — 4단계 문제은행

영상으로 배우고 → 직접 풀고 → 답 제출 → 해설. 각도는 얼마나 돌았나 — 직각 90°, 평각 180°, 한 바퀴 360°.

✍️ 연플래닝 오리지널 — 「아하! 보이는 직관수학」 자체 제작. 모든 문제·정답 손검산 완료. 답안을 제출해야 해설·정답이 열립니다(먼저 스스로 풀어 보세요).

💬 더 필요한 게 있나요?

난이도 조절(더 쉽게 / 더 어렵게) · 다른 유형 · 특정 개념 집중 · 문항 수 등 무엇이든 적어 주세요. 선생님이 확인합니다. (공개 아님)
✏️ 손으로 풀어보세요
`; return s; } // ── 각 그리기 (초4 각도) — 좌표를 실제 삼각함수로 계산 ── function ang(cfg){ const {deg=60, W=250, H=200, note='', showArc=true, label=''} = cfg; const ox=60, oy=150, L=150; const rad=deg*Math.PI/180; const bx=ox+L, by=oy; // 기준변(가로) const ax=ox+Math.cos(-rad)*L, ay=oy+Math.sin(-rad)*L; let s=``; s+=``; s+=``; if(showArc){ const R=34, x1=ox+R, y1=oy, x2=ox+Math.cos(-rad)*R, y2=oy+Math.sin(-rad)*R; const big=deg>180?1:0; s+=``; const mid=(-rad/2); s+=`${label||(deg+'°')}`; } s+=``; if(note) s+=`${note}`; s+=``; return s; } const P=[ { tier:'기초', type:'self', kind:'choice', q:'30° 는 예각·직각·둔각·평각 중 무엇일까요?', fig:ang({deg:30,note:'이 각은 무엇일까요?'}), choices:['예각','직각','둔각','평각'], answer:'예각', hint:'0°보다 크고 90°보다 작으면 예각, 딱 90°면 직각, 90°보다 크고 180°보다 작으면 둔각, 딱 180°면 평각.', sol:{ ans:'예각', fig:ang({deg:30,note:'30° = 예각'}), steps:['기준: 예각 < 90° < 둔각 < 180°(평각).','30° 는 예각.','직각(90°)을 기준으로 작으면 예각, 크면 둔각이에요!']}}, { tier:'기초', type:'self', kind:'choice', q:'45° 는 예각·직각·둔각·평각 중 무엇일까요?', fig:ang({deg:45,note:'이 각은 무엇일까요?'}), choices:['예각','직각','둔각','평각'], answer:'예각', hint:'0°보다 크고 90°보다 작으면 예각, 딱 90°면 직각, 90°보다 크고 180°보다 작으면 둔각, 딱 180°면 평각.', sol:{ ans:'예각', fig:ang({deg:45,note:'45° = 예각'}), steps:['기준: 예각 < 90° < 둔각 < 180°(평각).','45° 는 예각.','직각(90°)을 기준으로 작으면 예각, 크면 둔각이에요!']}}, { tier:'기초', type:'self', kind:'choice', q:'60° 는 예각·직각·둔각·평각 중 무엇일까요?', fig:ang({deg:60,note:'이 각은 무엇일까요?'}), choices:['예각','직각','둔각','평각'], answer:'예각', hint:'0°보다 크고 90°보다 작으면 예각, 딱 90°면 직각, 90°보다 크고 180°보다 작으면 둔각, 딱 180°면 평각.', sol:{ ans:'예각', fig:ang({deg:60,note:'60° = 예각'}), steps:['기준: 예각 < 90° < 둔각 < 180°(평각).','60° 는 예각.','직각(90°)을 기준으로 작으면 예각, 크면 둔각이에요!']}}, { tier:'기초', type:'self', kind:'choice', q:'90° 는 예각·직각·둔각·평각 중 무엇일까요?', fig:ang({deg:90,note:'이 각은 무엇일까요?'}), choices:['예각','직각','둔각','평각'], answer:'직각', hint:'0°보다 크고 90°보다 작으면 예각, 딱 90°면 직각, 90°보다 크고 180°보다 작으면 둔각, 딱 180°면 평각.', sol:{ ans:'직각', fig:ang({deg:90,note:'90° = 직각'}), steps:['기준: 예각 < 90° < 둔각 < 180°(평각).','90° 는 직각.','직각(90°)을 기준으로 작으면 예각, 크면 둔각이에요!']}}, { tier:'기초', type:'self', kind:'choice', q:'120° 는 예각·직각·둔각·평각 중 무엇일까요?', fig:ang({deg:120,note:'이 각은 무엇일까요?'}), choices:['예각','직각','둔각','평각'], answer:'둔각', hint:'0°보다 크고 90°보다 작으면 예각, 딱 90°면 직각, 90°보다 크고 180°보다 작으면 둔각, 딱 180°면 평각.', sol:{ ans:'둔각', fig:ang({deg:120,note:'120° = 둔각'}), steps:['기준: 예각 < 90° < 둔각 < 180°(평각).','120° 는 둔각.','직각(90°)을 기준으로 작으면 예각, 크면 둔각이에요!']}}, { tier:'기초', type:'self', kind:'choice', q:'150° 는 예각·직각·둔각·평각 중 무엇일까요?', fig:ang({deg:150,note:'이 각은 무엇일까요?'}), choices:['예각','직각','둔각','평각'], answer:'둔각', hint:'0°보다 크고 90°보다 작으면 예각, 딱 90°면 직각, 90°보다 크고 180°보다 작으면 둔각, 딱 180°면 평각.', sol:{ ans:'둔각', fig:ang({deg:150,note:'150° = 둔각'}), steps:['기준: 예각 < 90° < 둔각 < 180°(평각).','150° 는 둔각.','직각(90°)을 기준으로 작으면 예각, 크면 둔각이에요!']}}, { tier:'기초', type:'self', kind:'choice', q:'180° 는 예각·직각·둔각·평각 중 무엇일까요?', fig:ang({deg:175,note:'이 각은 무엇일까요?'}), choices:['예각','직각','둔각','평각'], answer:'평각', hint:'0°보다 크고 90°보다 작으면 예각, 딱 90°면 직각, 90°보다 크고 180°보다 작으면 둔각, 딱 180°면 평각.', sol:{ ans:'평각', fig:ang({deg:175,note:'180° = 평각'}), steps:['기준: 예각 < 90° < 둔각 < 180°(평각).','180° 는 평각.','직각(90°)을 기준으로 작으면 예각, 크면 둔각이에요!']}}, { tier:'기초', type:'self', kind:'choice', q:'20° 는 예각·직각·둔각·평각 중 무엇일까요?', fig:ang({deg:20,note:'이 각은 무엇일까요?'}), choices:['예각','직각','둔각','평각'], answer:'예각', hint:'0°보다 크고 90°보다 작으면 예각, 딱 90°면 직각, 90°보다 크고 180°보다 작으면 둔각, 딱 180°면 평각.', sol:{ ans:'예각', fig:ang({deg:20,note:'20° = 예각'}), steps:['기준: 예각 < 90° < 둔각 < 180°(평각).','20° 는 예각.','직각(90°)을 기준으로 작으면 예각, 크면 둔각이에요!']}}, { tier:'기초', type:'self', kind:'choice', q:'75° 는 예각·직각·둔각·평각 중 무엇일까요?', fig:ang({deg:75,note:'이 각은 무엇일까요?'}), choices:['예각','직각','둔각','평각'], answer:'예각', hint:'0°보다 크고 90°보다 작으면 예각, 딱 90°면 직각, 90°보다 크고 180°보다 작으면 둔각, 딱 180°면 평각.', sol:{ ans:'예각', fig:ang({deg:75,note:'75° = 예각'}), steps:['기준: 예각 < 90° < 둔각 < 180°(평각).','75° 는 예각.','직각(90°)을 기준으로 작으면 예각, 크면 둔각이에요!']}}, { tier:'기초', type:'self', kind:'choice', q:'135° 는 예각·직각·둔각·평각 중 무엇일까요?', fig:ang({deg:135,note:'이 각은 무엇일까요?'}), choices:['예각','직각','둔각','평각'], answer:'둔각', hint:'0°보다 크고 90°보다 작으면 예각, 딱 90°면 직각, 90°보다 크고 180°보다 작으면 둔각, 딱 180°면 평각.', sol:{ ans:'둔각', fig:ang({deg:135,note:'135° = 둔각'}), steps:['기준: 예각 < 90° < 둔각 < 180°(평각).','135° 는 둔각.','직각(90°)을 기준으로 작으면 예각, 크면 둔각이에요!']}}, { tier:'중급', type:'self', kind:'num', q:'30° + 40° 는 몇 도일까요?', fig:null, answer:70, hint:'각도끼리 더하면 돼요. 두 각을 이어 붙인 셈이에요!', sol:{ ans:'70°', fig:null, steps:['30 + 40 = 70°.','두 각을 나란히 붙이면 각도가 더해져요.','각도도 수처럼 더하고 뺄 수 있어요.']}}, { tier:'중급', type:'self', kind:'num', q:'50° + 60° 는 몇 도일까요?', fig:null, answer:110, hint:'각도끼리 더하면 돼요. 두 각을 이어 붙인 셈이에요!', sol:{ ans:'110°', fig:null, steps:['50 + 60 = 110°.','두 각을 나란히 붙이면 각도가 더해져요.','각도도 수처럼 더하고 뺄 수 있어요.']}}, { tier:'중급', type:'self', kind:'num', q:'25° + 35° 는 몇 도일까요?', fig:null, answer:60, hint:'각도끼리 더하면 돼요. 두 각을 이어 붙인 셈이에요!', sol:{ ans:'60°', fig:null, steps:['25 + 35 = 60°.','두 각을 나란히 붙이면 각도가 더해져요.','각도도 수처럼 더하고 뺄 수 있어요.']}}, { tier:'중급', type:'self', kind:'num', q:'70° + 20° 는 몇 도일까요?', fig:null, answer:90, hint:'각도끼리 더하면 돼요. 두 각을 이어 붙인 셈이에요!', sol:{ ans:'90°', fig:null, steps:['70 + 20 = 90°.','두 각을 나란히 붙이면 각도가 더해져요.','합이 90°면 두 각이 딱 직각을 이뤄요!']}}, { tier:'중급', type:'self', kind:'num', q:'45° + 45° 는 몇 도일까요?', fig:null, answer:90, hint:'각도끼리 더하면 돼요. 두 각을 이어 붙인 셈이에요!', sol:{ ans:'90°', fig:null, steps:['45 + 45 = 90°.','두 각을 나란히 붙이면 각도가 더해져요.','합이 90°면 두 각이 딱 직각을 이뤄요!']}}, { tier:'중급', type:'self', kind:'num', q:'80° + 10° 는 몇 도일까요?', fig:null, answer:90, hint:'각도끼리 더하면 돼요. 두 각을 이어 붙인 셈이에요!', sol:{ ans:'90°', fig:null, steps:['80 + 10 = 90°.','두 각을 나란히 붙이면 각도가 더해져요.','합이 90°면 두 각이 딱 직각을 이뤄요!']}}, { tier:'중급', type:'self', kind:'num', q:'15° + 55° 는 몇 도일까요?', fig:null, answer:70, hint:'각도끼리 더하면 돼요. 두 각을 이어 붙인 셈이에요!', sol:{ ans:'70°', fig:null, steps:['15 + 55 = 70°.','두 각을 나란히 붙이면 각도가 더해져요.','각도도 수처럼 더하고 뺄 수 있어요.']}}, { tier:'중급', type:'self', kind:'num', q:'65° + 25° 는 몇 도일까요?', fig:null, answer:90, hint:'각도끼리 더하면 돼요. 두 각을 이어 붙인 셈이에요!', sol:{ ans:'90°', fig:null, steps:['65 + 25 = 90°.','두 각을 나란히 붙이면 각도가 더해져요.','합이 90°면 두 각이 딱 직각을 이뤄요!']}}, { tier:'중급', type:'self', kind:'num', q:'35° + 55° 는 몇 도일까요?', fig:null, answer:90, hint:'각도끼리 더하면 돼요. 두 각을 이어 붙인 셈이에요!', sol:{ ans:'90°', fig:null, steps:['35 + 55 = 90°.','두 각을 나란히 붙이면 각도가 더해져요.','합이 90°면 두 각이 딱 직각을 이뤄요!']}}, { tier:'중급', type:'self', kind:'num', q:'40° + 50° 는 몇 도일까요?', fig:null, answer:90, hint:'각도끼리 더하면 돼요. 두 각을 이어 붙인 셈이에요!', sol:{ ans:'90°', fig:null, steps:['40 + 50 = 90°.','두 각을 나란히 붙이면 각도가 더해져요.','합이 90°면 두 각이 딱 직각을 이뤄요!']}}, { tier:'상위', type:'self', kind:'num', q:'직각(90°)에서 30° 를 빼면 몇 도일까요?', fig:null, answer:60, hint:'직각 = 90°, 평각 = 180° 를 기억하세요!', sol:{ ans:'60°', fig:null, steps:['직각 = 90°, 평각 = 180°.','계산하면 60°.','각도는 「얼마나 돌았나」를 재는 거예요!']}}, { tier:'상위', type:'self', kind:'num', q:'평각(180°)에서 90° 를 빼면?', fig:null, answer:90, hint:'직각 = 90°, 평각 = 180° 를 기억하세요!', sol:{ ans:'90°', fig:null, steps:['직각 = 90°, 평각 = 180°.','계산하면 90°.','각도는 「얼마나 돌았나」를 재는 거예요!']}}, { tier:'상위', type:'self', kind:'num', q:'평각(180°)에서 120° 를 빼면?', fig:null, answer:60, hint:'직각 = 90°, 평각 = 180° 를 기억하세요!', sol:{ ans:'60°', fig:null, steps:['직각 = 90°, 평각 = 180°.','계산하면 60°.','각도는 「얼마나 돌았나」를 재는 거예요!']}}, { tier:'상위', type:'self', kind:'num', q:'직각(90°)에서 45° 를 빼면?', fig:null, answer:45, hint:'직각 = 90°, 평각 = 180° 를 기억하세요!', sol:{ ans:'45°', fig:null, steps:['직각 = 90°, 평각 = 180°.','계산하면 45°.','각도는 「얼마나 돌았나」를 재는 거예요!']}}, { tier:'상위', type:'self', kind:'num', q:'180° 에서 직각 두 개를 빼면 몇 도일까요?', fig:null, answer:0, hint:'직각 = 90°, 평각 = 180° 를 기억하세요!', sol:{ ans:'0°', fig:null, steps:['직각 = 90°, 평각 = 180°.','계산하면 0°.','각도는 「얼마나 돌았나」를 재는 거예요!']}}, { tier:'상위', type:'self', kind:'num', q:'30° 의 각과 이어 붙여 평각(180°)을 만들려면 몇 도가 필요할까요?', fig:null, answer:150, hint:'180 − 30 = ?', sol:{ ans:'150°', fig:null, steps:['평각 = 180°.','180 − 30 = 150°.','두 각을 이어 붙여 일직선이 되면 합이 180°예요!']}}, { tier:'상위', type:'self', kind:'num', q:'45° 의 각과 이어 붙여 평각(180°)을 만들려면 몇 도가 필요할까요?', fig:null, answer:135, hint:'180 − 45 = ?', sol:{ ans:'135°', fig:null, steps:['평각 = 180°.','180 − 45 = 135°.','두 각을 이어 붙여 일직선이 되면 합이 180°예요!']}}, { tier:'상위', type:'self', kind:'num', q:'60° 의 각과 이어 붙여 평각(180°)을 만들려면 몇 도가 필요할까요?', fig:null, answer:120, hint:'180 − 60 = ?', sol:{ ans:'120°', fig:null, steps:['평각 = 180°.','180 − 60 = 120°.','두 각을 이어 붙여 일직선이 되면 합이 180°예요!']}}, { tier:'상위', type:'self', kind:'num', q:'120° 의 각과 이어 붙여 평각(180°)을 만들려면 몇 도가 필요할까요?', fig:null, answer:60, hint:'180 − 120 = ?', sol:{ ans:'60°', fig:null, steps:['평각 = 180°.','180 − 120 = 60°.','두 각을 이어 붙여 일직선이 되면 합이 180°예요!']}}, { tier:'상위', type:'self', kind:'num', q:'150° 의 각과 이어 붙여 평각(180°)을 만들려면 몇 도가 필요할까요?', fig:null, answer:30, hint:'180 − 150 = ?', sol:{ ans:'30°', fig:null, steps:['평각 = 180°.','180 − 150 = 30°.','두 각을 이어 붙여 일직선이 되면 합이 180°예요!']}}, { tier:'최상위', type:'self', kind:'num', q:'직각 2개를 이어 붙이면 몇 도일까요?', fig:null, answer:180, hint:'90 × 2 = ?', sol:{ ans:'180° (평각)', fig:null, steps:['90 × 2 = 180°.','직각 2개 = 평각(일직선)!','시계로 치면 12시에서 6시까지 돈 셈이에요.']}}, { tier:'최상위', type:'self', kind:'num', q:'직각 4개를 이어 붙이면 몇 도일까요? (한 바퀴)', fig:null, answer:360, hint:'90 × 4 = ?', sol:{ ans:'360° (한 바퀴)', fig:null, steps:['90 × 4 = 360°.','한 바퀴 = 360°.','직각 4개가 모이면 제자리로 돌아와요!']}}, { tier:'최상위', type:'self', kind:'choice', q:'예각과 둔각을 이어 붙이면 항상 평각(180°)이 될까요?', fig:null, choices:['그렇다','아니다','예각일 때만','알 수 없다'], answer:'아니다', hint:'예: 30° + 100° = 130° 예요. 항상 180°일까요?', sol:{ ans:'아니다 (합이 180°가 되는 짝만 그렇다)', fig:null, steps:['예각 30° + 둔각 100° = 130° — 180°가 아니에요.','예각 80° + 둔각 100° = 180° — 이건 맞아요.','합이 180°인 짝일 때만 평각이 돼요. 항상은 아니에요!']}}, { tier:'최상위', type:'self', kind:'choice', q:'한 각이 90° 보다 1° 큰 각은 무엇일까요?', fig:null, choices:['예각','직각','둔각','평각'], answer:'둔각', hint:'91° 는 90°보다 크고 180°보다 작아요.', sol:{ ans:'둔각 (91°)', fig:null, steps:['91° 는 90°보다 크고 180°보다 작아요.','그래서 둔각.','1°만 넘어도 둔각이에요 — 기준이 딱 90°!']}}, { tier:'최상위', type:'self', kind:'num', q:'시계의 긴 바늘이 15분 도는 동안 몇 도를 돌까요?', fig:null, answer:90, hint:'한 바퀴(60분) = 360°. 15분은 4분의 1 바퀴!', sol:{ ans:'90°', fig:null, steps:['한 바퀴 60분 = 360°.','15분은 60분의 4분의 1 → 360 ÷ 4 = 90°.','딱 직각만큼 돌아요!']}}, { tier:'최상위', type:'self', kind:'num', q:'시계의 긴 바늘이 30분 도는 동안 몇 도를 돌까요?', fig:null, answer:180, hint:'한 바퀴(60분) = 360°. 30분은 반 바퀴!', sol:{ ans:'180° (평각)', fig:null, steps:['한 바퀴 60분 = 360°.','30분은 반 바퀴 → 360 ÷ 2 = 180°.','12시에서 6시까지 — 일직선이 되죠!']}}, { tier:'최상위', type:'self', kind:'num', q:'시계의 긴 바늘이 5분 도는 동안 몇 도를 돌까요?', fig:null, answer:30, hint:'60분에 360°. 1분에 몇 도씩 돌까요?', sol:{ ans:'30°', fig:null, steps:['60분 = 360° 이므로 1분에 360 ÷ 60 = 6°.','5분이면 6 × 5 = 30°.','숫자 칸 하나(5분)가 딱 30°예요!']}}, { tier:'최상위', type:'self', kind:'choice', q:'30° 짜리 각 3개를 이어 붙이면 무슨 각이 될까요?', fig:null, choices:['예각','직각','둔각','평각'], answer:'직각', hint:'30 × 3 = 90 — 90°는 무슨 각인가요?', sol:{ ans:'직각 (90°)', fig:null, steps:['30 × 3 = 90°.','90°는 직각.','작은 각도 여러 개 모으면 직각이 돼요!']}}, { tier:'최상위', type:'self', kind:'choice', q:'어떤 각이 예각이면서 동시에 둔각일 수 있을까요?', fig:null, choices:['있다','없다','45°일 때만','알 수 없다'], answer:'없다', hint:'예각은 90°보다 작고, 둔각은 90°보다 커요. 둘 다일 수 있을까요?', sol:{ ans:'없다', fig:null, steps:['예각 = 90°보다 작은 각.','둔각 = 90°보다 각.','한 각이 90°보다 작으면서 동시에 클 수는 없어요 → 불가능!']}}, { tier:'최상위', type:'self', kind:'choice', q:'각의 변의 길이를 2배로 길게 그리면 각도는 어떻게 될까요?', fig:ang({deg:50,note:'변을 더 길게 그리면 각도가 커질까요?'}), choices:['2배가 된다','그대로다','반이 된다','알 수 없다'], answer:'그대로다', hint:'각도는 「변이 얼마나 벌어졌나」예요. 변을 길게 늘여도 벌어진 정도가 변할까요?', sol:{ ans:'그대로다 (변하지 않는다)', fig:ang({deg:50,note:'변 길이와 상관없이 각도는 그대로!'}), steps:['각도는 두 변이 얼마나 벌어졌나를 재는 거예요.','변을 길게 늘여도 벌어진 정도는 그대로.','그래서 각도는 변하지 않아요 — 이게 각도의 핵심이에요!']}}, ]; 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?`
🔗 이 문제는 ${p.prereq.name} 개념이 필요해요 — 그 단원 보러 가기 →
`:''; 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();