✍️ 연플래닝 오리지널 — 「아하! 보이는 직관수학」 자체 제작. 모든 문제·정답 손검산 완료. 답안을 제출해야 해설·정답이 열립니다(먼저 스스로 풀어 보세요).
💬 더 필요한 게 있나요?
난이도 조절(더 쉽게 / 더 어렵게) · 다른 유형 · 특정 개념 집중 · 문항 수 등 무엇이든 적어 주세요. 선생님이 확인합니다. (공개 아님)
`; return s;
}
// ── 넓이 모델 격자 (분수 × 분수 = 겹친 칸 / 전체 칸) ──
// cols=3,colShade=2 → 세로 3줄 중 2줄(2/3) · rows=4,rowShade=3 → 가로 4칸 중 3칸(3/4)
function gridAB(cfg){
const {cols=3, colShade=0, rows=4, rowShade=0, note='', reveal=false, S=210} = cfg;
const pad=34, W=S+pad*2, H=S+pad+34, cw=S/cols, rh=S/rows;
let s=``; return s;
}
const P=[
{ tier:'기초', type:'self', kind:'num',
q:'2/3 × 3/4 을(를) 계산하세요. (기약분수로)',
fig:gridAB({cols:3,colShade:2,rows:4,rowShade:3,note:'세로 2/3 와 가로 3/4 가 겹치는 곳은?'}),
answer:0.5,
hint:'분자끼리, 분모끼리 곱해요. 그림에선 겹친 칸 ÷ 전체 칸!',
sol:{ ans:'1/2', fig:gridAB({cols:3,colShade:2,rows:4,rowShade:3,reveal:true,note:'6/12 = 1/2'}),
steps:['분자끼리: 2 × 3 = 6. 분모끼리: 3 × 4 = 12.','6/12 을 약분하면 1/2.','그림: 전체 12칸 중 겹친 6칸 = 6/12 = 1/2.']}},
{ tier:'기초', type:'self', kind:'num',
q:'1/2 × 2/3 을(를) 계산하세요. (기약분수로)',
fig:gridAB({cols:2,colShade:1,rows:3,rowShade:2,note:'세로 1/2 와 가로 2/3 가 겹치는 곳은?'}),
answer:0.3333333333,
hint:'분자끼리, 분모끼리 곱해요. 그림에선 겹친 칸 ÷ 전체 칸!',
sol:{ ans:'1/3', fig:gridAB({cols:2,colShade:1,rows:3,rowShade:2,reveal:true,note:'2/6 = 1/3'}),
steps:['분자끼리: 1 × 2 = 2. 분모끼리: 2 × 3 = 6.','2/6 을 약분하면 1/3.','그림: 전체 6칸 중 겹친 2칸 = 2/6 = 1/3.']}},
{ tier:'기초', type:'self', kind:'num',
q:'2/3 × 1/4 을(를) 계산하세요. (기약분수로)',
fig:gridAB({cols:3,colShade:2,rows:4,rowShade:1,note:'세로 2/3 와 가로 1/4 가 겹치는 곳은?'}),
answer:0.1666666667,
hint:'분자끼리, 분모끼리 곱해요. 그림에선 겹친 칸 ÷ 전체 칸!',
sol:{ ans:'1/6', fig:gridAB({cols:3,colShade:2,rows:4,rowShade:1,reveal:true,note:'2/12 = 1/6'}),
steps:['분자끼리: 2 × 1 = 2. 분모끼리: 3 × 4 = 12.','2/12 을 약분하면 1/6.','그림: 전체 12칸 중 겹친 2칸 = 2/12 = 1/6.']}},
{ tier:'기초', type:'self', kind:'num',
q:'3/4 × 2/5 을(를) 계산하세요. (기약분수로)',
fig:gridAB({cols:4,colShade:3,rows:5,rowShade:2,note:'세로 3/4 와 가로 2/5 가 겹치는 곳은?'}),
answer:0.3,
hint:'분자끼리, 분모끼리 곱해요. 그림에선 겹친 칸 ÷ 전체 칸!',
sol:{ ans:'3/10', fig:gridAB({cols:4,colShade:3,rows:5,rowShade:2,reveal:true,note:'6/20 = 3/10'}),
steps:['분자끼리: 3 × 2 = 6. 분모끼리: 4 × 5 = 20.','6/20 을 약분하면 3/10.','그림: 전체 20칸 중 겹친 6칸 = 6/20 = 3/10.']}},
{ tier:'기초', type:'self', kind:'num',
q:'1/3 × 3/5 을(를) 계산하세요. (기약분수로)',
fig:gridAB({cols:3,colShade:1,rows:5,rowShade:3,note:'세로 1/3 와 가로 3/5 가 겹치는 곳은?'}),
answer:0.2,
hint:'분자끼리, 분모끼리 곱해요. 그림에선 겹친 칸 ÷ 전체 칸!',
sol:{ ans:'1/5', fig:gridAB({cols:3,colShade:1,rows:5,rowShade:3,reveal:true,note:'3/15 = 1/5'}),
steps:['분자끼리: 1 × 3 = 3. 분모끼리: 3 × 5 = 15.','3/15 을 약분하면 1/5.','그림: 전체 15칸 중 겹친 3칸 = 3/15 = 1/5.']}},
{ tier:'기초', type:'self', kind:'num',
q:'2/5 × 3/4 을(를) 계산하세요. (기약분수로)',
fig:gridAB({cols:5,colShade:2,rows:4,rowShade:3,note:'세로 2/5 와 가로 3/4 가 겹치는 곳은?'}),
answer:0.3,
hint:'분자끼리, 분모끼리 곱해요. 그림에선 겹친 칸 ÷ 전체 칸!',
sol:{ ans:'3/10', fig:gridAB({cols:5,colShade:2,rows:4,rowShade:3,reveal:true,note:'6/20 = 3/10'}),
steps:['분자끼리: 2 × 3 = 6. 분모끼리: 5 × 4 = 20.','6/20 을 약분하면 3/10.','그림: 전체 20칸 중 겹친 6칸 = 6/20 = 3/10.']}},
{ tier:'기초', type:'self', kind:'num',
q:'3/5 × 1/2 을(를) 계산하세요. (기약분수로)',
fig:gridAB({cols:5,colShade:3,rows:2,rowShade:1,note:'세로 3/5 와 가로 1/2 가 겹치는 곳은?'}),
answer:0.3,
hint:'분자끼리, 분모끼리 곱해요. 그림에선 겹친 칸 ÷ 전체 칸!',
sol:{ ans:'3/10', fig:gridAB({cols:5,colShade:3,rows:2,rowShade:1,reveal:true,note:'3/10 = 3/10'}),
steps:['분자끼리: 3 × 1 = 3. 분모끼리: 5 × 2 = 10.','3/10 을 약분하면 3/10.','그림: 전체 10칸 중 겹친 3칸 = 3/10 = 3/10.']}},
{ tier:'기초', type:'self', kind:'num',
q:'1/4 × 2/3 을(를) 계산하세요. (기약분수로)',
fig:gridAB({cols:4,colShade:1,rows:3,rowShade:2,note:'세로 1/4 와 가로 2/3 가 겹치는 곳은?'}),
answer:0.1666666667,
hint:'분자끼리, 분모끼리 곱해요. 그림에선 겹친 칸 ÷ 전체 칸!',
sol:{ ans:'1/6', fig:gridAB({cols:4,colShade:1,rows:3,rowShade:2,reveal:true,note:'2/12 = 1/6'}),
steps:['분자끼리: 1 × 2 = 2. 분모끼리: 4 × 3 = 12.','2/12 을 약분하면 1/6.','그림: 전체 12칸 중 겹친 2칸 = 2/12 = 1/6.']}},
{ tier:'기초', type:'self', kind:'num',
q:'4/5 × 1/2 을(를) 계산하세요. (기약분수로)',
fig:gridAB({cols:5,colShade:4,rows:2,rowShade:1,note:'세로 4/5 와 가로 1/2 가 겹치는 곳은?'}),
answer:0.4,
hint:'분자끼리, 분모끼리 곱해요. 그림에선 겹친 칸 ÷ 전체 칸!',
sol:{ ans:'2/5', fig:gridAB({cols:5,colShade:4,rows:2,rowShade:1,reveal:true,note:'4/10 = 2/5'}),
steps:['분자끼리: 4 × 1 = 4. 분모끼리: 5 × 2 = 10.','4/10 을 약분하면 2/5.','그림: 전체 10칸 중 겹친 4칸 = 4/10 = 2/5.']}},
{ tier:'기초', type:'self', kind:'num',
q:'2/3 × 2/5 을(를) 계산하세요. (기약분수로)',
fig:gridAB({cols:3,colShade:2,rows:5,rowShade:2,note:'세로 2/3 와 가로 2/5 가 겹치는 곳은?'}),
answer:0.2666666667,
hint:'분자끼리, 분모끼리 곱해요. 그림에선 겹친 칸 ÷ 전체 칸!',
sol:{ ans:'4/15', fig:gridAB({cols:3,colShade:2,rows:5,rowShade:2,reveal:true,note:'4/15 = 4/15'}),
steps:['분자끼리: 2 × 2 = 4. 분모끼리: 3 × 5 = 15.','4/15 을 약분하면 4/15.','그림: 전체 15칸 중 겹친 4칸 = 4/15 = 4/15.']}},
{ tier:'중급', type:'self', kind:'num',
q:'2/3 × 6 을(를) 계산하세요. (기약분수 또는 대분수로)',
fig:null,
answer:4.0,
hint:'자연수는 분모가 1인 분수! 6 = 6/1 로 보고 분자끼리 곱해요.',
sol:{ ans:'4', fig:null,
steps:['6 = 6/1 → 2/3 × 6/1 = 12/3.','약분하면 4.','먼저 약분하고 곱하면 더 쉬워요!']}},
{ tier:'중급', type:'self', kind:'num',
q:'3/4 × 8 을(를) 계산하세요. (기약분수 또는 대분수로)',
fig:null,
answer:6.0,
hint:'자연수는 분모가 1인 분수! 8 = 8/1 로 보고 분자끼리 곱해요.',
sol:{ ans:'6', fig:null,
steps:['8 = 8/1 → 3/4 × 8/1 = 24/4.','약분하면 6.','먼저 약분하고 곱하면 더 쉬워요!']}},
{ tier:'중급', type:'self', kind:'num',
q:'5/6 × 3 을(를) 계산하세요. (기약분수 또는 대분수로)',
fig:null,
answer:2.5,
hint:'자연수는 분모가 1인 분수! 3 = 3/1 로 보고 분자끼리 곱해요.',
sol:{ ans:'2 1/2 (= 5/2)', fig:null,
steps:['3 = 3/1 → 5/6 × 3/1 = 15/6.','약분하면 2 1/2 (= 5/2).','먼저 약분하고 곱하면 더 쉬워요!']}},
{ tier:'중급', type:'self', kind:'num',
q:'2/5 × 10 을(를) 계산하세요. (기약분수 또는 대분수로)',
fig:null,
answer:4.0,
hint:'자연수는 분모가 1인 분수! 10 = 10/1 로 보고 분자끼리 곱해요.',
sol:{ ans:'4', fig:null,
steps:['10 = 10/1 → 2/5 × 10/1 = 20/5.','약분하면 4.','먼저 약분하고 곱하면 더 쉬워요!']}},
{ tier:'중급', type:'self', kind:'num',
q:'3/8 × 4 을(를) 계산하세요. (기약분수 또는 대분수로)',
fig:null,
answer:1.5,
hint:'자연수는 분모가 1인 분수! 4 = 4/1 로 보고 분자끼리 곱해요.',
sol:{ ans:'1 1/2 (= 3/2)', fig:null,
steps:['4 = 4/1 → 3/8 × 4/1 = 12/8.','약분하면 1 1/2 (= 3/2).','먼저 약분하고 곱하면 더 쉬워요!']}},
{ tier:'중급', type:'self', kind:'num',
q:'1/6 × 9 을(를) 계산하세요. (기약분수 또는 대분수로)',
fig:null,
answer:1.5,
hint:'자연수는 분모가 1인 분수! 9 = 9/1 로 보고 분자끼리 곱해요.',
sol:{ ans:'1 1/2 (= 3/2)', fig:null,
steps:['9 = 9/1 → 1/6 × 9/1 = 9/6.','약분하면 1 1/2 (= 3/2).','먼저 약분하고 곱하면 더 쉬워요!']}},
{ tier:'중급', type:'self', kind:'num',
q:'4/7 × 14 을(를) 계산하세요. (기약분수 또는 대분수로)',
fig:null,
answer:8.0,
hint:'자연수는 분모가 1인 분수! 14 = 14/1 로 보고 분자끼리 곱해요.',
sol:{ ans:'8', fig:null,
steps:['14 = 14/1 → 4/7 × 14/1 = 56/7.','약분하면 8.','먼저 약분하고 곱하면 더 쉬워요!']}},
{ tier:'중급', type:'self', kind:'num',
q:'5/9 × 6 을(를) 계산하세요. (기약분수 또는 대분수로)',
fig:null,
answer:3.3333333333,
hint:'자연수는 분모가 1인 분수! 6 = 6/1 로 보고 분자끼리 곱해요.',
sol:{ ans:'3 1/3 (= 10/3)', fig:null,
steps:['6 = 6/1 → 5/9 × 6/1 = 30/9.','약분하면 3 1/3 (= 10/3).','먼저 약분하고 곱하면 더 쉬워요!']}},
{ tier:'중급', type:'self', kind:'num',
q:'3/10 × 5 을(를) 계산하세요. (기약분수 또는 대분수로)',
fig:null,
answer:1.5,
hint:'자연수는 분모가 1인 분수! 5 = 5/1 로 보고 분자끼리 곱해요.',
sol:{ ans:'1 1/2 (= 3/2)', fig:null,
steps:['5 = 5/1 → 3/10 × 5/1 = 15/10.','약분하면 1 1/2 (= 3/2).','먼저 약분하고 곱하면 더 쉬워요!']}},
{ tier:'중급', type:'self', kind:'num',
q:'7/8 × 4 을(를) 계산하세요. (기약분수 또는 대분수로)',
fig:null,
answer:3.5,
hint:'자연수는 분모가 1인 분수! 4 = 4/1 로 보고 분자끼리 곱해요.',
sol:{ ans:'3 1/2 (= 7/2)', fig:null,
steps:['4 = 4/1 → 7/8 × 4/1 = 28/8.','약분하면 3 1/2 (= 7/2).','먼저 약분하고 곱하면 더 쉬워요!']}},
{ tier:'상위', type:'self', kind:'num',
q:'리본 1 m 의 2/3 를 쓰고, 그중 다시 1/2 을 썼습니다. 처음 리본의 얼마를 썼을까요?',
fig:gridAB({cols:3,colShade:2,rows:2,rowShade:1,note:'2/3 의 1/2'}),
answer:0.3333333333,
hint:'‘~의 ~’ = 곱셈! 2/3 × 1/2 를 계산하세요.',
sol:{ ans:'1/3', fig:gridAB({cols:3,colShade:2,rows:2,rowShade:1,reveal:true,note:'답 1/3'}),
steps:['‘부분의 부분’은 곱셈이에요: 2/3 × 1/2.','분자끼리·분모끼리 곱하면 2/6 → 약분하면 1/3.','그림으로 보면 겹친 칸이 바로 답이에요.']}},
{ tier:'상위', type:'self', kind:'num',
q:'케이크의 3/4 중에서 2/3 를 먹었습니다. 케이크 전체의 얼마를 먹었을까요?',
fig:gridAB({cols:4,colShade:3,rows:3,rowShade:2,note:'3/4 의 2/3'}),
answer:0.5,
hint:'‘~의 ~’ = 곱셈! 3/4 × 2/3 를 계산하세요.',
sol:{ ans:'1/2', fig:gridAB({cols:4,colShade:3,rows:3,rowShade:2,reveal:true,note:'답 1/2'}),
steps:['‘부분의 부분’은 곱셈이에요: 3/4 × 2/3.','분자끼리·분모끼리 곱하면 6/12 → 약분하면 1/2.','그림으로 보면 겹친 칸이 바로 답이에요.']}},
{ tier:'상위', type:'self', kind:'num',
q:'밭 전체의 2/5 에 배추를 심고, 그 배추밭의 1/2 에 물을 줬습니다. 물을 준 곳은 밭 전체의 얼마일까요?',
fig:gridAB({cols:5,colShade:2,rows:2,rowShade:1,note:'2/5 의 1/2'}),
answer:0.2,
hint:'‘~의 ~’ = 곱셈! 2/5 × 1/2 를 계산하세요.',
sol:{ ans:'1/5', fig:gridAB({cols:5,colShade:2,rows:2,rowShade:1,reveal:true,note:'답 1/5'}),
steps:['‘부분의 부분’은 곱셈이에요: 2/5 × 1/2.','분자끼리·분모끼리 곱하면 2/10 → 약분하면 1/5.','그림으로 보면 겹친 칸이 바로 답이에요.']}},
{ tier:'상위', type:'self', kind:'num',
q:'색종이 1장의 3/5 를 잘라, 그 조각의 1/3 을 다시 잘랐습니다. 처음 색종이의 얼마일까요?',
fig:gridAB({cols:5,colShade:3,rows:3,rowShade:1,note:'3/5 의 1/3'}),
answer:0.2,
hint:'‘~의 ~’ = 곱셈! 3/5 × 1/3 를 계산하세요.',
sol:{ ans:'1/5', fig:gridAB({cols:5,colShade:3,rows:3,rowShade:1,reveal:true,note:'답 1/5'}),
steps:['‘부분의 부분’은 곱셈이에요: 3/5 × 1/3.','분자끼리·분모끼리 곱하면 3/15 → 약분하면 1/5.','그림으로 보면 겹친 칸이 바로 답이에요.']}},
{ tier:'상위', type:'self', kind:'num',
q:'물통의 4/5 만큼 물이 있었는데, 그 물의 3/4 을 썼습니다. 쓴 물은 물통 전체의 얼마일까요?',
fig:gridAB({cols:5,colShade:4,rows:4,rowShade:3,note:'4/5 의 3/4'}),
answer:0.6,
hint:'‘~의 ~’ = 곱셈! 4/5 × 3/4 를 계산하세요.',
sol:{ ans:'3/5', fig:gridAB({cols:5,colShade:4,rows:4,rowShade:3,reveal:true,note:'답 3/5'}),
steps:['‘부분의 부분’은 곱셈이에요: 4/5 × 3/4.','분자끼리·분모끼리 곱하면 12/20 → 약분하면 3/5.','그림으로 보면 겹친 칸이 바로 답이에요.']}},
{ tier:'상위', type:'self', kind:'num',
q:'1 1/2 × 2/3 을(를) 계산하세요. (기약분수 또는 대분수로)',
fig:null,
answer:1.0,
hint:'대분수는 먼저 가분수로! 1 1/2 = 3/2.',
sol:{ ans:'1', fig:null,
steps:['가분수로: 1 1/2 = 3/2.','3/2 × 2/3 = 6/6.','약분하면 1.']}},
{ tier:'상위', type:'self', kind:'num',
q:'2 1/3 × 3/4 을(를) 계산하세요. (기약분수 또는 대분수로)',
fig:null,
answer:1.75,
hint:'대분수는 먼저 가분수로! 2 1/3 = 7/3.',
sol:{ ans:'1 3/4 (= 7/4)', fig:null,
steps:['가분수로: 2 1/3 = 7/3.','7/3 × 3/4 = 21/12.','약분하면 1 3/4 (= 7/4).']}},
{ tier:'상위', type:'self', kind:'num',
q:'1 2/5 × 5/6 을(를) 계산하세요. (기약분수 또는 대분수로)',
fig:null,
answer:1.1666666667,
hint:'대분수는 먼저 가분수로! 1 2/5 = 7/5.',
sol:{ ans:'1 1/6 (= 7/6)', fig:null,
steps:['가분수로: 1 2/5 = 7/5.','7/5 × 5/6 = 35/30.','약분하면 1 1/6 (= 7/6).']}},
{ tier:'상위', type:'self', kind:'num',
q:'3 1/2 × 2/7 을(를) 계산하세요. (기약분수 또는 대분수로)',
fig:null,
answer:1.0,
hint:'대분수는 먼저 가분수로! 3 1/2 = 7/2.',
sol:{ ans:'1', fig:null,
steps:['가분수로: 3 1/2 = 7/2.','7/2 × 2/7 = 14/14.','약분하면 1.']}},
{ tier:'상위', type:'self', kind:'num',
q:'1 3/4 × 4/5 을(를) 계산하세요. (기약분수 또는 대분수로)',
fig:null,
answer:1.4,
hint:'대분수는 먼저 가분수로! 1 3/4 = 7/4.',
sol:{ ans:'1 2/5 (= 7/5)', fig:null,
steps:['가분수로: 1 3/4 = 7/4.','7/4 × 4/5 = 28/20.','약분하면 1 2/5 (= 7/5).']}},
{ tier:'최상위', type:'self', kind:'num',
q:'□ × 3/4 = 1/2 일 때, □ 에 알맞은 수는? (기약분수로)',
fig:null,
answer:0.6666666667,
hint:'곱셈을 거꾸로 = 나눗셈! □ = 1/2 ÷ 3/4.',
sol:{ ans:'2/3', fig:null,
steps:['□ × 3/4 = 1/2 → □ = 1/2 ÷ 3/4.','1/2 ÷ 3/4 = 1/2 × 4/3 = 4/6 = 2/3.','확인: 2/3 × 3/4 = 6/12 = 1/2 ✓']}},
{ tier:'최상위', type:'self', kind:'choice',
q:'2/3 × 3/4 와 2/3 + 3/4 중 어느 것이 더 클까요?',
fig:null,
choices:['2/3 × 3/4 가 크다','2/3 + 3/4 가 크다','두 값은 같다','알 수 없다'], answer:'2/3 + 3/4 가 크다',
hint:'곱셈 결과는 1/2, 덧셈 결과는? 1보다 작은 수끼리 곱하면 어떻게 되나요?',
sol:{ ans:'2/3 + 3/4 가 크다 (17/12 > 1/2)', fig:null,
steps:['2/3 × 3/4 = 6/12 = 1/2.','2/3 + 3/4 = 8/12 + 9/12 = 17/12 (1보다 큼).','덧셈이 더 커요. 1보다 작은 수끼리 곱하면 오히려 작아지니까요!']}},
{ tier:'최상위', type:'self', kind:'choice',
q:'0보다 큰 어떤 수에 1보다 작은 진분수를 곱하면, 결과는 원래 수와 비교해 어떻게 될까요?',
fig:null,
choices:['원래 수보다 커진다','원래 수보다 작아진다','원래 수와 같다','알 수 없다'], answer:'원래 수보다 작아진다',
hint:'예: 8 × 1/2 = 4 — 8보다 작아졌죠?',
sol:{ ans:'원래 수보다 작아진다', fig:null,
steps:['1보다 작은 진분수를 곱하기 = 원래의 일부만 갖기(1/2배 = 절반).','예: 8 × 1/2 = 4, 2/3 × 3/4 = 1/2 — 모두 작아져요.','그래서 원래 수보다 작아집니다.','⚠️ 단, 0보다 큰 수일 때예요 — 0이나 음수는 달라져요.']}},
{ tier:'최상위', type:'self', kind:'num',
q:'1/2 × 2/3 × 3/4 을(를) 계산하세요. (기약분수로)',
fig:null,
answer:0.25,
hint:'분자끼리 다 곱하고, 분모끼리 다 곱해요. 먼저 약분하면 훨씬 쉬워요!',
sol:{ ans:'1/4', fig:null,
steps:['분자끼리: 1×2×3 = 6. 분모끼리: 2×3×4 = 24.','6/24 = 1/4.','약분 먼저: 2와 2, 3과 3이 지워져 1/2 × 1/1 × 1/2 = 1/4 — 같은 답이죠!']}},
{ tier:'최상위', type:'self', kind:'num',
q:'어떤 수에 2/5 를 곱했더니 4/15 가 되었습니다. 어떤 수는? (기약분수로)',
fig:null,
answer:0.6666666667,
hint:'어떤 수 = 4/15 ÷ 2/5 예요.',
sol:{ ans:'2/3', fig:null,
steps:['어떤 수 × 2/5 = 4/15 → 어떤 수 = 4/15 ÷ 2/5.','4/15 × 5/2 = 20/30 = 2/3.','확인: 2/3 × 2/5 = 4/15 ✓']}},
{ tier:'최상위', type:'self', kind:'num',
q:'1 1/2 × 2/3 을(를) 계산하세요.',
fig:null,
answer:1,
hint:'대분수는 먼저 가분수로! 1 1/2 = 3/2.',
sol:{ ans:'1', fig:null,
steps:['가분수로: 1 1/2 = 3/2.','3/2 × 2/3 = 6/6 = 1.','서로 뒤집힌 모양(3/2 와 2/3)을 곱하면 항상 1이 돼요!']}},
{ tier:'최상위', type:'self', kind:'num',
q:'2/3 × 3/4 × 2/5 을(를) 계산하세요. (기약분수로)',
fig:null,
answer:0.2,
hint:'분자끼리 다 곱하고 분모끼리 다 곱해요. 약분 먼저 하면 쉬워요!',
sol:{ ans:'1/5', fig:null,
steps:['분자끼리: 2×3×2 = 12. 분모끼리: 3×4×5 = 60.','12/60 = 1/5.','약분 먼저: 3과 3이 지워지고 2와 4가 정리되면 1/5 — 같은 답!']}},
{ tier:'최상위', type:'self', kind:'num',
q:'□ × 2/5 = 2/15 일 때, □ 에 알맞은 수는? (기약분수로)',
fig:null,
answer:0.3333333333,
hint:'곱셈을 거꾸로 = 나눗셈! □ = 2/15 ÷ 2/5.',
sol:{ ans:'1/3', fig:null,
steps:['□ = 2/15 ÷ 2/5 = 2/15 × 5/2.','= 10/30 = 1/3.','확인: 1/3 × 2/5 = 2/15 ✓']}},
{ tier:'최상위', type:'self', kind:'num',
q:'3/4 × 8 을(를) 계산하세요.',
fig:null,
answer:6,
hint:'8 = 8/1 로 보고 곱해요. 먼저 4와 8을 약분하면 훨씬 쉬워요!',
sol:{ ans:'6', fig:null,
steps:['3/4 × 8/1 = 24/4 = 6.','약분 먼저: 8 ÷ 4 = 2 → 3 × 2 = 6 — 같은 답이죠!','1보다 큰 수(8)를 곱하니 답이 3/4 보다 커졌어요.']}},
{ tier:'최상위', type:'self', kind:'num',
q:'어떤 수의 2/3 이 8 입니다. 어떤 수는?',
fig:null,
answer:12,
hint:'‘어떤 수 × 2/3 = 8’ 이에요. 거꾸로 나누면?',
sol:{ ans:'12', fig:null,
steps:['어떤 수 × 2/3 = 8 → 어떤 수 = 8 ÷ 2/3.','8 × 3/2 = 24/2 = 12.','확인: 12 × 2/3 = 8 ✓']}},
];
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:'초5 분수의 곱셈' });
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();