YEON PLANNING · 직관수학 (초4)

막대그래프 — 4단계 문제은행

영상으로 배우고 → 직접 풀고 → 답 제출 → 해설. 높이가 곧 크기 — 눈금 한 칸이 얼마인지부터 확인해요.

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

💬 더 필요한 게 있나요?

난이도 조절(더 쉽게 / 더 어렵게) · 다른 유형 · 특정 개념 집중 · 문항 수 등 무엇이든 적어 주세요. 선생님이 확인합니다. (공개 아님)
✏️ 손으로 풀어보세요
`; return s; } // ── 막대그래프 (값은 실제 눈금에 맞춰 그린다) ── function bar(cfg){ const {labels=[], vals=[], step=1, unit='개', note='', W=300, H=250, hi=-1} = cfg; const L=44, B=52, T=22, R=14, PW=W-L-R, PH=H-B-T; const mx=Math.max(...vals), top=Math.ceil(mx/step)*step + step; const bw=PW/vals.length*0.56, gap=PW/vals.length; let s=``; for(let v=0; v<=top; v+=step){ const y=T+PH-(v/top)*PH; s+=``; s+=`${v}`; } vals.forEach((v,i)=>{ const h=(v/top)*PH, x=L+gap*i+(gap-bw)/2, y=T+PH-h; s+=``; s+=`${labels[i]}`; }); s+=``; s+=``; s+=`(${unit})`; if(note) s+=`${note}`; s+=``; return s; } const P=[ { tier:'기초', type:'self', kind:'num', q:'막대그래프에서 월요일에 읽은 책은 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'요일별 읽은 책 수'}), answer:4, hint:'막대 끝이 어느 눈금에 닿는지 보세요. 눈금 한 칸 = 2권이에요!', sol:{ ans:'4권', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', hi:0, note:'월요일 = 4권'}), steps:['막대 끝을 왼쪽 눈금까지 따라가 보세요.','월요일 막대는 4에 닿아요.','눈금 한 칸이 2권이니 칸 수 × 2 로도 셀 수 있어요!']}}, { tier:'기초', type:'self', kind:'num', q:'막대그래프에서 화요일에 읽은 책은 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'요일별 읽은 책 수'}), answer:7, hint:'막대 끝이 어느 눈금에 닿는지 보세요. 눈금 한 칸 = 2권이에요!', sol:{ ans:'7권', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', hi:1, note:'화요일 = 7권'}), steps:['막대 끝을 왼쪽 눈금까지 따라가 보세요.','화요일 막대는 7에 닿아요.','눈금 한 칸이 2권이니 칸 수 × 2 로도 셀 수 있어요!']}}, { tier:'기초', type:'self', kind:'num', q:'막대그래프에서 수요일에 읽은 책은 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'요일별 읽은 책 수'}), answer:3, hint:'막대 끝이 어느 눈금에 닿는지 보세요. 눈금 한 칸 = 2권이에요!', sol:{ ans:'3권', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', hi:2, note:'수요일 = 3권'}), steps:['막대 끝을 왼쪽 눈금까지 따라가 보세요.','수요일 막대는 3에 닿아요.','눈금 한 칸이 2권이니 칸 수 × 2 로도 셀 수 있어요!']}}, { tier:'기초', type:'self', kind:'num', q:'막대그래프에서 목요일에 읽은 책은 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'요일별 읽은 책 수'}), answer:8, hint:'막대 끝이 어느 눈금에 닿는지 보세요. 눈금 한 칸 = 2권이에요!', sol:{ ans:'8권', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', hi:3, note:'목요일 = 8권'}), steps:['막대 끝을 왼쪽 눈금까지 따라가 보세요.','목요일 막대는 8에 닿아요.','눈금 한 칸이 2권이니 칸 수 × 2 로도 셀 수 있어요!']}}, { tier:'기초', type:'self', kind:'num', q:'막대그래프에서 금요일에 읽은 책은 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'요일별 읽은 책 수'}), answer:5, hint:'막대 끝이 어느 눈금에 닿는지 보세요. 눈금 한 칸 = 2권이에요!', sol:{ ans:'5권', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', hi:4, note:'금요일 = 5권'}), steps:['막대 끝을 왼쪽 눈금까지 따라가 보세요.','금요일 막대는 5에 닿아요.','눈금 한 칸이 2권이니 칸 수 × 2 로도 셀 수 있어요!']}}, { tier:'기초', type:'self', kind:'choice', q:'가장 많이 읽은 요일은 언제일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'가장 많이 읽은 요일은?'}), choices:['월','화','수','목'], answer:'목', hint:'막대가 가장 높은 곳을 찾으세요!', sol:{ ans:'목요일 (8권)', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', hi:3, note:'목요일 = 8권 (가장 많음)'}), steps:['막대가 가장 높은 요일을 찾아요.','목요일 막대가 8권으로 가장 높아요.','목요일이에요!']}}, { tier:'기초', type:'self', kind:'choice', q:'가장 적게 읽은 요일은 언제일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'가장 적게 읽은 요일은?'}), choices:['월','화','수','금'], answer:'수', hint:'막대가 가장 낮은 곳을 찾으세요!', sol:{ ans:'수요일 (3권)', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', hi:2, note:'수요일 = 3권 (가장 적음)'}), steps:['막대가 가장 낮은 요일을 찾아요.','수요일 막대가 3권으로 가장 낮아요.','수요일이에요!']}}, { tier:'기초', type:'self', kind:'num', q:'이 그래프에서 눈금 한 칸은 몇 권을 나타낼까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'세로축 눈금 한 칸은?'}), answer:2, hint:'세로축 숫자가 0, 2, 4, 6… 으로 올라가요.', sol:{ ans:'2권', fig:null, steps:['세로축 숫자를 보면 0, 2, 4, 6, 8…','한 칸 올라갈 때마다 2씩 늘어요.','눈금 한 칸을 먼저 확인하는 게 그래프 읽기의 첫걸음이에요!']}}, { tier:'기초', type:'self', kind:'choice', q:'막대가 가장 높은 것은 무엇을 뜻할까요?', fig:null, choices:['가장 많다','가장 적다','평균이다','알 수 없다'], answer:'가장 많다', hint:'막대의 높이는 무엇을 나타내나요?', sol:{ ans:'가장 많다', fig:null, steps:['막대그래프에서 높이 = 크기(양).','가장 높은 막대 = 가장 큰 값.','높이만 봐도 누가 많은지 한눈에 보여요 — 이게 막대그래프의 힘!']}}, { tier:'기초', type:'self', kind:'choice', q:'월요일과 화요일 중 더 많이 읽은 요일은?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'월과 화 중 더 많은 쪽은?'}), choices:['월','화','같다','알 수 없다'], answer:'화', hint:'두 막대의 높이를 비교하세요!', sol:{ ans:'화요일 (7권 > 4권)', fig:null, steps:['월요일 4권, 화요일 7권.','7 > 4 이므로 화요일.','막대그래프는 높이만 비교하면 끝!']}}, { tier:'중급', type:'self', kind:'num', q:'월요일과 화요일에 읽은 책 수의 는 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'월요일과 화요일의 차는?'}), answer:3, hint:'두 막대의 값을 각각 읽고 빼세요.', sol:{ ans:'3권', fig:null, steps:['월요일 = 4권, 화요일 = 7권.','7 − 4 = 3권.','차 = 큰 값 − 작은 값. 막대 높이 차이만큼이에요!']}}, { tier:'중급', type:'self', kind:'num', q:'화요일과 수요일에 읽은 책 수의 는 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'화요일과 수요일의 차는?'}), answer:4, hint:'두 막대의 값을 각각 읽고 빼세요.', sol:{ ans:'4권', fig:null, steps:['화요일 = 7권, 수요일 = 3권.','7 − 3 = 4권.','차 = 큰 값 − 작은 값. 막대 높이 차이만큼이에요!']}}, { tier:'중급', type:'self', kind:'num', q:'수요일과 목요일에 읽은 책 수의 는 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'수요일과 목요일의 차는?'}), answer:5, hint:'두 막대의 값을 각각 읽고 빼세요.', sol:{ ans:'5권', fig:null, steps:['수요일 = 3권, 목요일 = 8권.','8 − 3 = 5권.','차 = 큰 값 − 작은 값. 막대 높이 차이만큼이에요!']}}, { tier:'중급', type:'self', kind:'num', q:'목요일과 금요일에 읽은 책 수의 는 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'목요일과 금요일의 차는?'}), answer:3, hint:'두 막대의 값을 각각 읽고 빼세요.', sol:{ ans:'3권', fig:null, steps:['목요일 = 8권, 금요일 = 5권.','8 − 5 = 3권.','차 = 큰 값 − 작은 값. 막대 높이 차이만큼이에요!']}}, { tier:'중급', type:'self', kind:'num', q:'월요일과 목요일에 읽은 책 수의 는 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'월요일과 목요일의 차는?'}), answer:4, hint:'두 막대의 값을 각각 읽고 빼세요.', sol:{ ans:'4권', fig:null, steps:['월요일 = 4권, 목요일 = 8권.','8 − 4 = 4권.','차 = 큰 값 − 작은 값. 막대 높이 차이만큼이에요!']}}, { tier:'중급', type:'self', kind:'num', q:'화요일과 금요일에 읽은 책 수의 는 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'화요일과 금요일의 차는?'}), answer:2, hint:'두 막대의 값을 각각 읽고 빼세요.', sol:{ ans:'2권', fig:null, steps:['화요일 = 7권, 금요일 = 5권.','7 − 5 = 2권.','차 = 큰 값 − 작은 값. 막대 높이 차이만큼이에요!']}}, { tier:'중급', type:'self', kind:'num', q:'월요일과 금요일에 읽은 책 수의 는 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'월요일과 금요일의 차는?'}), answer:1, hint:'두 막대의 값을 각각 읽고 빼세요.', sol:{ ans:'1권', fig:null, steps:['월요일 = 4권, 금요일 = 5권.','5 − 4 = 1권.','차 = 큰 값 − 작은 값. 막대 높이 차이만큼이에요!']}}, { tier:'중급', type:'self', kind:'num', q:'수요일과 금요일에 읽은 책 수의 는 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'수요일과 금요일의 차는?'}), answer:2, hint:'두 막대의 값을 각각 읽고 빼세요.', sol:{ ans:'2권', fig:null, steps:['수요일 = 3권, 금요일 = 5권.','5 − 3 = 2권.','차 = 큰 값 − 작은 값. 막대 높이 차이만큼이에요!']}}, { tier:'중급', type:'self', kind:'num', q:'월요일과 수요일에 읽은 책 수의 는 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'월요일과 수요일의 차는?'}), answer:1, hint:'두 막대의 값을 각각 읽고 빼세요.', sol:{ ans:'1권', fig:null, steps:['월요일 = 4권, 수요일 = 3권.','4 − 3 = 1권.','차 = 큰 값 − 작은 값. 막대 높이 차이만큼이에요!']}}, { tier:'중급', type:'self', kind:'num', q:'화요일과 목요일에 읽은 책 수의 는 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'화요일과 목요일의 차는?'}), answer:1, hint:'두 막대의 값을 각각 읽고 빼세요.', sol:{ ans:'1권', fig:null, steps:['화요일 = 7권, 목요일 = 8권.','8 − 7 = 1권.','차 = 큰 값 − 작은 값. 막대 높이 차이만큼이에요!']}}, { tier:'상위', type:'self', kind:'num', q:'월·화요일에 읽은 책은 모두 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'월·화요일을 모두 더하면?'}), answer:11, hint:'해당 요일의 값을 모두 더하세요.', sol:{ ans:'11권', fig:null, steps:['월=4 + 화=7','4 + 7 = 11권.','여러 막대를 합칠 땐 값을 읽어서 더하면 돼요!']}}, { tier:'상위', type:'self', kind:'num', q:'월·화·수요일에 읽은 책은 모두 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'월·화·수요일을 모두 더하면?'}), answer:14, hint:'해당 요일의 값을 모두 더하세요.', sol:{ ans:'14권', fig:null, steps:['월=4 + 화=7 + 수=3','4 + 7 + 3 = 14권.','여러 막대를 합칠 땐 값을 읽어서 더하면 돼요!']}}, { tier:'상위', type:'self', kind:'num', q:'수·목요일에 읽은 책은 모두 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'수·목요일을 모두 더하면?'}), answer:11, hint:'해당 요일의 값을 모두 더하세요.', sol:{ ans:'11권', fig:null, steps:['수=3 + 목=8','3 + 8 = 11권.','여러 막대를 합칠 땐 값을 읽어서 더하면 돼요!']}}, { tier:'상위', type:'self', kind:'num', q:'목·금요일에 읽은 책은 모두 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'목·금요일을 모두 더하면?'}), answer:13, hint:'해당 요일의 값을 모두 더하세요.', sol:{ ans:'13권', fig:null, steps:['목=8 + 금=5','8 + 5 = 13권.','여러 막대를 합칠 땐 값을 읽어서 더하면 돼요!']}}, { tier:'상위', type:'self', kind:'num', q:'월·금요일에 읽은 책은 모두 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'월·금요일을 모두 더하면?'}), answer:9, hint:'해당 요일의 값을 모두 더하세요.', sol:{ ans:'9권', fig:null, steps:['월=4 + 금=5','4 + 5 = 9권.','여러 막대를 합칠 땐 값을 읽어서 더하면 돼요!']}}, { tier:'상위', type:'self', kind:'num', q:'5일 동안 읽은 책은 모두 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'5일 전체 합은?'}), answer:27, hint:'다섯 막대의 값을 모두 더하세요.', sol:{ ans:'27권', fig:null, steps:['4 + 7 + 3 + 8 + 5.','= 27권.','전체 합 = 모든 막대 값의 합!']}}, { tier:'상위', type:'self', kind:'num', q:'가장 많은 날과 가장 적은 날의 차는 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'가장 높은 막대와 가장 낮은 막대의 차는?'}), answer:5, hint:'가장 높은 막대 − 가장 낮은 막대!', sol:{ ans:'5권', fig:null, steps:['가장 많음 = 목요일 8권, 가장 적음 = 수요일 3권.','8 − 3 = 5권.','가장 높은 막대와 가장 낮은 막대의 높이 차이예요!']}}, { tier:'상위', type:'self', kind:'num', q:'5권보다 많이 읽은 날은 며칠일까요?', fig:null, answer:2, hint:'5권 눈금보다 막대가 높은 날을 세세요.', sol:{ ans:'2일 (화·목)', fig:null, steps:['5보다 큰 값: 화(7), 목(8).','월(4)·수(3)·금(5)는 5보다 크지 않아요.','그래서 2일이에요! (5권인 금요일은 「많이」가 아니에요)']}}, { tier:'상위', type:'self', kind:'num', q:'4권 이하로 읽은 날은 며칠일까요?', fig:null, answer:2, hint:'4보다 작거나 같은 막대를 세세요.', sol:{ ans:'2일 (월·수)', fig:null, steps:['4 이하인 값: 월(4), 수(3).','화(7)·목(8)·금(5)는 4보다 커요.','그래서 2일이에요!']}}, { tier:'상위', type:'self', kind:'num', q:'3권보다 많이 읽은 날은 며칠일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'3권보다 많은 날은 며칠?'}), answer:4, hint:'3보다 큰 막대를 세세요: 4, 7, 3, 8, 5', sol:{ ans:'4일 (월·화·목·금)', fig:null, steps:['3보다 큰 값: 월(4), 화(7), 목(8), 금(5).','수(3)만 3보다 크지 않아요.','그래서 4일이에요!']}}, { tier:'최상위', type:'self', kind:'num', q:'5일 동안 하루 평균 몇 권을 읽었을까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'막대를 고르게 펴면 몇 권이 될까요?'}), answer:5.4, hint:'전체 합 27을 5일로 나누세요.', sol:{ ans:'5.4권', fig:null, steps:['전체 합 = 4 + 7 + 3 + 8 + 5 = 27권.','27 ÷ 5 = 5.4권.','평균 = 전체 합 ÷ 개수. 막대를 똑같은 높이로 고르게 편 셈이에요!']}}, { tier:'최상위', type:'self', kind:'num', q:'눈금 한 칸이 1권으로 바뀌면 목요일 막대의 칸 수는 몇 칸일까요?', fig:null, answer:8, hint:'8권을 한 칸 1권으로 세면?', sol:{ ans:'8칸', fig:null, steps:['목요일 = 8권.','한 칸 = 1권 → 8 ÷ 1 = 8칸.','눈금이 작아지면 칸 수가 늘어요 — 값은 그대로인데 그림만 커져요!']}}, { tier:'최상위', type:'self', kind:'num', q:'눈금 한 칸이 4권으로 바뀌면 목요일 막대의 칸 수는 몇 칸일까요?', fig:null, answer:2, hint:'8권을 한 칸 4권으로 세면?', sol:{ ans:'2칸', fig:null, steps:['목요일 = 8권.','한 칸 = 4권 → 8 ÷ 4 = 2칸.','눈금이 커지면 칸 수가 줄어요. 그래프가 작아 보여도 값은 그대로!']}}, { tier:'최상위', type:'self', kind:'num', q:'토요일에 6권을 더 읽었다면 전체는 몇 권이 될까요?', fig:null, answer:33, hint:'27 + 6 = ?', sol:{ ans:'33권', fig:null, steps:['지금까지 5일 합 = 27권.','27 + 6 = 33권.','막대를 하나 더 추가하는 것과 같아요!']}}, { tier:'최상위', type:'self', kind:'choice', q:'막대그래프와 표 중 많고 적음을 한눈에 보기 좋은 것은?', fig:null, choices:['막대그래프','표','둘 다 같다','알 수 없다'], answer:'막대그래프', hint:'숫자만 적힌 표와 그림으로 그린 막대 — 어느 쪽이 빨리 보일까요?', sol:{ ans:'막대그래프', fig:null, steps:['표는 정확한 숫자를 알기 좋아요.','막대그래프는 높이로 크기가 바로 보여요.','많고 적음을 한눈에 비교할 땐 막대그래프가 좋아요!']}}, { tier:'최상위', type:'self', kind:'choice', q:'막대그래프에서 막대의 굵기가 달라지면 값도 달라질까요?', fig:null, choices:['달라진다','아니다','2배가 된다','알 수 없다'], answer:'아니다', hint:'값을 나타내는 건 막대의 높이예요. 굵기는요?', sol:{ ans:'아니다 (높이만 값을 나타낸다)', fig:null, steps:['막대그래프에서 값을 나타내는 건 높이뿐이에요.','굵기는 보기 좋으라고 정한 것.','굵기가 달라져도 값은 그대로예요!']}}, { tier:'최상위', type:'self', kind:'num', q:'목요일 막대의 높이는 수요일 막대의 몇 배일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', note:'목요일 막대는 월요일 막대의 몇 배?'}), answer:2, hint:'8은 3의 몇 배쯤일까요? 정확히 나눠 보세요… 라기엔 8 ÷ 3이 딱 안 떨어져요. 대신 화요일과 비교해 볼까요? 힌트: 8 ÷ 4 = 2 (목요일과 월요일)', sol:{ ans:'2배 (목 8권 ÷ 월 4권)', fig:null, steps:['목요일 = 8권, 월요일 = 4권.','8 ÷ 4 = 2배.','막대 높이가 2배면 값도 2배 — 높이와 값이 그대로 이어져요!']}}, { tier:'최상위', type:'self', kind:'choice', q:'막대그래프를 그릴 때 눈금 한 칸을 얼마로 정할지는 무엇을 보고 결정할까요?', fig:null, choices:['가장 큰 값','가장 작은 값','막대 개수','제목 길이'], answer:'가장 큰 값', hint:'8권까지 있는데 한 칸을 100권으로 하면 막대가 어떻게 보일까요?', sol:{ ans:'가장 큰 값', fig:null, steps:['한 칸을 너무 크게 잡으면 막대가 다 납작해져 구분이 안 돼요.','너무 작게 잡으면 종이 밖으로 나가요.','가장 큰 값이 알맞게 들어갈 만큼 정해요!']}}, { tier:'최상위', type:'self', kind:'num', q:'막대 하나가 눈금 3칸 반을 차지하고 한 칸이 2권이면 몇 권일까요?', fig:bar({labels:['월','화','수','목','금'], vals:[4,7,3,8,5], step:2, unit:'권', hi:1, note:'화요일 막대 = 3칸 반'}), answer:7, hint:'3칸 반 = 3.5칸. 한 칸이 2권이니?', sol:{ ans:'7권', fig:null, steps:['3칸 반 = 3.5칸.','한 칸 = 2권 → 3.5 × 2 = 7권.','칸이 딱 안 떨어져도 눈금을 알면 값을 읽을 수 있어요! (화요일이 바로 이 경우예요)']}}, { tier:'최상위', type:'self', kind:'choice', q:'막대그래프에서 세로축의 0을 지우고 중간부터 그리면 어떤 문제가 생길까요?', fig:null, choices:['차이가 과장돼 보인다','차이가 작아 보인다','똑같다','알 수 없다'], answer:'차이가 과장돼 보인다', hint:'아래를 잘라내면 남은 막대들의 차이가 어떻게 보일까요?', sol:{ ans:'차이가 과장돼 보인다', fig:null, steps:['0부터 그리면 막대 높이가 값에 그대로 비례해요.','중간부터 그리면 아래가 잘려 차이만 확대돼 보여요.','⚠️ 값은 같은데 차이가 커 보이게 속일 수 있어요 — 그래프를 볼 땐 0부터인지 확인!']}}, ]; 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();