/* daily-bank.jsx — question bank for Today's Drill.
   Each entry: { id, ch, q:{adult,kids}, options:[...], correct, explain:{adult,kids} }.
   `ch` ties a question to its chapter so the drill can weight toward what the
   learner has completed (and re-ask what they've missed). Options index 0 is
   correct here; the drill shuffles presentation order. */

const DAILY_BANK = [
  // ch 01 — flow
  { id: "d01a", ch: "01",
    q: { adult: "Double the voltage across a fixed resistor. The current…", kids: "You raise the barrel twice as high. The flow…" },
    options: ["doubles", "halves", "stays the same", "quadruples"], correct: 0,
    explain: { adult: "I = V/R is linear: double V, double I.", kids: "Twice the push, twice the flow!" } },
  { id: "d01b", ch: "01",
    q: { adult: "9 V across 330 Ω draws about…", kids: "A 9-high barrel pushing through a 330 squeeze gives a flow of about…" },
    options: ["27 mA", "3 A", "330 mA", "0.3 mA"], correct: 0,
    explain: { adult: "I = 9/330 ≈ 0.027 A = 27 mA — the classic LED ballpark.", kids: "9 ÷ 330 is about 0.027 — that's 27 of the little units (milliamps)." } },
  { id: "d01c", ch: "01",
    q: { adult: "Current in a single series loop is…", kids: "In one single pipe loop, the flow is…" },
    options: ["the same at every point", "biggest near the battery", "smallest after the resistor", "zero at the far end"], correct: 0,
    explain: { adult: "Charge can't pile up in a wire — series current is uniform.", kids: "The same water passes every spot each second — it can't pile up!" } },
  // ch 02 — series/parallel
  { id: "d02a", ch: "02",
    q: { adult: "Two equal resistors in parallel have a combined resistance of…", kids: "Two same-size pinches side by side fight the water…" },
    options: ["half of one", "double one", "the same as one", "zero"], correct: 0,
    explain: { adult: "Two equal paths share the flow: R/2.", kids: "Two open doors are HALF as hard to get through as one." } },
  { id: "d02b", ch: "02",
    q: { adult: "Three bulbs in series, one burns out. The others…", kids: "Three lights on one loop of string, one breaks. The others…" },
    options: ["all go dark", "get brighter", "stay the same", "blink"], correct: 0,
    explain: { adult: "A series loop has one path — any break opens all of it.", kids: "One loop, one path — snip it anywhere and everything stops." } },
  { id: "d02c", ch: "02",
    q: { adult: "House outlets are wired in parallel so that…", kids: "Wall plugs are side-by-side paths so that…" },
    options: ["every device gets the full voltage, independently", "they share the voltage equally", "the wires stay cool", "the meter reads less"], correct: 0,
    explain: { adult: "Parallel branches each see the full mains voltage, on or off independently.", kids: "Each plug gets its own full-strength path — the toaster doesn't care about the TV." } },
  // ch 03 — power
  { id: "d03a", ch: "03",
    q: { adult: "P = V × I. A 12 V supply pushing 2 A delivers…", kids: "Push of 12, flow of 2 — how much work per second?" },
    options: ["24 W", "6 W", "14 W", "144 W"], correct: 0,
    explain: { adult: "12 × 2 = 24 watts.", kids: "12 × 2 = 24!" } },
  { id: "d03b", ch: "03",
    q: { adult: "Same resistor, double the current. Its heat…", kids: "Same squeeze, twice the flow forced through. The warmth…" },
    options: ["quadruples", "doubles", "halves", "is unchanged"], correct: 0,
    explain: { adult: "P = I²R — current counts twice.", kids: "Heat goes with flow × flow — twice the flow is FOUR times the warmth." } },
  { id: "d03c", ch: "03",
    q: { adult: "Two 1.5 V cells: AAA (~1,000 mAh) and D (~12,000 mAh). The D…", kids: "A skinny and a fat barrel, same height. The fat one…" },
    options: ["pushes the same, lasts far longer", "pushes harder", "makes bulbs brighter", "charges faster"], correct: 0,
    explain: { adult: "Voltage = push; mAh = capacity. Same brightness, ~12× the runtime.", kids: "Same height = same squirt. But the fat barrel keeps squirting all day!" } },
  // ch 04 — capacitors
  { id: "d04a", ch: "04",
    q: { adult: "τ = R·C. Double the resistance feeding a cap and the charge time…", kids: "Tighter pinch filling the bucket — the fill takes…" },
    options: ["doubles", "halves", "stays the same", "drops to zero"], correct: 0,
    explain: { adult: "The time constant scales with both R and C.", kids: "Skinnier squeeze, slower fill — twice as slow." } },
  { id: "d04b", ch: "04",
    q: { adult: "A charged capacitor with no discharge path…", kids: "A full bucket with both valves closed…" },
    options: ["holds its voltage", "drains in seconds", "reverses polarity", "hums"], correct: 0,
    explain: { adult: "No path, no discharge — why big caps deserve respect even unplugged.", kids: "The water just sits there, ready. That's the whole point of a bucket!" } },
  { id: "d04c", ch: "04",
    q: { adult: "A camera flash charges slowly, fires instantly. That trade is…", kids: "The flash fills a bucket slowly, then tips it all at once to get…" },
    options: ["low power in, huge power out, same energy", "more energy than it stored", "less energy, more time", "free energy"], correct: 0,
    explain: { adult: "Energy in ≈ energy out; the cap compresses the delivery time, multiplying power.", kids: "Same water — but dumping it all at once makes a much bigger splash!" } },
  // ch 05 — switches
  { id: "d05a", ch: "05",
    q: { adult: "Two switches in series implement…", kids: "Two gates in a row on one pipe — the water passes when…" },
    options: ["AND — both must close", "OR — either closes", "NOT", "XOR"], correct: 0,
    explain: { adult: "The single path needs every contact closed.", kids: "BOTH gates have to be open. That's the AND rule." } },
  { id: "d05b", ch: "05",
    q: { adult: "Two switches in parallel implement…", kids: "Two doors into the same room — you get in when…" },
    options: ["OR — either closes", "AND — both must close", "NOT", "NAND"], correct: 0,
    explain: { adult: "Any closed branch completes the path.", kids: "EITHER door works. That's the OR rule." } },
  // ch 06 — transistors
  { id: "d06a", ch: "06",
    q: { adult: "A BJT with β = 100 and 2 mA into the base allows a collector current of about…", kids: "The valve helper is 100× strong. A trickle of 2 lets through…" },
    options: ["200 mA (if the supply allows it)", "2 mA", "50 mA always", "β doesn't matter"], correct: 0,
    explain: { adult: "I_C = β·I_B = 200 mA — capped by what V_CC and the load permit (saturation).", kids: "100 × 2 = 200 — as long as the big pipe can supply it!" } },
  { id: "d06b", ch: "06",
    q: { adult: "As a switch, a transistor dissipates least heat when…", kids: "The gate stays coolest when it's…" },
    options: ["fully on or fully off", "half open", "switching slowly", "warm already"], correct: 0,
    explain: { adult: "In saturation or cutoff, V×I across the device is tiny; half-open is the hot zone.", kids: "All-open or all-shut barely fights the water. Half-open fights it constantly — and heats up." } },
  // ch 07 — diodes
  { id: "d07a", ch: "07",
    q: { adult: "A silicon diode conducts when forward-biased, costing about…", kids: "The one-way flap opens when pushed the friendly way, charging a small toll of…" },
    options: ["0.7 V", "7 V", "0 V exactly", "half the supply"], correct: 0,
    explain: { adult: "The ~0.6–0.7 V forward drop is a roughly fixed fee, not proportional.", kids: "A little bite of push, every time — the price of opening the flap." } },
  { id: "d07b", ch: "07",
    q: { adult: "An LED wired backwards…", kids: "A glowing one-way flap put in backwards…" },
    options: ["stays dark and blocks — usually unharmed", "explodes", "glows dimly", "drains the battery"], correct: 0,
    explain: { adult: "Reverse-biased it simply blocks. First thing to check on a dark LED.", kids: "Shut flap: no flow, no glow, no harm. Flip it and it lights!" } },
  // ch 08 — AC
  { id: "d08a", ch: "08",
    q: { adult: "The grid uses AC mainly because…", kids: "Wall power wiggles back and forth because…" },
    options: ["transformers can step AC up and down", "AC is safer to touch", "DC can't travel in wires", "AC is cheaper to make"], correct: 0,
    explain: { adult: "Transformers only work on changing current — travel high, arrive low.", kids: "Wiggly power can be made taller or gentler with a transformer — perfect for long trips." } },
  { id: "d08b", ch: "08",
    q: { adult: "A 170 V-peak sine wave has an RMS value of about…", kids: "A wave that swings up to 170 'works as hard as' a steady push of about…" },
    options: ["120 V", "170 V", "340 V", "85 V"], correct: 0,
    explain: { adult: "V_rms = V_peak/√2 ≈ 0.707 × 170 ≈ 120 V — the number on the outlet.", kids: "170 ÷ 1.414 ≈ 120 — that's the number written on the wall plug!" } },
  // ch 09 — inductors
  { id: "d09a", ch: "09",
    q: { adult: "Interrupting current through an inductor produces…", kids: "Slamming the gate on a spinning flywheel makes…" },
    options: ["a large voltage spike", "a gentle fade", "nothing", "a reverse current forever"], correct: 0,
    explain: { adult: "The collapsing field forces whatever voltage it takes — hence flyback diodes.", kids: "All that motion has to go SOMEWHERE — it slams, hard." } },
  { id: "d09b", ch: "09",
    q: { adult: "E = ½LI². Double the current through an inductor and its stored energy…", kids: "Spin the flywheel twice as fast and its stored oomph…" },
    options: ["quadruples", "doubles", "halves", "stays the same"], correct: 0,
    explain: { adult: "Energy goes with I² — current counts twice.", kids: "Speed counts double — twice the spin is four times the oomph." } },
  // ch 10 — 555
  { id: "d10a", ch: "10",
    q: { adult: "In a 555 astable, doubling C makes the blink…", kids: "A bigger bucket in the blinker makes the blinking…" },
    options: ["half as fast", "twice as fast", "brighter", "stop"], correct: 0,
    explain: { adult: "Period ∝ R·C — more capacitance, longer cycle.", kids: "Bigger bucket takes longer to fill and drain — lazier blinks." } },
  { id: "d10b", ch: "10",
    q: { adult: "What makes an oscillator self-running?", kids: "What keeps the blinker blinking with nobody touching it?" },
    options: ["feedback — its output controls its own input", "a hidden motor", "the battery pulsing", "luck"], correct: 0,
    explain: { adult: "The output flips the charging direction; the cap's level flips the output. Closed loop.", kids: "Reaching a mark flips the valves; the valves send it back to the other mark. It feeds itself!" } },
];

Object.assign(window, { DAILY_BANK });
