{"job_id":"anim-job-e1b0547e-5bae-4632-b205-4e8f7bbc633a","request_id":"test-physics-halflife-ba30c5e5-e5bb-4ff3-90a7-a40b2e480a51-1778708287067","status":"complete","asset":{"primary_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-e1b0547e-5bae-4632-b205-4e8f7bbc633a/walkthrough.mp4","thumbnail_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-e1b0547e-5bae-4632-b205-4e8f7bbc633a/thumb.jpg","transcript_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-e1b0547e-5bae-4632-b205-4e8f7bbc633a/transcript.vtt","interactive_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-e1b0547e-5bae-4632-b205-4e8f7bbc633a/index.html","scenefile_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-e1b0547e-5bae-4632-b205-4e8f7bbc633a/scene-source.json","duration_seconds":15,"byte_size":462242,"renderer":"html_three_js_local","parameters":{"style":"auto","executor":"native_render_executor","localPath":"/app/storage/assets/anim-job-e1b0547e-5bae-4632-b205-4e8f7bbc633a","interactivity":"none","renderer_style":"three_js","durationSeconds":15,"render_manifest":{"jobId":"anim-job-e1b0547e-5bae-4632-b205-4e8f7bbc633a","request":{"gap":{"topic":"radioactive-half-life","severity":"dangerous","error_type":"concept_misunderstanding","memory_state":"fragile","display_topic":"Radioactive Decay — Half-Life","common_wrong_answer":"After two half-lives, all radioactive nuclei have decayed.","confidence_at_error":"high","correct_understanding":"Each half-life reduces remaining nuclei by half: N(t) = N₀ × (1/2)^(t/T½). It is exponential — never reaches exactly zero."},"target":{"style":"auto","render":{"fps":30,"format":"mp4","resolution":"1920x1080","include_thumbnail":true,"include_transcript":true},"audience":{"tone":"neutral_instructional","grade":"12","language":"en"},"interactivity":"none","duration_seconds":15},"context":{"chapter":{"name":"Nuclei","ncert_class":12,"ncert_chapter_number":13},"sub_topics":[{"topic":"Radioactive Decay","key_concepts":["half-life","decay constant","activity","exponential decay"]}]},"metadata":{"priority":"normal"},"exam_type":"neet","asset_type":"simulation","request_id":"test-physics-halflife-ba30c5e5-e5bb-4ff3-90a7-a40b2e480a51-1778708287067","subject_area":"physics"},"renderer":"html_three_js_local","storyboard":{"beats":[{"label":"Topic","visual":"Show the topic title and the key physical context.","narration":"Radioactive Decay — Half-Life"},{"label":"Mistake","visual":"Show the wrong approach and why it seems plausible.","narration":"After two half-lives, all radioactive nuclei have decayed."},{"label":"Correction","visual":"Show the right approach step by step.","narration":"Each half-life reduces remaining nuclei by half: N(t) = N₀ × (1/2)^(t/T½). It is exponential — never reaches exactly zero."},{"label":"Concept","visual":"Highlight the key formula and the governing relationship.","narration":"half-life. decay constant. activity"}],"title":"Radioactive Decay — Half-Life","sceneCode":"<!doctype html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\"/>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n  <title>Half-Life Misconception: Exponential Decay</title>\n  <style>\n    :root{--bg:#0f1418;--panel:#182228;--line:#2e3e46;--accent:#e5ba67;--text:#f4f1ea;--muted:#c8d4da;--blue:#63b3ff;--green:#87e8a8;--red:#de7f76;}\n    *{box-sizing:border-box;}\n    body{margin:0;font-family:\"Plus Jakarta Sans\",\"Manrope\",\"Inter\",ui-sans-serif,system-ui,sans-serif;background:radial-gradient(120% 90% at 20% -5%,#24343d 0%,var(--bg) 55%);color:var(--text);}\n    main{min-height:100vh;display:grid;grid-template-columns:minmax(300px,380px) 1fr;}\n    aside{border-right:1px solid var(--line);background:linear-gradient(180deg,rgba(31,46,53,.86),rgba(24,34,40,.92));padding:24px;overflow:auto;backdrop-filter:blur(6px);}\n    section{padding:24px;display:grid;place-items:center;}\n    h1{margin:0 0 10px;font-size:1.65rem;line-height:1.15;}\n    .sub{margin:0 0 16px;color:var(--muted);}\n    .formula{margin:0 0 14px;padding:10px;border:1px solid var(--line);border-radius:10px;background:#11191e;color:var(--accent);font-family:ui-monospace,monospace;font-size:0.9rem;box-shadow:inset 0 0 28px rgba(229,186,103,.08);}\n    .control{display:grid;gap:6px;margin:12px 0;}\n    .control input{width:100%;accent-color:var(--accent);}\n    ul{margin:14px 0 0 18px;padding:0;color:var(--muted);display:grid;gap:6px;}\n    .stage{width:min(1020px,95%);aspect-ratio:16/9;border:1px solid #445862;border-radius:14px;position:relative;overflow:hidden;background:radial-gradient(circle at 50% 38%,#2f4a57,#0f1418 72%);box-shadow:0 18px 60px rgba(0,0,0,.45), inset 0 0 90px rgba(255,255,255,.03);}\n    .stage::before{content:\"\";position:absolute;inset:0;background:linear-gradient(180deg,rgba(255,255,255,.06),transparent 34%);pointer-events:none;}\n    .legend{position:absolute;right:12px;top:12px;padding:8px 10px;border-radius:10px;border:1px solid #465a64;background:rgba(9,14,18,.58);font-size:0.8rem;color:var(--muted);backdrop-filter:blur(4px);}\n    .icon{display:inline-block;width:14px;height:14px;margin-right:6px;vertical-align:middle;}\n    @media(max-width:900px){main{grid-template-columns:1fr;}aside{border-right:0;border-bottom:1px solid var(--line);}}\n  </style>\n</head>\n<body>\n<main>\n  <aside>\n    <h1>Half-Life Decay</h1>\n    <p class=\"sub\">Exponential decay never reaches zero</p>\n    <p class=\"formula\">N(t) = N₀ × (½)^(t/T½)</p>\n    <label class=\"control\"><span>Speed: <strong id=\"v-speed\">1</strong>×</span><input id=\"c-speed\" type=\"range\" min=\"0.5\" max=\"2\" step=\"0.1\" value=\"1\"/></label>\n    <ul>\n      <li><svg class=\"icon\" viewBox=\"0 0 16 16\"><circle cx=\"8\" cy=\"8\" r=\"6\" fill=\"#de7f76\"/><text x=\"8\" y=\"10\" text-anchor=\"middle\" font-size=\"8\" fill=\"#fff\">✗</text></svg><strong>Misconception:</strong> After 2 half-lives, all nuclei decay</li>\n      <li><svg class=\"icon\" viewBox=\"0 0 16 16\"><circle cx=\"8\" cy=\"8\" r=\"6\" fill=\"#87e8a8\"/><text x=\"8\" y=\"11\" text-anchor=\"middle\" font-size=\"10\" fill=\"#0f1418\">✓</text></svg><strong>Reality:</strong> After 2 half-lives, 25% remains</li>\n      <li>Each half-life cuts remaining amount in half, forever</li>\n      <li>Graph is exponential curve, asymptotic to zero</li>\n    </ul>\n  </aside>\n  <section>\n    <div class=\"stage\" id=\"stage\">\n      <div class=\"legend\" id=\"legend\">Ready</div>\n      <canvas id=\"sim-cv\" style=\"position:absolute;inset:0;width:100%;height:100%;\"></canvas>\n    </div>\n  </section>\n</main>\n<script>\nconst controls = [{\"key\":\"speed\",\"label\":\"Animation Speed\",\"min\":0.5,\"max\":2,\"step\":0.1,\"value\":1,\"units\":\"×\"}];\nfor(const c of controls){\n  const inp=document.getElementById('c-'+c.key);\n  const out=document.getElementById('v-'+c.key);\n  inp?.addEventListener('input',()=>{out.textContent=inp.value;window.updateModel?.();});\n}\n(function(){\n  const cv=document.getElementById('sim-cv');\n  const ctx=cv.getContext('2d');\n  function resize(){const r=cv.getBoundingClientRect();if(r.width>0){cv.width=r.width;cv.height=r.height;}}\n  resize();new ResizeObserver(resize).observe(cv);\n  \n  let lastTs=0;\n  let globalTime=0;\n  let nuclei=[];\n  let decayedCount=0;\n  let halfLifeMarks=[];\n  \n  function initNuclei(){\n    nuclei=[];\n    decayedCount=0;\n    halfLifeMarks=[];\n    const count=120;\n    const W=cv.width,H=cv.height;\n    const containerW=W*0.38;\n    const containerH=H*0.55;\n    const startX=W*0.15;\n    const startY=H*0.22;\n    for(let i=0;i<count;i++){\n      const angle=Math.random()*Math.PI*2;\n      const dist=Math.random()*60;\n      nuclei.push({\n        x:startX+Math.cos(angle)*dist,\n        y:startY+Math.sin(angle)*dist,\n        decayTime:Math.random()*20,\n        decayed:false,\n        trail:[]\n      });\n    }\n  }\n  \n  function glowDot(x,y,r,color,a){\n    const g=ctx.createRadialGradient(x,y,0,x,y,r*2.6);\n    const rgb=color==='active'?'rgba(255,200,100,ALPHA)':color==='decay'?'rgba(139,232,168,ALPHA)':'rgba(99,179,255,ALPHA)';\n    g.addColorStop(0,rgb.replace('ALPHA',String(a)));\n    g.addColorStop(1,rgb.replace('ALPHA','0'));\n    ctx.fillStyle=g;ctx.beginPath();ctx.arc(x,y,r*2.6,0,Math.PI*2);ctx.fill();\n  }\n  \n  function drawNucleus(x,y,decayed,alpha){\n    ctx.globalAlpha=alpha;\n    if(decayed){\n      ctx.fillStyle='rgba(139,232,168,0.6)';\n      ctx.beginPath();ctx.arc(x,y,4.5,0,Math.PI*2);ctx.fill();\n      glowDot(x,y,4.5,'decay',0.3);\n    }else{\n      ctx.fillStyle='rgba(255,200,100,0.8)';\n      ctx.beginPath();ctx.arc(x,y,5,0,Math.PI*2);ctx.fill();\n      glowDot(x,y,5,'active',0.4);\n    }\n    ctx.globalAlpha=1;\n  }\n  \n  function arrow(x1,y1,x2,y2,color){\n    const dx=x2-x1,dy=y2-y1,l=Math.sqrt(dx*dx+dy*dy);\n    if(l<2)return;\n    const nx=dx/l,ny=dy/l,s=10;\n    ctx.strokeStyle=color;ctx.lineWidth=2.5;\n    ctx.beginPath();ctx.moveTo(x1,y1);ctx.lineTo(x2,y2);ctx.stroke();\n    ctx.fillStyle=color;ctx.beginPath();\n    ctx.moveTo(x2,y2);\n    ctx.lineTo(x2-s*nx+s*0.4*ny,y2-s*ny-s*0.4*nx);\n    ctx.lineTo(x2-s*nx-s*0.4*ny,y2-s*ny+s*0.4*nx);\n    ctx.fill();\n  }\n  \n  function drawText(text,x,y,size,color,align){\n    ctx.font=Math.round(size)+'px sans-serif';\n    ctx.fillStyle=color;\n    ctx.textAlign=align||'left';\n    ctx.textBaseline='top';\n    ctx.fillText(text,x,y);\n  }\n  \n  function tick(ts){\n    const dt=Math.min(0.04,(ts-lastTs)/1000);\n    lastTs=ts;\n    const speed=Number(document.getElementById('c-speed').value);\n    globalTime+=dt*speed;\n    \n    const W=cv.width,H=cv.height;\n    \n    // Clear\n    ctx.fillStyle=cv.style.background||'#0f1418';\n    ctx.clearRect(0,0,W,H);\n    \n    // Background layers\n    ctx.fillStyle='rgba(47,74,87,0.3)';\n    ctx.fillRect(0,0,W,H);\n    \n    // Left panel: Nucleus visualization\n    const panelX=W*0.08;\n    const panelY=H*0.15;\n    const panelW=W*0.35;\n    const panelH=H*0.7;\n    \n    // Panel border\n    ctx.strokeStyle='#445862';\n    ctx.lineWidth=1.5;\n    ctx.strokeRect(panelX,panelY,panelW,panelH);\n    \n    // Title\n    drawText('Nuclei Population',panelX+10,panelY+8,14,'#e5ba67','left');\n    \n    // Decay animation\n    decayedCount=0;\n    for(let n of nuclei){\n      if(globalTime>n.decayTime){\n        n.decayed=true;\n        decayedCount++;\n      }\n    }\n    \n    // Draw nuclei in grid\n    const containerX=panelX+15;\n    const containerY=panelY+35;\n    const cols=12;\n    const rows=10;\n    const spacing=panelW/cols-8;\n    for(let i=0;i<nuclei.length;i++){\n      const col=i%cols;\n      const row=Math.floor(i/cols);\n      const x=containerX+col*spacing;\n      const y=containerY+row*spacing;\n      drawNucleus(x,y,nuclei[i].decayed,1);\n    }\n    \n    // Right panel: Decay curve\n    const graphX=panelX+panelW+W*0.08;\n    const graphY=panelY;\n    const graphW=W*0.42;\n    const graphH=panelH;\n    \n    // Graph border\n    ctx.strokeStyle='#445862';\n    ctx.lineWidth=1.5;\n    ctx.strokeRect(graphX,graphY,graphW,graphH);\n    \n    // Title\n    drawText('Decay Curve: N(t) = N₀ × (½)^(t/T½)',graphX+10,graphY+8,13,'#e5ba67','left');\n    \n    // Axes\n    const axisX=graphX+40;\n    const axisY=graphY+graphH-30;\n    const axisW=graphW-60;\n    const axisH=graphH-60;\n    \n    ctx.strokeStyle='#63b3ff';\n    ctx.lineWidth=2;\n    ctx.beginPath();\n    ctx.moveTo(axisX,axisY);\n    ctx.lineTo(axisX+axisW,axisY);\n    ctx.stroke();\n    \n    ctx.beginPath();\n    ctx.moveTo(axisX,axisY);\n    ctx.lineTo(axisX,axisY-axisH);\n    ctx.stroke();\n    \n    // Grid lines and labels\n    ctx.strokeStyle='rgba(99,179,255,0.15)';\n    ctx.lineWidth=1;\n    for(let i=1;i<4;i++){\n      const x=axisX+(axisW*i/4);\n      ctx.beginPath();\n      ctx.moveTo(x,axisY);\n      ctx.lineTo(x,axisY-axisH);\n      ctx.stroke();\n      drawText(i+'T½',x-6,axisY+8,10,'#c8d4da','center');\n    }\n    for(let i=1;i<4;i++){\n      const y=axisY-(axisH*i/4);\n      ctx.beginPath();\n      ctx.moveTo(axisX-4,y);\n      ctx.lineTo(axisX+axisW,y);\n      ctx.stroke();\n      const pct=Math.round(100*(1-(i/4)));\n      drawText(pct+'%',axisX-28,y-5,9,'#c8d4da','right');\n    }\n    \n    // Draw exponential decay curve\n    ctx.strokeStyle='#87e8a8';\n    ctx.lineWidth=3;\n    ctx.beginPath();\n    let first=true;\n    for(let t=0;t<=4;t+=0.02){\n      const n=Math.pow(0.5,t);\n      const x=axisX+t*(axisW/4);\n      const y=axisY-n*axisH;\n      if(first){ctx.moveTo(x,y);first=false;}\n      else ctx.lineTo(x,y);\n    }\n    ctx.stroke();\n    \n    // Mark current time\n    const currentT=globalTime/5;\n    if(currentT<4){\n      const n=Math.pow(0.5,currentT);\n      const x=axisX+currentT*(axisW/4);\n      const y=axisY-n*axisH;\n      \n      // Vertical guide line\n      ctx.strokeStyle='rgba(255,200,100,0.4)';\n      ctx.lineWidth=1.5;\n      ctx.beginPath();\n      ctx.moveTo(x,axisY);\n      ctx.lineTo(x,y);\n      ctx.stroke();\n      \n      // Circle marker\n      ctx.fillStyle='#ffc864';\n      ctx.beginPath();\n      ctx.arc(x,y,5,0,Math.PI*2);\n      ctx.fill();\n      glowDot(x,y","remediationGoal":"Close concept_misunderstanding for physics."},"rendererStyle":"three_js"}}},"metadata":{"rendered_at":"2026-05-13T21:45:57.483Z","cache_hit":false,"cost_usd":0},"error":null}