YEON PLANNING · 직관수학 (초2)

몇 시 몇 분 — 4단계 문제은행

영상으로 배우고 → 직접 풀고 → 답 제출 → 해설. 숫자 한 칸이 5분 — 긴 바늘 숫자 × 5.

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

💬 더 필요한 게 있나요?

난이도 조절(더 쉽게 / 더 어렵게) · 다른 유형 · 특정 개념 집중 · 문항 수 등 무엇이든 적어 주세요. 선생님이 확인합니다. (공개 아님)
✏️ 손으로 풀어보세요
`; return s; } // ── 시계 그리기 (초2 몇 시 몇 분) ── function clock(cfg){ const {h=3, m=0, W=210, H=225, note=''} = cfg; const cx=W/2, cy=105, R=76; let s=``; s+=``; for(let k=0;k<60;k++){ const a=(k*6-90)*Math.PI/180, big=(k%5===0); const r1=R-3, r2=R-(big?9:5); s+=``; } for(let k=1;k<=12;k++){ const a=(k*30-90)*Math.PI/180; s+=`${k}`; } const ha=((h%12)*30 + m*0.5 - 90)*Math.PI/180, ma=(m*6-90)*Math.PI/180; s+=``; s+=``; s+=``; if(note) s+=`${note}`; s+=``; return s; } const P=[ { tier:'기초', type:'self', kind:'num', q:'시계가 가리키는 시각은 몇 시 몇 분일까요? (만 숫자로)', fig:clock({h:3,m:10,note:'긴 바늘이 가리키는 숫자 × 5 = 분'}), answer:10, hint:'긴 바늘이 가리키는 숫자 × 5 = 분! (숫자 한 칸 = 5분)', sol:{ ans:'3시 10분', fig:clock({h:3,m:10,note:'3시 10분'}), steps:['숫자 한 칸은 5분이에요.','긴 바늘이 2 를 가리키니 2 × 5 = 10분.','짧은 바늘은 3 을 지났으니 3시 10분.']}}, { tier:'기초', type:'self', kind:'num', q:'시계가 가리키는 시각은 몇 시 몇 분일까요? (만 숫자로)', fig:clock({h:5,m:20,note:'긴 바늘이 가리키는 숫자 × 5 = 분'}), answer:20, hint:'긴 바늘이 가리키는 숫자 × 5 = 분! (숫자 한 칸 = 5분)', sol:{ ans:'5시 20분', fig:clock({h:5,m:20,note:'5시 20분'}), steps:['숫자 한 칸은 5분이에요.','긴 바늘이 4 를 가리키니 4 × 5 = 20분.','짧은 바늘은 5 을 지났으니 5시 20분.']}}, { tier:'기초', type:'self', kind:'num', q:'시계가 가리키는 시각은 몇 시 몇 분일까요? (만 숫자로)', fig:clock({h:7,m:40,note:'긴 바늘이 가리키는 숫자 × 5 = 분'}), answer:40, hint:'긴 바늘이 가리키는 숫자 × 5 = 분! (숫자 한 칸 = 5분)', sol:{ ans:'7시 40분', fig:clock({h:7,m:40,note:'7시 40분'}), steps:['숫자 한 칸은 5분이에요.','긴 바늘이 8 를 가리키니 8 × 5 = 40분.','짧은 바늘은 7 을 지났으니 7시 40분.']}}, { tier:'기초', type:'self', kind:'num', q:'시계가 가리키는 시각은 몇 시 몇 분일까요? (만 숫자로)', fig:clock({h:9,m:50,note:'긴 바늘이 가리키는 숫자 × 5 = 분'}), answer:50, hint:'긴 바늘이 가리키는 숫자 × 5 = 분! (숫자 한 칸 = 5분)', sol:{ ans:'9시 50분', fig:clock({h:9,m:50,note:'9시 50분'}), steps:['숫자 한 칸은 5분이에요.','긴 바늘이 10 를 가리키니 10 × 5 = 50분.','짧은 바늘은 9 을 지났으니 9시 50분.']}}, { tier:'기초', type:'self', kind:'num', q:'시계가 가리키는 시각은 몇 시 몇 분일까요? (만 숫자로)', fig:clock({h:2,m:15,note:'긴 바늘이 가리키는 숫자 × 5 = 분'}), answer:15, hint:'긴 바늘이 가리키는 숫자 × 5 = 분! (숫자 한 칸 = 5분)', sol:{ ans:'2시 15분', fig:clock({h:2,m:15,note:'2시 15분'}), steps:['숫자 한 칸은 5분이에요.','긴 바늘이 3 를 가리키니 3 × 5 = 15분.','짧은 바늘은 2 을 지났으니 2시 15분.']}}, { tier:'기초', type:'self', kind:'num', q:'시계가 가리키는 시각은 몇 시 몇 분일까요? (만 숫자로)', fig:clock({h:4,m:45,note:'긴 바늘이 가리키는 숫자 × 5 = 분'}), answer:45, hint:'긴 바늘이 가리키는 숫자 × 5 = 분! (숫자 한 칸 = 5분)', sol:{ ans:'4시 45분', fig:clock({h:4,m:45,note:'4시 45분'}), steps:['숫자 한 칸은 5분이에요.','긴 바늘이 9 를 가리키니 9 × 5 = 45분.','짧은 바늘은 4 을 지났으니 4시 45분.']}}, { tier:'기초', type:'self', kind:'num', q:'시계가 가리키는 시각은 몇 시 몇 분일까요? (만 숫자로)', fig:clock({h:6,m:25,note:'긴 바늘이 가리키는 숫자 × 5 = 분'}), answer:25, hint:'긴 바늘이 가리키는 숫자 × 5 = 분! (숫자 한 칸 = 5분)', sol:{ ans:'6시 25분', fig:clock({h:6,m:25,note:'6시 25분'}), steps:['숫자 한 칸은 5분이에요.','긴 바늘이 5 를 가리키니 5 × 5 = 25분.','짧은 바늘은 6 을 지났으니 6시 25분.']}}, { tier:'기초', type:'self', kind:'num', q:'시계가 가리키는 시각은 몇 시 몇 분일까요? (만 숫자로)', fig:clock({h:8,m:35,note:'긴 바늘이 가리키는 숫자 × 5 = 분'}), answer:35, hint:'긴 바늘이 가리키는 숫자 × 5 = 분! (숫자 한 칸 = 5분)', sol:{ ans:'8시 35분', fig:clock({h:8,m:35,note:'8시 35분'}), steps:['숫자 한 칸은 5분이에요.','긴 바늘이 7 를 가리키니 7 × 5 = 35분.','짧은 바늘은 8 을 지났으니 8시 35분.']}}, { tier:'기초', type:'self', kind:'num', q:'시계가 가리키는 시각은 몇 시 몇 분일까요? (만 숫자로)', fig:clock({h:11,m:5,note:'긴 바늘이 가리키는 숫자 × 5 = 분'}), answer:5, hint:'긴 바늘이 가리키는 숫자 × 5 = 분! (숫자 한 칸 = 5분)', sol:{ ans:'11시 5분', fig:clock({h:11,m:5,note:'11시 5분'}), steps:['숫자 한 칸은 5분이에요.','긴 바늘이 1 를 가리키니 1 × 5 = 5분.','짧은 바늘은 11 을 지났으니 11시 5분.']}}, { tier:'기초', type:'self', kind:'num', q:'시계가 가리키는 시각은 몇 시 몇 분일까요? (만 숫자로)', fig:clock({h:1,m:55,note:'긴 바늘이 가리키는 숫자 × 5 = 분'}), answer:55, hint:'긴 바늘이 가리키는 숫자 × 5 = 분! (숫자 한 칸 = 5분)', sol:{ ans:'1시 55분', fig:clock({h:1,m:55,note:'1시 55분'}), steps:['숫자 한 칸은 5분이에요.','긴 바늘이 11 를 가리키니 11 × 5 = 55분.','짧은 바늘은 1 을 지났으니 1시 55분.']}}, { tier:'중급', type:'self', kind:'num', q:'긴 바늘이 숫자 1 을(를) 가리키면 몇 분일까요?', fig:null, answer:5, hint:'숫자 한 칸 = 5분이에요. 1 × 5 는?', sol:{ ans:'5분', fig:null, steps:['시계 한 바퀴 60분을 숫자 12칸으로 나누면 한 칸 = 5분.','1 × 5 = 5분.','12를 가리키면 0분(정각), 6이면 30분!']}}, { tier:'중급', type:'self', kind:'num', q:'긴 바늘이 숫자 2 을(를) 가리키면 몇 분일까요?', fig:null, answer:10, hint:'숫자 한 칸 = 5분이에요. 2 × 5 는?', sol:{ ans:'10분', fig:null, steps:['시계 한 바퀴 60분을 숫자 12칸으로 나누면 한 칸 = 5분.','2 × 5 = 10분.','12를 가리키면 0분(정각), 6이면 30분!']}}, { tier:'중급', type:'self', kind:'num', q:'긴 바늘이 숫자 3 을(를) 가리키면 몇 분일까요?', fig:null, answer:15, hint:'숫자 한 칸 = 5분이에요. 3 × 5 는?', sol:{ ans:'15분', fig:null, steps:['시계 한 바퀴 60분을 숫자 12칸으로 나누면 한 칸 = 5분.','3 × 5 = 15분.','12를 가리키면 0분(정각), 6이면 30분!']}}, { tier:'중급', type:'self', kind:'num', q:'긴 바늘이 숫자 4 을(를) 가리키면 몇 분일까요?', fig:null, answer:20, hint:'숫자 한 칸 = 5분이에요. 4 × 5 는?', sol:{ ans:'20분', fig:null, steps:['시계 한 바퀴 60분을 숫자 12칸으로 나누면 한 칸 = 5분.','4 × 5 = 20분.','12를 가리키면 0분(정각), 6이면 30분!']}}, { tier:'중급', type:'self', kind:'num', q:'긴 바늘이 숫자 6 을(를) 가리키면 몇 분일까요?', fig:null, answer:30, hint:'숫자 한 칸 = 5분이에요. 6 × 5 는?', sol:{ ans:'30분', fig:null, steps:['시계 한 바퀴 60분을 숫자 12칸으로 나누면 한 칸 = 5분.','6 × 5 = 30분.','12를 가리키면 0분(정각), 6이면 30분!']}}, { tier:'중급', type:'self', kind:'num', q:'긴 바늘이 숫자 7 을(를) 가리키면 몇 분일까요?', fig:null, answer:35, hint:'숫자 한 칸 = 5분이에요. 7 × 5 는?', sol:{ ans:'35분', fig:null, steps:['시계 한 바퀴 60분을 숫자 12칸으로 나누면 한 칸 = 5분.','7 × 5 = 35분.','12를 가리키면 0분(정각), 6이면 30분!']}}, { tier:'중급', type:'self', kind:'num', q:'긴 바늘이 숫자 8 을(를) 가리키면 몇 분일까요?', fig:null, answer:40, hint:'숫자 한 칸 = 5분이에요. 8 × 5 는?', sol:{ ans:'40분', fig:null, steps:['시계 한 바퀴 60분을 숫자 12칸으로 나누면 한 칸 = 5분.','8 × 5 = 40분.','12를 가리키면 0분(정각), 6이면 30분!']}}, { tier:'중급', type:'self', kind:'num', q:'긴 바늘이 숫자 9 을(를) 가리키면 몇 분일까요?', fig:null, answer:45, hint:'숫자 한 칸 = 5분이에요. 9 × 5 는?', sol:{ ans:'45분', fig:null, steps:['시계 한 바퀴 60분을 숫자 12칸으로 나누면 한 칸 = 5분.','9 × 5 = 45분.','12를 가리키면 0분(정각), 6이면 30분!']}}, { tier:'중급', type:'self', kind:'num', q:'긴 바늘이 숫자 10 을(를) 가리키면 몇 분일까요?', fig:null, answer:50, hint:'숫자 한 칸 = 5분이에요. 10 × 5 는?', sol:{ ans:'50분', fig:null, steps:['시계 한 바퀴 60분을 숫자 12칸으로 나누면 한 칸 = 5분.','10 × 5 = 50분.','12를 가리키면 0분(정각), 6이면 30분!']}}, { tier:'중급', type:'self', kind:'num', q:'긴 바늘이 숫자 11 을(를) 가리키면 몇 분일까요?', fig:null, answer:55, hint:'숫자 한 칸 = 5분이에요. 11 × 5 는?', sol:{ ans:'55분', fig:null, steps:['시계 한 바퀴 60분을 숫자 12칸으로 나누면 한 칸 = 5분.','11 × 5 = 55분.','12를 가리키면 0분(정각), 6이면 30분!']}}, { tier:'상위', type:'self', kind:'num', q:'3시 20분에서 10분이 지나면 몇 분일까요? (분만)', fig:null, answer:30, hint:'분끼리 더하면 돼요. 60분이 넘으면 시간이 하나 올라가요!', sol:{ ans:'30분', fig:null, steps:['분끼리 더해요.','30분.','60분이 되면 1시간으로 올라가니 조심!']}}, { tier:'상위', type:'self', kind:'num', q:'5시 40분에서 5분이 지나면 몇 분일까요? (분만)', fig:null, answer:45, hint:'분끼리 더하면 돼요. 60분이 넘으면 시간이 하나 올라가요!', sol:{ ans:'45분', fig:null, steps:['분끼리 더해요.','45분.','60분이 되면 1시간으로 올라가니 조심!']}}, { tier:'상위', type:'self', kind:'num', q:'7시 15분에서 15분이 지나면 몇 분일까요? (분만)', fig:null, answer:30, hint:'분끼리 더하면 돼요. 60분이 넘으면 시간이 하나 올라가요!', sol:{ ans:'30분', fig:null, steps:['분끼리 더해요.','30분.','60분이 되면 1시간으로 올라가니 조심!']}}, { tier:'상위', type:'self', kind:'num', q:'2시 50분에서 5분이 지나면 몇 분일까요? (분만)', fig:null, answer:55, hint:'분끼리 더하면 돼요. 60분이 넘으면 시간이 하나 올라가요!', sol:{ ans:'55분', fig:null, steps:['분끼리 더해요.','55분.','60분이 되면 1시간으로 올라가니 조심!']}}, { tier:'상위', type:'self', kind:'num', q:'9시 25분에서 20분이 지나면 몇 분일까요? (분만)', fig:null, answer:45, hint:'분끼리 더하면 돼요. 60분이 넘으면 시간이 하나 올라가요!', sol:{ ans:'45분', fig:null, steps:['분끼리 더해요.','45분.','60분이 되면 1시간으로 올라가니 조심!']}}, { tier:'상위', type:'self', kind:'num', q:'3시 50분에서 20분이 지나면 몇 시 몇 분일까요? (만 숫자로)', fig:clock({h:3,m:50,note:'지금은 3시 50분'}), answer:4, hint:'분을 더하면 60이 넘어요! 60분 = 1시간으로 올려 주세요.', sol:{ ans:'4시 10분', fig:clock({h:4,m:10,note:'20분 뒤 = 4시 10분'}), steps:['50 + 20 = 70분.','60분이 넘으므로 60을 빼고 시간에 1을 더해요: 70 − 60 = 10분, 3 + 1 = 4시.','답: 4시 10분.']}}, { tier:'상위', type:'self', kind:'num', q:'5시 45분에서 30분이 지나면 몇 시 몇 분일까요? (만 숫자로)', fig:clock({h:5,m:45,note:'지금은 5시 45분'}), answer:6, hint:'분을 더하면 60이 넘어요! 60분 = 1시간으로 올려 주세요.', sol:{ ans:'6시 15분', fig:clock({h:6,m:15,note:'30분 뒤 = 6시 15분'}), steps:['45 + 30 = 75분.','60분이 넘으므로 60을 빼고 시간에 1을 더해요: 75 − 60 = 15분, 5 + 1 = 6시.','답: 6시 15분.']}}, { tier:'상위', type:'self', kind:'num', q:'8시 40분에서 25분이 지나면 몇 시 몇 분일까요? (만 숫자로)', fig:clock({h:8,m:40,note:'지금은 8시 40분'}), answer:9, hint:'분을 더하면 60이 넘어요! 60분 = 1시간으로 올려 주세요.', sol:{ ans:'9시 5분', fig:clock({h:9,m:5,note:'25분 뒤 = 9시 5분'}), steps:['40 + 25 = 65분.','60분이 넘으므로 60을 빼고 시간에 1을 더해요: 65 − 60 = 5분, 8 + 1 = 9시.','답: 9시 5분.']}}, { tier:'상위', type:'self', kind:'num', q:'11시 55분에서 10분이 지나면 몇 시 몇 분일까요? (만 숫자로)', fig:clock({h:11,m:55,note:'지금은 11시 55분'}), answer:12, hint:'분을 더하면 60이 넘어요! 60분 = 1시간으로 올려 주세요.', sol:{ ans:'12시 5분', fig:clock({h:12,m:5,note:'10분 뒤 = 12시 5분'}), steps:['55 + 10 = 65분.','60분이 넘으므로 60을 빼고 시간에 1을 더해요: 65 − 60 = 5분, 11 + 1 = 12시.','답: 12시 5분.']}}, { tier:'상위', type:'self', kind:'num', q:'2시 35분에서 40분이 지나면 몇 시 몇 분일까요? (만 숫자로)', fig:clock({h:2,m:35,note:'지금은 2시 35분'}), answer:3, hint:'분을 더하면 60이 넘어요! 60분 = 1시간으로 올려 주세요.', sol:{ ans:'3시 15분', fig:clock({h:3,m:15,note:'40분 뒤 = 3시 15분'}), steps:['35 + 40 = 75분.','60분이 넘으므로 60을 빼고 시간에 1을 더해요: 75 − 60 = 15분, 2 + 1 = 3시.','답: 3시 15분.']}}, { tier:'최상위', type:'self', kind:'num', q:'시계 숫자 한 칸은 몇 분일까요?', fig:null, answer:5, hint:'60분 ÷ 12칸 = ?', sol:{ ans:'5분', fig:null, steps:['한 바퀴 = 60분, 숫자는 12개.','60 ÷ 12 = 5분.','그래서 긴 바늘이 3을 가리키면 15분!']}}, { tier:'최상위', type:'self', kind:'num', q:'3시 55분의 5분 뒤는 몇 시일까요? (시만 숫자로)', fig:clock({h:3,m:55,note:'지금은 3시 55분'}), answer:4, hint:'55 + 5 = 60분! 60분은 1시간이에요.', sol:{ ans:'4시 (정각)', fig:clock({h:4,m:0,note:'5분 뒤 = 4시 정각'}), steps:['55 + 5 = 60분.','60분 = 1시간 → 3시 + 1시간 = 4시 정각.','긴 바늘이 12로 돌아와요!']}}, { tier:'최상위', type:'self', kind:'choice', q:'4시 30분과 4시 45분 중 어느 것이 더 늦은 시각일까요?', fig:null, choices:['4시 30분','4시 45분','같다','알 수 없다'], answer:'4시 45분', hint:'같은 시간대면 분이 큰 쪽이 늦어요.', sol:{ ans:'4시 45분', fig:null, steps:['둘 다 4시대예요.','분을 비교: 30 < 45.','4시 45분이 더 늦어요.']}}, { tier:'최상위', type:'self', kind:'num', q:'긴 바늘이 9를 가리키면 몇 분일까요?', fig:null, answer:45, hint:'9 × 5 = ?', sol:{ ans:'45분', fig:null, steps:['9 × 5 = 45분.','12에서 9까지는 4분의 3 바퀴 = 45분.','‘몇 시 45분’이라고 읽어요!']}}, { tier:'최상위', type:'self', kind:'num', q:'1시간은 몇 분일까요?', fig:null, answer:60, hint:'긴 바늘이 한 바퀴 돌면?', sol:{ ans:'60분', fig:null, steps:['긴 바늘이 한 바퀴 = 60분 = 1시간.','숫자 12칸 × 5분 = 60분.','30분은 반 바퀴!']}}, { tier:'최상위', type:'self', kind:'num', q:'6시 30분에서 30분이 지나면 몇 시일까요? (시만 숫자로)', fig:null, answer:7, hint:'30+30 = 60분 = 1시간!', sol:{ ans:'7시', fig:null, steps:['30 + 30 = 60분 = 1시간.','6시 + 1시간 = 7시 정각.','긴 바늘이 12로 와요!']}}, { tier:'최상위', type:'self', kind:'num', q:'긴 바늘이 12를 가리키면 몇 분일까요?', fig:null, answer:0, hint:'정각이에요!', sol:{ ans:'0분 (정각)', fig:null, steps:['12는 시작점 = 0분.','‘몇 시 정각’이라고 읽어요.','한 바퀴 돌아 12로 오면 60분이 지난 거예요!']}}, { tier:'최상위', type:'self', kind:'choice', q:'10시 20분과 10시 2분 중 어느 것이 더 이른 시각일까요?', fig:null, choices:['10시 20분','10시 2분','같다','알 수 없다'], answer:'10시 2분', hint:'분이 작은 쪽이 더 일러요. 20과 2 중 작은 것은?', sol:{ ans:'10시 2분', fig:null, steps:['둘 다 10시대예요.','분 비교: 2 < 20.','10시 2분이 더 일러요. (2분과 20분은 다른 수!)']}}, { tier:'최상위', type:'self', kind:'num', q:'1시간 30분은 모두 몇 분일까요?', fig:null, answer:90, hint:'1시간 = 60분, 거기에 30분을 더하면?', sol:{ ans:'90분', fig:null, steps:['1시간 = 60분.','60 + 30 = 90분.','1시간 30분 = 90분이에요!']}}, { tier:'최상위', type:'self', kind:'num', q:'짧은 바늘이 4와 5 사이, 긴 바늘이 6을 가리킵니다. 몇 시 몇 분일까요? (시만 숫자로)', fig:clock({h:4,m:30,note:'짧은 바늘이 4와 5 사이'}), answer:4, hint:'짧은 바늘이 아직 5를 안 넘었으면 4시! 긴 바늘 6 = 30분.', sol:{ ans:'4시 30분', fig:clock({h:4,m:30,note:'4시 30분'}), steps:['긴 바늘이 6 → 6 × 5 = 30분.','짧은 바늘이 4와 5 사이 = 아직 4시대.','4시 30분. (5시라고 하면 틀려요 — 아직 안 넘었으니까!)']}}, ]; 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:'초2 몇 시 몇 분' }); 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();