openlearn-next 0.2.9 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AdminDirectoryView-0XV86Ues.js +1 -0
- package/dist/assets/{BatchPickerModal-9BhmNM2R.js → BatchPickerModal-of9a5EJz.js} +1 -1
- package/dist/assets/{ClassesView-DKScQDos.js → ClassesView-CefnsjZ8.js} +2 -2
- package/dist/assets/CloudDriveModal-DgVQLbO5.js +1 -0
- package/dist/assets/ComputerLabView-BId0ZarM.js +1 -0
- package/dist/assets/CourseManagement-Cxhc784Q.js +1 -0
- package/dist/assets/CourseWizardModal-Da6PKhnU.js +3 -0
- package/dist/assets/CoursewareHubPanel-LpUgjqbH.js +1 -0
- package/dist/assets/{Dashboard-BPxkmnvI.js → Dashboard-LWbFbup4.js} +2 -2
- package/dist/assets/{ExportWeightModal-DSzySeqh.js → ExportWeightModal-Cyg1zMEd.js} +1 -1
- package/dist/assets/HelpTour-CHPIK2ae.js +1 -0
- package/dist/assets/{HelpView-CuNDka5n.js → HelpView-CvpgBpdr.js} +3 -3
- package/dist/assets/ImportLessonsModal-CfWIrW1K.js +1 -0
- package/dist/assets/ImportModal-BTfia0Ah.js +1 -0
- package/dist/assets/InteractiveCoursewareViewer-CS5BqfJZ.js +1 -0
- package/dist/assets/InteractiveWhiteboard-U23CsqGo.js +78 -0
- package/dist/assets/{LazyCourseware-g7b8EXR_.js → LazyCourseware-DXL9IxZO.js} +1 -1
- package/dist/assets/{LazyWhiteboard-BIepzrv9.js → LazyWhiteboard-CtkzSFtN.js} +2 -2
- package/dist/assets/LessonEditorView-Bfxf4VVB.js +1 -0
- package/dist/assets/LiveClassroomView-DHzCM4qQ.js +1 -0
- package/dist/assets/{NotificationDetailModal-Bk1g_prI.js → NotificationDetailModal-BxrpnlWV.js} +1 -1
- package/dist/assets/{PluginView-C6s7Ltcy.js → PluginView-12qYzmnq.js} +3 -3
- package/dist/assets/{ProcessLogsModal-B-PY780w.js → ProcessLogsModal-01S7zsw0.js} +1 -1
- package/dist/assets/{QuizGeneratorModal-DWH1zP0X.js → QuizGeneratorModal-DfZI40Ii.js} +1 -1
- package/dist/assets/StudentAssignmentView-BP6zbHuM.js +1 -0
- package/dist/assets/StudentLessonView-DEpMzrH2.js +1 -0
- package/dist/assets/StudentPreviewModal-DCmai53s.js +1 -0
- package/dist/assets/StudentView-CcGlfW25.js +2 -0
- package/dist/assets/SystemResourceLibraryModal-BzHw1edT.js +1 -0
- package/dist/assets/TeacherView-Dw6mKwcv.js +2 -0
- package/dist/assets/{TimetableView-BMsjwi-s.js → TimetableView-DJgOlGSf.js} +3 -3
- package/dist/assets/index-B-YxO39A.css +1 -0
- package/dist/assets/index-C8sCKzmN.js +2 -0
- package/dist/assets/index-CYzNsYZB.js +193 -0
- package/dist/assets/{index.es-DZ6UeYE-.js → index.es-CfxBkm_z.js} +1 -1
- package/dist/assets/{vendor-charts-B7ViBL9w.js → vendor-charts-CRXa4AlU.js} +1 -1
- package/dist/assets/vendor-content-CYR4BTuT.js +3 -0
- package/dist/assets/{vendor-icons-_c3xpwjZ.js → vendor-icons-Dq6MhgH9.js} +1 -1
- package/dist/assets/{vendor-pdf-CVyNPGVr.js → vendor-pdf-Cp-cYteE.js} +2 -2
- package/dist/assets/vendor-utils-BEhuP0Zq.js +1 -0
- package/dist/index.html +2 -2
- package/dist/server.cjs +989 -700
- package/package.json +9 -6
- package/dist/assets/AdminDirectoryView-CD7tW4mc.js +0 -1
- package/dist/assets/CloudDriveModal-cPtTMriS.js +0 -1
- package/dist/assets/ComputerLabView-B6-twB0u.js +0 -1
- package/dist/assets/CourseManagement-AoauIULq.js +0 -1
- package/dist/assets/CourseWizardModal-BOgLpLz7.js +0 -3
- package/dist/assets/CoursewareHubPanel-Cb1mAqHS.js +0 -1
- package/dist/assets/HelpTour-DwM9UBiA.js +0 -1
- package/dist/assets/ImportLessonsModal-Bwy2r-96.js +0 -1
- package/dist/assets/ImportModal-CmUt1YeX.js +0 -1
- package/dist/assets/InteractiveCoursewareViewer-DWnzq20c.js +0 -1
- package/dist/assets/InteractiveWhiteboard-C7JMplbp.js +0 -62
- package/dist/assets/LessonEditorView-C-mvYRUd.js +0 -1
- package/dist/assets/LiveClassroomView-CqRbWNis.js +0 -1
- package/dist/assets/StudentAssignmentView-CfTjeoAp.js +0 -1
- package/dist/assets/StudentLessonView-D2XvNGnW.js +0 -1
- package/dist/assets/StudentPreviewModal-BwXG6Cis.js +0 -1
- package/dist/assets/StudentView-DT-373QP.js +0 -2
- package/dist/assets/SystemResourceLibraryModal-BTL8rB0g.js +0 -1
- package/dist/assets/TeacherView-XdD-y67J.js +0 -2
- package/dist/assets/index-C5FKWIUq.js +0 -190
- package/dist/assets/index-CATki2cp.css +0 -1
- package/dist/assets/index-wdWIWwbg.js +0 -1
- package/dist/assets/vendor-content-V6uLfjnH.js +0 -3
- package/dist/assets/vendor-utils-4FcTwKPj.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as c,j as e,R as Xe}from"./vendor-react-0Lg0vA-4.js";import{am as X,a4 as Ee,aj as Ye,C as Ze,aq as et,I as Ne,aC as tt,U as st,ax as rt,b as at,q as Me,i as nt,aw as Ae,ao as Pe,S as De,ae as it,x as ot,y as lt,z as dt,aD as ct,r as Te,a9 as xt,t as ye,v as Ce,al as mt,E as ht,e as pt,an as ut,O as ft,a0 as bt}from"./vendor-icons-Dq6MhgH9.js";import{L as gt}from"./LazyWhiteboard-CtkzSFtN.js";import{l as jt,r as yt}from"./index-CYzNsYZB.js";import"./vendor-pdf-Cp-cYteE.js";import"./vendor-utils-BEhuP0Zq.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-pptx-B_NheIKl.js";import"./vendor-charts-CRXa4AlU.js";function Nt({lessonId:d,lang:L,addToast:T}){const[le,y]=c.useState(!1),[Y,s]=c.useState(!1),[N,M]=c.useState([]),[A,u]=c.useState(60),[U,S]=c.useState(40),[$,_]=c.useState({}),[R,Z]=c.useState({}),[w,q]=c.useState({}),[V,I]=c.useState({}),[C,G]=c.useState({}),[b,O]=c.useState({}),l=L==="zh",F=async(a=!1)=>{a?s(!0):y(!0);try{const h=await(await fetch(`/api/lessons/${d}/eval-grades`)).json();if(Array.isArray(h)){M(h);const f={},v={},g={},j={};h.forEach(i=>{i.grade?(f[i.id]=i.grade.teacher_score,v[i.id]=i.grade.teacher_comment,g[i.id]=Math.round(i.grade.teacher_weight*100),j[i.id]=Math.round(i.grade.peer_weight*100)):(f[i.id]=$[i.id]!==void 0?$[i.id]:80,v[i.id]=R[i.id]!==void 0?R[i.id]:"",g[i.id]=w[i.id]!==void 0?w[i.id]:A,j[i.id]=V[i.id]!==void 0?V[i.id]:U)}),_(i=>({...f,...i})),Z(i=>({...v,...i})),q(i=>({...g,...i})),I(i=>({...j,...i}))}else throw new Error("Invalid submissions data format")}catch(m){console.error("Error fetching submissions grades:",m),T(l?"数据加载失败":"Failed to Load Data",l?"请检查网络连接或刷新页面。":"Please check your connection and try again.","warning")}finally{y(!1),s(!1)}};c.useEffect(()=>{d&&F()},[d]);const ee=a=>{u(a),S(100-a),q(m=>{const h={...m};return N.forEach(f=>{(!f.grade||f.grade.status!=="confirmed")&&(h[f.id]=a)}),h}),I(m=>{const h={...m};return N.forEach(f=>{(!f.grade||f.grade.status!=="confirmed")&&(h[f.id]=100-a)}),h})},te=(a,m)=>{q(h=>({...h,[a]:m})),I(h=>({...h,[a]:100-m}))},Q=async(a,m)=>{const h=$[a],f=R[a]||"",v=(w[a]??A)/100,g=(V[a]??U)/100;if(h===void 0||isNaN(h)||h<0||h>100){T(l?"评分无效":"Invalid Score",l?"教师评分必须在 0 到 100 之间!":"Teacher score must be between 0 and 100!","warning");return}if(m==="confirmed"){const j=l?"确认同步后,最终得分将直接同步写入宿主学期成绩库,此后该学生的作业成绩将锁定不可修改。是否确认?":"Once confirmed, the final score will be synced to the host semester reports and locked. Proceed?";if(!window.confirm(j))return}O(j=>({...j,[a]:m}));try{const i=await(await fetch("/api/commands",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commandType:"assignment.grade",payload:{submissionId:a,teacherScore:Number(h),teacherComment:f,teacherWeight:v,peerWeight:g,status:m}})})).json();if(i.success)T(m==="confirmed"?l?"平时成绩同步成功":"Semester Grade Synced":l?"平时成绩草稿已保存":"Grade Draft Saved",m==="confirmed"?l?`已将平时成绩 ${i.result.calculatedFinalScore} 分同步至学期报告!`:`Successfully synced grade ${i.result.calculatedFinalScore}!`:l?"成功保存了教师打分与评语草稿。":"Successfully saved score and comment draft.","success"),F(!0);else throw new Error(i.error||"Failed to submit grade")}catch(j){T(l?"操作失败":"Operation Failed",j.message,"warning")}finally{O(j=>({...j,[a]:null}))}},K=a=>{G(m=>({...m,[a]:!m[a]}))};return le?e.jsxs("div",{className:"flex-grow flex flex-col items-center justify-center py-12 text-gray-500",children:[e.jsx(X,{className:"animate-spin text-indigo-500 mb-2",size:32}),e.jsx("p",{className:"text-xs",children:l?"正在读取学生作业与成绩状态...":"Loading student submissions and grades..."})]}):e.jsxs("div",{className:"flex-1 flex flex-col min-h-0 w-full relative rounded-xl overflow-hidden border border-slate-200 shadow-md bg-white p-5 text-left",children:[e.jsxs("div",{className:"flex justify-between items-center pb-4 border-b border-slate-100 mb-4 gap-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("h3",{className:"text-sm font-bold text-slate-800 flex items-center gap-1.5 select-none",children:[e.jsx(Ee,{size:16,className:"text-indigo-655"}),l?"学生作业成绩评定与折算系统":"Student Assignment Grading & Sync"]}),e.jsxs("span",{className:"text-[9px] bg-indigo-50 text-indigo-750 px-2 py-0.5 rounded-full border border-indigo-100 font-bold",children:[N.length," ",l?"个提交":"submissions"]})]}),e.jsx("button",{onClick:()=>F(!0),disabled:Y,className:"p-1.5 bg-white hover:bg-slate-55 border border-slate-200 rounded-lg text-slate-600 transition-colors flex items-center justify-center cursor-pointer shadow-4xs",title:l?"刷新数据":"Refresh",children:e.jsx(X,{size:12,className:Y?"animate-spin":""})})]}),e.jsxs("div",{className:"bg-slate-50 border border-slate-200 rounded-xl p-4 mb-5 shrink-0 flex flex-col md:flex-row md:items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx(Ye,{className:"text-indigo-500 shrink-0 mt-0.5",size:16}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-bold text-slate-700",children:l?"全局默认折算权重设置":"Default Grading Weights Configuration"}),e.jsx("p",{className:"text-[10px] text-slate-400 mt-0.5 font-medium",children:l?"调整权重分配,所有尚未锁定成绩的学生将自动应用此默认权重比例。":"Setting global default weights. Changes will automatically apply to non-confirmed grades."})]})]}),e.jsxs("div",{className:"flex items-center gap-4 shrink-0 bg-white px-3.5 py-2 rounded-lg border border-slate-200 shadow-3xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[11px] font-bold text-slate-500",children:l?"教师评分:":"Teacher:"}),e.jsx("input",{type:"range",min:"0",max:"100",step:"5",value:A,onChange:a=>ee(Number(a.target.value)),className:"w-20 accent-indigo-650 cursor-pointer"}),e.jsxs("span",{className:"text-xs font-bold text-indigo-700 w-8 text-right",children:[A,"%"]})]}),e.jsx("div",{className:"h-4 w-[1px] bg-slate-200"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[11px] font-bold text-slate-500",children:l?"学生互评:":"Peer Review:"}),e.jsxs("span",{className:"text-xs font-bold text-slate-700 w-8",children:[U,"%"]})]})]})]}),e.jsx("div",{className:"flex-grow flex-1 overflow-y-auto space-y-4 pr-1 scrollbar-thin",children:N.length===0?e.jsxs("div",{className:"h-full flex flex-col items-center justify-center py-12 text-slate-400 gap-2",children:[e.jsx(Ze,{size:32,className:"text-slate-350"}),e.jsx("p",{className:"text-xs",children:l?"本节课目前没有任何学生提交作业。":"No students have submitted assignments yet for this lesson."})]}):N.map(a=>{const m=$[a.id]!==void 0?$[a.id]:80,h=R[a.id]||"",f=w[a.id]??A,v=V[a.id]??U,g=a.grade?.status==="confirmed",j=Math.round(m*(f/100)+a.peerAverageScore*(v/100));return e.jsxs("div",{className:`bg-white border rounded-xl shadow-3xs overflow-hidden transition-all ${g?"border-emerald-200 bg-emerald-50/5":"border-slate-200"}`,children:[e.jsxs("div",{className:"px-4 py-3 bg-slate-50/50 border-b border-slate-100 flex flex-col md:flex-row md:items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-700 font-bold text-xs select-none",children:a.studentName?.charAt(0)||"S"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold text-slate-800",children:a.studentName}),e.jsxs("div",{className:"text-[9px] text-slate-400 font-mono mt-0.5 flex items-center gap-1.5",children:[e.jsxs("span",{children:["V",a.version]}),e.jsx("span",{children:"•"}),e.jsx("span",{children:new Date(a.updatedAt).toLocaleString()})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[g?e.jsxs("span",{className:"bg-emerald-55 text-emerald-700 text-[10px] font-black px-2.5 py-1 rounded-full border border-emerald-150 flex items-center gap-1 shadow-3xs select-none",children:[e.jsx(et,{size:12}),l?"成绩已同步":"Synced to Reports"]}):e.jsx("span",{className:"bg-amber-50 text-amber-805 text-[10px] font-bold px-2 py-0.5 rounded-full border border-amber-200/60 select-none",children:a.grade?l?"草稿状态":"Draft":l?"未评定":"Ungraded"}),e.jsxs("a",{href:a.filePath,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-indigo-600 hover:text-indigo-850 font-medium hover:underline flex items-center gap-1 bg-white border border-slate-200 px-2 py-1 rounded-lg shadow-4xs",title:a.filePath,children:[e.jsx(Ne,{size:11}),l?"查看作业":"View File",e.jsx(tt,{size:8})]})]})]}),e.jsxs("div",{className:"p-4 grid grid-cols-1 lg:grid-cols-12 gap-5",children:[e.jsxs("div",{className:"lg:col-span-5 flex flex-col gap-2.5 border-r border-slate-100 pr-0 lg:pr-5 text-left",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("span",{className:"text-[11px] font-bold text-slate-650 flex items-center gap-1 select-none",children:[e.jsx(st,{size:13,className:"text-slate-400"}),l?"学生互评详情":"Peer Review Details"]}),e.jsxs("span",{className:"text-[10px] font-bold text-slate-500 bg-slate-100 px-2 py-0.5 rounded-md",children:[l?"互评人数:":"Reviews:"," ",a.peerReviews.length]})]}),e.jsxs("div",{className:"bg-slate-50 border border-slate-100 rounded-xl p-3 flex items-center gap-3",children:[e.jsxs("div",{className:"bg-white border border-slate-200 w-12 h-12 rounded-lg flex flex-col items-center justify-center shrink-0 shadow-3xs",children:[e.jsx("span",{className:"text-[9px] text-slate-405 select-none font-bold",children:l?"均分":"Avg"}),e.jsx("span",{className:"text-sm font-extrabold text-slate-700 leading-none mt-0.5",children:a.peerAverageScore})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-[10px] text-slate-450 leading-normal font-medium",children:a.peerReviews.length>0?l?"根据同学互评分数得出的平均值。":"Average score computed from classmate evaluations.":l?"暂无同学对此作业给出评分。":"No classmate peer reviews received yet."}),a.peerReviews.length>0&&e.jsx("button",{onClick:()=>K(a.id),className:"text-[10px] text-indigo-650 hover:text-indigo-800 font-bold mt-1.5 flex items-center gap-0.5 cursor-pointer outline-none",children:C[a.id]?e.jsxs(e.Fragment,{children:[l?"收起互评详情":"Hide Details"," ",e.jsx(rt,{size:12})]}):e.jsxs(e.Fragment,{children:[l?"展开互评详情":"Show Details"," ",e.jsx(at,{size:12})]})})]})]}),C[a.id]&&a.peerReviews.length>0&&e.jsx("div",{className:"mt-2 space-y-2 border-t border-slate-100 pt-2.5 max-h-40 overflow-y-auto scrollbar-thin",children:a.peerReviews.map(i=>e.jsxs("div",{className:"bg-white border border-slate-200 rounded-lg p-2.5 text-xs text-left shadow-4xs",children:[e.jsxs("div",{className:"flex justify-between items-center font-bold text-slate-700",children:[e.jsxs("span",{className:"flex items-center gap-1 font-semibold text-slate-655",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-slate-300"}),i.reviewer_name]}),e.jsxs("span",{className:"text-indigo-650 bg-indigo-50 border border-indigo-100 rounded px-1.5 py-0.5 text-[10px]",children:[i.score," ",l?"分":"pts"]})]}),i.comment&&e.jsxs("p",{className:"text-[10px] text-slate-550 mt-1 italic pl-2.5 border-l-2 border-slate-100 font-medium",children:['"',i.comment,'"']})]},i.id))})]}),e.jsxs("div",{className:"lg:col-span-7 flex flex-col gap-3 justify-between",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-bold text-slate-650 mb-1 select-none",children:l?"教师平时分评分 (0-100)":"Teacher Score (0-100)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{id:`teacher_score_input_${a.id}`,type:"number",min:"0",max:"100",disabled:g,value:m,onChange:i=>_(J=>({...J,[a.id]:Math.min(100,Math.max(0,Number(i.target.value)))})),className:"bg-white border border-slate-250 rounded-lg text-xs font-bold text-slate-700 px-3 py-1.5 focus:ring-1 focus:ring-indigo-500 outline-none w-20 shadow-4xs disabled:opacity-50 disabled:bg-slate-50"}),e.jsx("input",{type:"range",min:"0",max:"100",disabled:g,value:m,onChange:i=>_(J=>({...J,[a.id]:Number(i.target.value)})),className:"flex-1 accent-indigo-650 disabled:opacity-40 cursor-pointer"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1",children:[e.jsx("label",{className:"block text-[10px] font-bold text-slate-600 select-none",children:l?"打分占比 (教师权重)":"Teacher Score Weight"}),e.jsx("span",{className:"text-[10px] font-bold text-slate-400",children:l?`学生互评: ${v}%`:`Peer: ${v}%`})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{id:`teacher_weight_input_${a.id}`,type:"range",min:"0",max:"100",step:"5",disabled:g,value:f,onChange:i=>te(a.id,Number(i.target.value)),className:"flex-1 accent-indigo-650 disabled:opacity-40 cursor-pointer"}),e.jsxs("span",{className:"text-xs font-extrabold text-indigo-750 w-9 text-right",children:[f,"%"]})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-bold text-slate-655 mb-1 select-none",children:l?"教师评价评语":"Teacher Comments & Feedback"}),e.jsx("textarea",{id:`teacher_comment_input_${a.id}`,disabled:g,value:h,placeholder:l?"在此输入对学生作业作品的改进指导意见及评语。":"Enter guiding feedback for this student.",onChange:i=>Z(J=>({...J,[a.id]:i.target.value})),rows:2,className:"w-full bg-white border border-slate-250 rounded-lg text-xs p-2 focus:ring-1 focus:ring-indigo-500 outline-none shadow-4xs disabled:opacity-50 disabled:bg-slate-50 resize-none font-medium text-slate-700"})]}),e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 pt-2 border-t border-slate-100 mt-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:`p-1.5 rounded-lg border flex items-center justify-center shrink-0 ${g?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-indigo-50 text-indigo-700 border-indigo-100"}`,children:e.jsx(Me,{size:14})}),e.jsxs("div",{className:"text-[10px] text-slate-500 font-medium",children:[e.jsxs("div",{children:[l?"平时总分计算公式":"Calculated Final Grade",":"]}),e.jsxs("div",{className:"font-bold text-slate-700 mt-0.5 animate-formula",children:[f,"% × ",e.jsx("span",{className:"text-indigo-650 font-bold",children:m}),a.peerReviews.length>0&&` + ${v}% × ${a.peerAverageScore}`," = ",e.jsx("span",{className:g?"text-emerald-700 font-black text-xs":"text-indigo-700 font-black text-xs",children:g&&a.grade?.calculated_final_score||j}),l?"分":" pts"]})]})]}),!g&&e.jsxs("div",{className:"flex gap-2 justify-end shrink-0",children:[e.jsxs("button",{id:`teacher_draft_btn_${a.id}`,type:"button",disabled:!!b[a.id],onClick:()=>Q(a.id,"draft"),className:"px-3 py-1.5 bg-white border border-slate-350 rounded-lg text-xs font-bold text-slate-700 hover:bg-slate-55 flex items-center gap-1.5 shadow-4xs cursor-pointer select-none disabled:opacity-50",children:[e.jsx(nt,{size:12}),b[a.id]==="draft"?l?"保存中...":"Saving...":l?"暂存草稿":"Save Draft"]}),e.jsxs("button",{id:`teacher_confirm_btn_${a.id}`,type:"button",disabled:!!b[a.id],onClick:()=>Q(a.id,"confirmed"),className:"px-3.5 py-1.5 bg-indigo-600 border border-indigo-700 rounded-lg text-xs font-bold text-white hover:bg-indigo-700 flex items-center gap-1.5 shadow-3xs cursor-pointer select-none disabled:opacity-50",children:[e.jsx(Ae,{size:12}),b[a.id]==="confirmed"?l?"同步中...":"Syncing...":l?"确认并同步":"Confirm & Sync"]})]})]})]})]})]},a.id)})})]})}function wt({name:d,...L}){const T=bt[d];return T?Xe.createElement(T,L):e.jsx(ft,{...L})}function Ct({selectedLesson:d,setSelectedLesson:L,lessons:T,classes:le,students:y,plugins:Y,lang:s,timelineSegments:N,activeSegmentId:M,setActiveSegmentId:A,liveClassSelectedClassId:u,setLiveClassSelectedClassId:U,liveClassIsActive:S,setLiveClassIsActive:$,liveClassTimeRemaining:_,setLiveClassTimeRemaining:R,liveClassFeed:Z,setLiveClassFeed:w,liveClassAcknowledgedMap:q,setLiveClassAcknowledgedMap:V,elements:I,fetchElements:C,fetchStudents:G,addToast:b,onlineStudentIds:O,activeStudentLessons:l,liveClassStudentProgress:F,onPingStudent:ee,onOpenCoursewareHub:te,activeRole:Q,setActiveRole:K}){const[a,m]=c.useState(!1),[h,f]=c.useState(!1),[v,g]=c.useState(null),[j,i]=c.useState(!1),[J,we]=c.useState(null),[Re,ve]=c.useState([]),de=c.useRef(null),se=c.useRef({lesson:null,classId:null}),[B,ce]=c.useState("whiteboard"),[re,Oe]=c.useState([]),[xe,ze]=c.useState(!1),[E,me]=c.useState(null),[he,ae]=c.useState(null),[We,ke]=c.useState(!1),[ne,Fe]=c.useState("all"),[pe,Je]=c.useState(""),ie=async()=>{ze(!0);try{const t=await fetch("/api/courseware/attempts");if(t.ok){const r=await t.json();Oe(r)}}catch(t){console.error("Failed to fetch attempts",t)}finally{ze(!1)}};c.useEffect(()=>{B==="submissions"&&ie()},[B]),c.useEffect(()=>{const t=jt();return t.on("courseware-attempt-updated",()=>{ie()}),()=>{t.disconnect()}},[]);const Be=async t=>{if(!d||!u){b(s==="zh"?"⚠️ 无法操作":"⚠️ Action Prevented",s==="zh"?"请先在顶部栏选择要绑定的课节和班级。":"Please select lesson and class first.","warning");return}try{const r=await fetch(`/api/courseware/attempts/${t}/promote`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lessonId:d,classId:u})});if(r.ok){const o=await r.json();b(s==="zh"?"✓ 学习数据已保存":"✓ Data Recorded",s==="zh"?`成功将该数据存入数据库!分数: ${o.score},已同步更新至学生学习进度。`:`Successfully recorded submission! Score: ${o.score}.`,"success"),ie(),G&&G()}else{const o=await r.json();throw new Error(o.error||"Server error")}}catch(r){b(s==="zh"?"❌ 保存失败":"❌ Save Failed",r.message||"Error occurred while saving.","warning")}},Le=async t=>{me(t),ke(!0),ae(null);try{const r=await fetch(`/api/courseware/attempts/${t.attemptId}/raw`);if(r.ok){const o=await r.json();ae(o)}else ae({error:"Failed to load raw data"})}catch(r){ae({error:r.message||"Error loading data"})}finally{ke(!1)}},oe=!!(u&&y.filter(t=>t.locked_lesson_id===d).length>0),Ue=Y.filter(t=>t.status==="active"),ue=Array.from(new Map(Ue.flatMap(t=>{try{const r=typeof t.manifest=="string"?JSON.parse(t.manifest):t.manifest,o=r.classroomTools||[],n=r.contributes?.["classroom.tool"]||[];return[...o,...n].map(x=>({...x,pluginId:t.id,manifestId:r.id}))}catch{return[]}}).map(t=>[t.id,t])).values());c.useEffect(()=>(S&&_>0?de.current=setInterval(()=>{R(_-1)},1e3):_===0&&S&&(b(s==="zh"?"⏰ 环节时间到":"⏰ Phase Timer Ended",s==="zh"?"当前教学环节设定的时间已耗尽,建议转入下一环节。":"The current segment duration has elapsed. Transition recommended.","warning"),$(!1)),()=>{de.current&&clearInterval(de.current)}),[S,_]),c.useEffect(()=>{if(!d||!u){se.current={lesson:null,classId:null};return}(se.current.lesson!==d||se.current.classId!==u)&&(se.current={lesson:d,classId:u},Se(!0))},[d,u]);const Ge=t=>{const r=parseInt(t.replace(/[^0-9]/g,""));return isNaN(r)?300:t.includes("s")?r:r*60},qe=t=>{A(t.id);const r=Ge(t.duration);R(r),$(!0),w(o=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"info",message:`教学环节切换并广播:进入 [${t.title}] 环节,设定时间 ${t.duration}。`},...o]),b(s==="zh"?"📢 环节已广播":"📢 Phase Synchronized",s==="zh"?`已同步广播 [${t.title}] 环节至所有在线学生端。`:`Broadcasted phase [${t.title}] to all active students.`,"success")},Se=async t=>{if(!u||!d){b(s==="zh"?"⚠️ 无法操作":"⚠️ Action Prevented",s==="zh"?"请先选择需要授课的课节及班级。":"Please select a lesson and class first.","warning");return}m(!0);try{const r=t?`/api/classes/${u}/lock_lesson`:`/api/classes/${u}/unlock_lesson`;(await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:t?JSON.stringify({lessonId:d}):void 0})).ok&&(await G(),w(n=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:t?"warning":"info",message:t?"已对全班学生强制锁定专注模式(限定当前课程)。":"已解锁全班学生专注模式限制。"},...n]),b(s==="zh"?"🔒 锁状态更新":"🔒 Class Status Updated",t?"全班专注锁定成功,学生将无法切回主页。":"全班屏幕解锁成功,学生已恢复自由浏览。","success"))}catch(r){console.error("Failed to toggle class focus lock",r)}finally{m(!1)}},Ve=async(t,r)=>{const o=r?null:d;try{if((await fetch(`/api/students/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({locked_lesson_id:o})})).ok){await G();const x=y.find(p=>p.id===t)?.name||t;w(p=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:o?"warning":"info",message:o?`已针对学生 [${x}] 单独开启专注限制锁定。`:`已解锁学生 [${x}] 的专注限制。`},...p])}}catch(n){console.error("Failed to toggle student lock",n)}},Ie=async t=>{if(!d){b(s==="zh"?"⚠️ 请选择课节":"⚠️ Select Lesson",s==="zh"?"请先选择要授课的课节。":"Please select a lesson first.","warning");return}if(JSON.stringify(t.payload||"").includes("$classId")&&!u){b(s==="zh"?"⚠️ 请选择班级":"⚠️ Select Class",s==="zh"?"该工具需要指定上课班级,请在顶部先选择班级。":"Please select class first for this tool.","warning");return}w(o=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"info",message:`正在运行插件工具 [${t.name}]...`},...o]);try{const o=JSON.parse(JSON.stringify(t.payload||{}).replace(/\$classId/g,u||"").replace(/\$lessonId/g,d||""));if(o.type==="plugin"&&o.data)try{const z=JSON.parse(o.data);!z.segmentId&&M&&(z.segmentId=M,o.data=JSON.stringify(z))}catch{}const x=!/^(whiteboard|lesson|assignment|class|student|vfs|plugin|ai|agent|system)\./.test(t.commandType)&&t.manifestId?yt(t.commandType,t.manifestId):t.commandType,p=await fetch("/api/commands",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commandType:x,payload:o})});if(p.ok)te&&(t.id==="courseware-hub-teacher"||t.commandType==="courseware.open_panel")&&te(),w(z=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"success",message:`插件工具 [${t.name}] 执行完毕,数据成功下发。`},...z]),b(s==="zh"?"✓ 工具下发成功":"✓ Tool Synchronized",s==="zh"?`工具 [${t.name}] 已成功在当前白板上部署并投射。`:`Tool [${t.name}] synchronized successfully.`,"success"),await C(d);else{const z=await p.json();throw new Error(z.error||"Server error")}}catch(o){w(n=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"error",message:`运行插件工具 [${t.name}] 失败: ${o.message}`},...n]),b(s==="zh"?"❌ 运行失败":"❌ Tool Failed",o.message||"Execution error","warning")}},Qe=()=>{if(y.length===0||j)return;const t=y.filter(p=>O.includes(p.id)&&l[p.id]===d);if(t.length===0){b(s==="zh"?"⚠️ 无法抽问":"⚠️ Cannot Draw",s==="zh"?"当前课堂中没有已进入的活跃学生。":"No students have entered the classroom yet.","warning");return}i(!0);let r=0;const o=18;let n=75;const x=()=>{const p=Math.floor(Math.random()*t.length),z=t[p];if(we(z.id),r++,r<o)r>o-5&&(n+=45),setTimeout(x,n);else{const k=t[p];we(null),i(!1),ve(P=>P.includes(k.id)?P:[...P,k.id]),w(P=>[{id:Math.random().toString(),time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"success",message:`🎯 随机提问抽选:学生 [${k.name}] 被抽中回答问题!`},...P]),b(s==="zh"?"🎯 随机提问抽选":"🎯 Student Drawn",s==="zh"?`恭喜学生 [${k.name}] 被抽中回答问题!`:`Student [${k.name}] was selected to answer!`,"success"),setTimeout(()=>{ve(P=>P.filter(fe=>fe!==k.id))},8e3)}};setTimeout(x,n)},Ke=t=>{const r=Math.floor(t/60),o=t%60;return`${r.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`};return e.jsxs("div",{className:"flex-grow flex-1 flex flex-col min-h-0 bg-surface border border-theme rounded-2xl shadow-xl text-main overflow-hidden font-sans",children:[e.jsxs("div",{className:"bg-surface-secondary p-4 border-b border-theme flex flex-wrap items-center justify-between gap-4 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3 select-none",children:[e.jsxs("div",{className:"relative flex items-center justify-center",children:[e.jsx("span",{className:`w-3 h-3 rounded-full ${S?"bg-emerald-500 animate-ping":"bg-rose-500"} absolute`}),e.jsx("span",{className:`w-2 h-2 rounded-full ${S?"bg-emerald-500":"bg-rose-500"} relative`})]}),e.jsx("h2",{className:"text-sm font-extrabold tracking-tight text-main flex items-center gap-2",children:s==="zh"?"🔴 智能授课工作流控制中心":"🔴 Active Lesson control center"})]}),e.jsxs("div",{className:"flex items-center gap-2.5 flex-wrap",children:[e.jsx("div",{children:e.jsxs("select",{value:d||"",onChange:t=>{const r=t.target.value===""?null:t.target.value;L(r),r&&C(r)},className:"bg-surface border border-theme rounded-lg text-xs font-semibold px-3 py-1.5 focus:ring-1 focus:ring-primary-theme text-main outline-none cursor-pointer hover:bg-surface-secondary transition-colors",children:[e.jsx("option",{value:"",children:s==="zh"?"-- 选择授课课节 --":"-- Select Lesson --"}),T.map(t=>e.jsx("option",{value:t.id,children:t.title},t.id))]})}),e.jsx("div",{children:e.jsxs("select",{value:u||"",onChange:t=>U(t.target.value===""?null:t.target.value),className:"bg-surface border border-theme rounded-lg text-xs font-semibold px-3 py-1.5 focus:ring-1 focus:ring-primary-theme text-main outline-none cursor-pointer hover:bg-surface-secondary transition-colors",children:[e.jsx("option",{value:"",children:s==="zh"?"-- 选择授课班级 --":"-- Select Class --"}),le.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[K&&e.jsxs("div",{className:"bg-slate-200/80 p-0.5 rounded-lg flex items-center gap-0.5 border border-slate-300/60 shadow-3xs",children:[e.jsxs("button",{onClick:()=>K("teacher"),className:`px-2.5 py-1 text-[11px] font-bold rounded transition-all cursor-pointer ${Q==="teacher"?"bg-white text-indigo-700 shadow-2xs font-extrabold":"text-slate-600 hover:text-slate-900"}`,children:["👨🏫 ",s==="zh"?"教师模式":"Teacher Mode"]}),e.jsxs("button",{onClick:()=>K("student"),className:`px-2.5 py-1 text-[11px] font-bold rounded transition-all cursor-pointer ${Q==="student"?"bg-pink-600 text-white shadow-2xs font-extrabold":"text-slate-600 hover:text-slate-900"}`,children:["🎓 ",s==="zh"?"学生模式":"Student Mode"]})]}),e.jsxs("button",{onClick:()=>Se(!oe),disabled:a||!d||!u,className:`px-3 py-1.5 rounded-lg font-bold text-[11px] uppercase tracking-wider flex items-center gap-1.5 shadow-sm transition-all active:scale-95 disabled:opacity-50 cursor-pointer ${oe?"bg-rose-500 hover:bg-rose-600 text-white":"bg-indigo-600 hover:bg-indigo-700 text-white"}`,children:[oe?e.jsx(Pe,{size:12}):e.jsx(De,{size:12}),e.jsx("span",{children:oe?s==="zh"?"一键解锁全班":"Unlock Entire Class":s==="zh"?"全班专注锁定":"Lock Class Screen"})]})]})]})]}),e.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0 bg-surface-secondary/30",children:[!h&&e.jsxs("div",{className:"w-[220px] shrink-0 bg-surface p-3.5 border-r border-theme flex flex-col gap-4 overflow-y-auto",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 select-none",children:[e.jsx("h3",{className:"text-[10px] font-black uppercase text-muted tracking-wider",children:s==="zh"?"教学步骤与时间管理":"Lesson Segments & Phases"}),e.jsx("button",{onClick:()=>f(!0),className:"p-1 rounded bg-surface-secondary hover:bg-surface border border-theme text-muted hover:text-main transition-colors cursor-pointer",title:s==="zh"?"折叠导航栏":"Collapse Sidebar",children:e.jsx(it,{size:10})})]}),e.jsxs("div",{className:"bg-surface-secondary border border-theme rounded-xl p-3 flex flex-col items-center justify-center gap-1 shadow-sm",children:[e.jsxs("span",{className:"text-[9.5px] uppercase tracking-widest text-muted font-semibold flex items-center gap-1",children:[e.jsx(ot,{size:11,className:S?"animate-spin":"",style:{animationDuration:"4s"}}),s==="zh"?"当前步骤剩余时间":"Phase Remaining"]}),e.jsx("div",{className:`text-2xl font-black font-mono tracking-widest ${S?"text-primary-theme":"text-muted"}`,children:Ke(_)}),e.jsxs("div",{className:"flex gap-1.5 w-full mt-2 shrink-0",children:[e.jsxs("button",{onClick:()=>$(!S),disabled:_<=0,className:"flex-1 py-1 rounded bg-surface hover:bg-surface-secondary text-[10px] font-bold text-main transition-all disabled:opacity-40 flex items-center justify-center gap-1 border border-theme",children:[S?e.jsx(lt,{size:10}):e.jsx(dt,{size:10}),e.jsx("span",{children:S?s==="zh"?"暂停":"Pause":s==="zh"?"开始":"Start"})]}),e.jsx("button",{onClick:()=>{$(!1),R(0)},className:"py-1 px-2.5 rounded bg-surface hover:bg-rose-500/10 text-[10px] font-bold text-rose-500 hover:text-rose-600 transition-all flex items-center justify-center border border-theme",title:"重置",children:e.jsx(ct,{size:10})})]})]})]}),e.jsxs("div",{className:"flex-1 flex flex-col gap-2 min-h-0",children:[e.jsx("h4",{className:"text-[10px] font-black uppercase text-muted tracking-wider select-none",children:s==="zh"?"教学环节进度表":"Timeline Segments"}),d?e.jsx("div",{className:"space-y-2 overflow-y-auto flex-1 pr-1.5 scrollbar-thin",children:N.map((t,r)=>{const o=M===t.id;return e.jsxs("div",{className:`p-2.5 rounded-xl border transition-all flex flex-col gap-1.5 ${o?"bg-primary-theme/10 border-primary-theme/40 shadow-sm":"bg-surface border-theme hover:bg-surface-secondary"}`,children:[e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("span",{className:`text-[11.5px] font-bold ${o?"text-primary-theme":"text-main"}`,children:[r+1,". ",t.title]}),e.jsx("span",{className:"text-[9px] font-mono px-1 py-0.5 rounded bg-surface-secondary text-muted border border-theme",children:t.duration})]}),e.jsx("div",{className:`text-[9.5px] line-clamp-2 leading-relaxed ${o?"text-primary-theme":"text-muted"}`,children:t.notes||"无步骤描述备注信息。"}),e.jsxs("button",{onClick:()=>qe(t),className:`w-full py-1 rounded text-[10px] font-bold transition-all cursor-pointer flex items-center justify-center gap-1 ${o?"bg-primary-theme text-white hover:bg-primary-theme-hover shadow-sm":"bg-surface-secondary text-muted hover:text-main hover:bg-surface border border-theme"}`,children:[e.jsx(Te,{size:10}),e.jsx("span",{children:o?s==="zh"?"同步演示中":"Broadcasting":s==="zh"?"广播此环节":"Broadcast Step"})]})]},t.id)})}):e.jsx("div",{className:"text-xs text-muted italic py-4 text-center",children:s==="zh"?"请选择一个课节加载流程表":"Select a lesson to view schedule."})]})]}),e.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-surface-secondary/40 p-3 gap-3 relative",children:d?e.jsxs("div",{className:"w-full h-full relative flex flex-col min-h-0",children:[e.jsxs("div",{className:"flex justify-between items-center px-1.5 py-1 select-none text-muted text-[10px] uppercase font-extrabold tracking-wide shrink-0 mb-1",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[h&&e.jsxs("button",{onClick:()=>f(!1),className:"p-1 rounded-lg bg-surface hover:bg-surface-secondary border border-theme text-primary-theme hover:text-primary-theme-hover transition-colors cursor-pointer mr-1.5 flex items-center gap-1 shadow-sm",title:s==="zh"?"展开环节大纲":"Expand Sidebar",children:[e.jsx(xt,{size:10}),e.jsx("span",{className:"text-[9px] font-bold tracking-wider",children:s==="zh"?"展开":"Expand"})]}),e.jsxs("div",{className:"bg-surface-secondary p-0.5 rounded-lg flex items-center gap-1 border border-theme",children:[e.jsx("button",{onClick:()=>ce("whiteboard"),className:`px-3 py-1 rounded-md text-[10px] font-bold transition-all cursor-pointer ${B==="whiteboard"?"bg-surface text-primary-theme shadow-sm":"text-muted hover:text-main"}`,children:s==="zh"?"💻 演示白板":"💻 Whiteboard"}),e.jsx("button",{onClick:()=>ce("submissions"),className:`px-3 py-1 rounded-md text-[10px] font-bold transition-all cursor-pointer ${B==="submissions"?"bg-surface text-primary-theme shadow-sm":"text-muted hover:text-main"}`,children:s==="zh"?"📊 学生提交数据":"📊 Student Submissions"}),e.jsx("button",{id:"teacher_assignment_eval_tab_btn",onClick:()=>ce("assignment"),className:`px-3 py-1 rounded-md text-[10px] font-bold transition-all cursor-pointer ${B==="assignment"?"bg-surface text-primary-theme shadow-sm":"text-muted hover:text-main"}`,children:s==="zh"?"🎓 作业成绩评定":"🎓 Assignment Grades"})]})]}),e.jsxs("span",{className:"text-primary-theme font-mono tracking-widest animate-pulse flex items-center gap-1",children:[e.jsx(ye,{size:10})," Live Broadcaster Connected"]})]}),B==="whiteboard"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-grow flex-1 min-h-0 w-full relative rounded-xl overflow-hidden border border-theme shadow-md bg-surface flex flex-col",children:e.jsx(gt,{lessonId:d,userRole:"teacher",isEditMode:!1,elements:I,activeSegmentId:M,onSegmentSync:t=>A(t),onElementAdd:async(t,r)=>{await fetch(`/api/lessons/${d}/whiteboard`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:t,data:r})}),C(d)},onElementUpdate:async(t,r)=>{await fetch(`/api/lessons/${d}/whiteboard/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:r})}),C(d)},onElementDelete:async t=>{await fetch(`/api/lessons/${d}/whiteboard/${t}`,{method:"DELETE"}),C(d)},onRefresh:()=>C(d)})}),e.jsxs("div",{className:"mt-3 bg-surface border border-theme rounded-xl p-3 shadow-sm shrink-0 flex flex-col gap-2 relative z-30",children:[e.jsxs("div",{className:"flex items-center justify-between text-[10px] uppercase font-black text-muted tracking-wider select-none",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-primary-theme",children:[e.jsx(Ce,{size:12,className:"text-primary-theme animate-pulse"}),e.jsx("span",{children:s==="zh"?"互动工具 (插件扩展)":"Classroom Interactive Tools"})]}),e.jsxs("span",{className:"text-[8.5px] text-muted font-mono",children:["Plugins: ",ue.length," Active"]})]}),ue.length>0?e.jsx("div",{className:"flex gap-2.5 overflow-x-auto py-0.5 pr-2 scrollbar-thin",children:ue.map(t=>e.jsxs("button",{onClick:()=>Ie(t),disabled:!d,className:"p-2 bg-surface-secondary hover:bg-surface border border-theme hover:border-primary-theme/50 rounded-xl text-left transition-all active:scale-[0.98] disabled:opacity-40 flex items-center gap-2.5 w-44 shrink-0 group cursor-pointer",title:t.description,children:[e.jsx("div",{className:"p-1.5 bg-primary-theme/10 text-primary-theme group-hover:bg-primary-theme/20 rounded-lg border border-primary-theme/20 shrink-0 transition-colors",children:e.jsx(wt,{name:t.icon,size:14})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-xs font-bold text-main truncate",children:t.name}),e.jsx("div",{className:"text-[9px] text-muted truncate mt-0.5",children:t.description})]})]},t.id))}):e.jsx("div",{className:"text-center py-2 text-[10px] text-muted italic",children:s==="zh"?"暂无可用的互动工具。请在应用商店启用插件。":"No plugin tools loaded."})]})]}):B==="submissions"?e.jsxs("div",{className:"flex-grow flex-1 min-h-0 w-full relative rounded-xl overflow-hidden border border-theme shadow-md bg-surface flex flex-col p-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4 gap-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-bold text-main",children:s==="zh"?"学生互动提交数据列表":"Student Submissions"}),re.length>0&&e.jsxs("span",{className:"text-[9px] bg-primary-theme/10 text-primary-theme px-2 py-0.5 rounded-full border border-primary-theme/20 font-bold",children:[re.length," ",s==="zh"?"条记录":"records"]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",placeholder:s==="zh"?"搜索学生或课件...":"Search student or courseware...",value:pe,onChange:t=>Je(t.target.value),className:"bg-surface border border-theme rounded-lg text-xs pl-8 pr-3 py-1.5 focus:ring-1 focus:ring-primary-theme text-main outline-none w-44 transition-all"}),e.jsx(mt,{size:12,className:"absolute left-2.5 top-2.5 text-muted"})]}),e.jsxs("select",{value:ne,onChange:t=>Fe(t.target.value),className:"bg-surface border border-theme rounded-lg text-xs px-3 py-1.5 focus:ring-1 focus:ring-primary-theme text-main outline-none cursor-pointer hover:bg-surface-secondary transition-colors",children:[e.jsx("option",{value:"all",children:s==="zh"?"全部状态":"All Status"}),e.jsx("option",{value:"submitted",children:s==="zh"?"已提交/完成":"Submitted/Finished"}),e.jsx("option",{value:"started",children:s==="zh"?"进行中":"In Progress"})]}),e.jsx("button",{onClick:ie,disabled:xe,className:"p-1.5 bg-surface hover:bg-surface-secondary border border-theme rounded-lg text-muted hover:text-main transition-colors cursor-pointer flex items-center justify-center shadow-sm disabled:opacity-50",title:s==="zh"?"刷新数据":"Refresh",children:e.jsx(X,{size:12,className:xe?"animate-spin":""})})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto border border-theme rounded-xl scrollbar-thin",children:xe?e.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-muted gap-2",children:[e.jsx(X,{size:24,className:"animate-spin text-primary-theme mb-2"}),e.jsx("span",{className:"text-xs",children:s==="zh"?"正在加载学生提交数据...":"Loading submissions..."})]}):(()=>{const t=u?y.map(n=>n.id):[],o=(u?re.filter(n=>t.includes(n.studentId)):re).filter(n=>{const x=n.studentName?.toLowerCase().includes(pe.toLowerCase())||n.coursewareName?.toLowerCase().includes(pe.toLowerCase()),p=ne==="all"||ne==="submitted"&&(n.status==="submitted"||n.status==="finished")||ne==="started"&&n.status==="started";return x&&p});return o.length===0?e.jsxs("div",{className:"h-full flex flex-col items-center justify-center py-12 text-muted gap-2",children:[e.jsx(Ne,{size:32,className:"text-muted/60"}),e.jsx("span",{className:"text-xs",children:s==="zh"?"暂无匹配的提交数据。":"No matching submissions found."}),!u&&e.jsx("span",{className:"text-[10px] text-muted italic",children:s==="zh"?"提示:请在顶部选择一个班级进行筛选。":"Tip: Select a class at the top to filter."})]}):e.jsxs("table",{className:"w-full border-collapse text-left text-xs text-main",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-surface-secondary border-b border-theme font-bold text-muted select-none",children:[e.jsx("th",{className:"p-3",children:s==="zh"?"学生姓名":"Student Name"}),e.jsx("th",{className:"p-3",children:s==="zh"?"交互课件":"Courseware"}),e.jsx("th",{className:"p-3",children:s==="zh"?"状态":"Status"}),e.jsx("th",{className:"p-3 text-center",children:s==="zh"?"成绩":"Score"}),e.jsx("th",{className:"p-3 text-center",children:s==="zh"?"完成度":"Completion"}),e.jsx("th",{className:"p-3 text-right",children:s==="zh"?"操作":"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-border-theme",children:o.map(n=>{const x=n.status==="finished"||n.status==="submitted",p=n.started_at?new Date(n.started_at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"N/A";return e.jsxs("tr",{className:"hover:bg-surface-secondary/50 transition-colors group",children:[e.jsxs("td",{className:"p-3",children:[e.jsx("div",{className:"font-semibold text-main",children:n.studentName}),e.jsxs("div",{className:"text-[10px] text-muted mt-0.5",children:[s==="zh"?"时间":"Time",": ",p]})]}),e.jsx("td",{className:"p-3 font-medium text-main max-w-[150px] truncate",title:n.coursewareName,children:n.coursewareName}),e.jsx("td",{className:"p-3",children:e.jsx("span",{className:`px-2 py-0.5 rounded-full border text-[10px] font-bold ${x?"bg-emerald-50 text-emerald-700 border-emerald-100":"bg-blue-50 text-blue-700 border-blue-100 animate-pulse"}`,children:x?s==="zh"?"已提交":"Finished":s==="zh"?"进行中":"Running"})}),e.jsx("td",{className:"p-3 text-center font-bold font-mono",children:n.score!==null?e.jsxs("span",{className:"text-primary-theme bg-primary-theme/10 border border-primary-theme/20 px-1.5 py-0.5 rounded-md",children:[n.score,"分"]}):e.jsx("span",{className:"text-muted font-medium",children:"-"})}),e.jsx("td",{className:"p-3 text-center font-semibold font-mono",children:n.completion!==null?`${Math.round(n.completion*100)}%`:"0%"}),e.jsx("td",{className:"p-3 text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs("button",{onClick:()=>Le(n),className:"p-1 text-muted hover:text-primary-theme hover:bg-surface-secondary border border-transparent hover:border-theme rounded-lg transition-colors cursor-pointer flex items-center gap-1 text-[10px]",title:s==="zh"?"查看提交轨迹事件数据":"View Raw Data",children:[e.jsx(ht,{size:12}),e.jsx("span",{children:s==="zh"?"轨迹":"Events"})]}),n.isPromoted>0?e.jsxs("span",{className:"px-2 py-1 text-emerald-650 font-bold text-[10px] flex items-center gap-0.5 bg-emerald-50/50 rounded-lg border border-emerald-100",children:[e.jsx(pt,{size:11}),s==="zh"?"已归档":"Saved"]}):e.jsxs("button",{onClick:()=>Be(n.attemptId),disabled:!x,className:`px-2 py-1 text-[10px] font-bold rounded-lg flex items-center gap-1 shadow-sm transition-all active:scale-95 cursor-pointer border ${x?"bg-primary-theme hover:bg-primary-theme-hover text-white border-primary-theme":"bg-surface-secondary text-muted border-theme cursor-not-allowed opacity-60"}`,title:s==="zh"?"将分数和进度作为随堂学习数据存入数据库,记入学期成绩":"Save to DB & Semester grade",children:[e.jsx(Me,{size:11}),e.jsx("span",{children:s==="zh"?"录入成绩":"Record"})]})]})})]},n.attemptId)})})]})})()})]}):e.jsx(Nt,{lessonId:d||"",lang:s==="zh"?"zh":"en",addToast:b})]}):e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-slate-455 gap-2.5 select-none",children:[e.jsx(Te,{size:38,className:"text-slate-300 animate-bounce",style:{animationDuration:"2.5s"}}),e.jsx("div",{className:"text-sm font-bold text-slate-655",children:s==="zh"?"请在顶部栏选择一个授课课节":"Please select a lesson to start teaching"}),e.jsx("p",{className:"text-[10px] text-slate-400",children:"白板及环节控制面板将在课节载入后自动生成"})]})}),e.jsxs("div",{className:"w-[260px] shrink-0 bg-surface p-3.5 border-l border-theme flex flex-col gap-3.5 overflow-hidden",children:[e.jsxs("div",{className:"flex-1 flex flex-col min-h-0 gap-2",children:[e.jsxs("h3",{className:"text-[10px] font-black uppercase text-muted tracking-wider select-none flex justify-between items-center shrink-0",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{children:s==="zh"?"学生专注力监控":"Student Status Console"}),u&&e.jsxs("button",{onClick:Qe,disabled:y.length===0||j,className:"ml-2 text-[9px] font-bold bg-primary-theme/10 text-primary-theme border border-primary-theme/20 px-1.5 py-0.5 rounded hover:bg-primary-theme/20 transition-colors flex items-center gap-1 active:scale-95 disabled:opacity-50 cursor-pointer shrink-0",title:s==="zh"?"随机抽取一名学生提问":"Pick a student randomly",children:[e.jsx(Ce,{size:8.5,className:j?"animate-spin":""}),e.jsx("span",{children:s==="zh"?"随机抽问":"Pick Student"})]})]}),e.jsxs("span",{className:"text-[9px] bg-surface-secondary border border-theme text-muted font-mono px-1.5 py-0.5 rounded-md",children:[y.filter(t=>t.locked_lesson_id===d).length," / ",y.length," Locked"]})]}),u?e.jsx("div",{className:"overflow-y-auto flex-1 pr-1 grid grid-cols-3 gap-2 justify-items-center auto-rows-max scrollbar-thin py-2",children:y.map(t=>{const r=t.locked_lesson_id===d,o=q.get(t.id),n=O.includes(t.id),p=l[t.id]===d,k=F.find(H=>H.student_id===t.id)?.progress_percent??0,P=M?N.findIndex(H=>H.id===M):-1,fe=N.length>0?Math.round((P+1)/N.length*100):0,$e=P>=0&&k<fe,D=Re.includes(t.id),be=J===t.id,ge=22,_e=3,je=2*Math.PI*ge,He=je-k/100*je;let W="stroke-indigo-650";return D?W="stroke-amber-500 stroke-[3.5px]":be?W="stroke-indigo-500 stroke-[3.5px] animate-pulse":n?r?W="stroke-rose-500 animate-pulse":$e?W="stroke-amber-500 animate-pulse":p?k===100&&(W="stroke-emerald-500"):W="stroke-blue-400":W="stroke-slate-200",e.jsxs("div",{onMouseEnter:()=>g(t.id),onMouseLeave:()=>g(null),className:`group relative flex flex-col items-center justify-center p-1 rounded-xl transition-all cursor-default ${D?"z-20 duration-300":be?"z-20":"hover:bg-slate-50"}`,children:[e.jsxs("div",{className:`relative w-14 h-14 flex items-center justify-center rounded-full transition-all duration-300 ${D?"shadow-[0_0_15px_#f59e0b] scale-110 z-10 bg-amber-50 ring-2 ring-amber-400 ring-offset-1":be?"shadow-[0_0_10px_#6366f1] scale-105 z-10 bg-indigo-50 ring-1 ring-indigo-400":""}`,children:[D&&e.jsx("div",{className:"absolute inset-0 rounded-full bg-amber-400/30 animate-ping",style:{animationDuration:"2s"}}),e.jsxs("svg",{className:"absolute w-full h-full transform -rotate-90",viewBox:"0 0 50 50",children:[e.jsx("circle",{cx:"25",cy:"25",r:ge,className:"stroke-slate-100 fill-white",strokeWidth:_e}),e.jsx("circle",{cx:"25",cy:"25",r:ge,className:`fill-transparent transition-all duration-300 ${W}`,strokeWidth:_e,strokeDasharray:je,strokeDashoffset:He,strokeLinecap:"round"})]}),e.jsxs("div",{className:`relative z-10 w-10 h-10 rounded-full flex items-center justify-center overflow-hidden transition-colors ${D?"bg-amber-100/90":""}`,children:[e.jsx("span",{className:`text-[10px] font-bold tracking-tight truncate max-w-[34px] group-hover:scale-0 group-hover:opacity-0 transition-all duration-200 select-none ${D?"text-amber-900 font-extrabold":n?"text-slate-700":"text-slate-400"}`,children:t.name}),e.jsxs("div",{className:"absolute inset-0 flex items-center justify-center gap-1 opacity-0 scale-50 group-hover:opacity-100 group-hover:scale-100 transition-all duration-200 bg-white/95 rounded-full shadow-inner",children:[d&&ee&&e.jsx("button",{onClick:()=>{const H=s==="zh"?`⚠️ 学习进度预警:您当前的进度 (${k}%) 落后于老师的讲解进度。请专注课堂,跟上讲解!`:`⚠️ Progress Alert: Your progress (${k}%) is behind.`;ee(t.id,H),b(s==="zh"?"🔔 已发送提醒":"🔔 Alert Sent",`已向学生 ${t.name} 发送进度提醒。`,"success")},className:`p-0.5 rounded-md hover:bg-slate-105 transition-colors shrink-0 cursor-pointer ${$e?"text-amber-500 hover:text-amber-600 animate-pulse":"text-slate-400 hover:text-slate-650"}`,title:"提醒",children:e.jsx(Ae,{size:10})}),e.jsx("button",{onClick:()=>Ve(t.id,t.locked_lesson_id),disabled:!d,className:`p-0.5 rounded-md hover:bg-slate-105 transition-colors shrink-0 cursor-pointer ${r?"text-rose-500 hover:text-rose-600":"text-slate-400 hover:text-slate-655"}`,title:r?"解锁":"锁定",children:r?e.jsx(Pe,{size:10}):e.jsx(De,{size:10})})]})]}),D?e.jsx("span",{className:"absolute -top-1.5 -right-1.5 z-20 text-[9px] bg-amber-500 text-white rounded-full w-4 h-4 flex items-center justify-center font-bold shadow-md animate-bounce",children:"🎯"}):n&&e.jsx("span",{className:`absolute top-0 right-0 w-2.5 h-2.5 rounded-full border-2 border-white shrink-0 ${p?"bg-emerald-500":"bg-blue-400"}`,title:p?"正在上课":"在线(但未进课堂)"}),o===!0&&!D&&e.jsx("span",{className:"absolute bottom-0 right-0 w-2.5 h-2.5 rounded-full border-2 border-white bg-amber-500 shrink-0 animate-bounce",title:"已确认/就位"})]}),e.jsx("span",{className:`text-[8.5px] mt-1 truncate max-w-[48px] select-none font-medium ${D?"text-amber-600 font-extrabold animate-bounce":n?"text-slate-505":"text-slate-350"}`,children:D?"🎯 抽中":`${k}%`})]},t.id)})}):e.jsx("div",{className:"text-xs text-slate-400 italic py-4 text-center flex-1 flex items-center justify-center",children:s==="zh"?"请选择班级以显示学生":"Select class to show student monitors."})]}),e.jsx("div",{className:"bg-surface-secondary border border-theme rounded-xl p-3 flex flex-col gap-1.5 h-[135px] shrink-0 shadow-sm select-none justify-center",children:v?(()=>{const t=y.find(x=>x.id===v);if(!t)return null;const r=F.find(x=>x.student_id===t.id),o=r?.progress_percent??0,n=(()=>{if(!r||!r.completed_segments)return[];try{return typeof r.completed_segments=="string"?JSON.parse(r.completed_segments):r.completed_segments}catch{return[]}})();return e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-main",children:[e.jsxs("div",{className:"font-extrabold text-main border-b border-theme pb-1 flex justify-between items-center shrink-0",children:[e.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[e.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${O.includes(t.id)?"bg-emerald-500 animate-pulse":"bg-slate-300"}`}),e.jsxs("span",{className:"truncate max-w-[130px]",children:[t.name," (",t.student_number||"N/A",")"]})]}),e.jsxs("span",{className:"text-[10px] text-primary-theme font-mono font-black shrink-0",children:[o,"%"]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-1.5 text-[9.5px] leading-tight shrink-0",children:[e.jsxs("div",{className:"flex flex-col gap-0.5 bg-surface p-1 rounded-lg border border-theme",children:[e.jsx("span",{className:"text-muted font-bold",children:"随堂测验"}),e.jsx("span",{className:`font-bold font-mono text-[10px] ${r!=null&&r.quiz_score!==null?"text-primary-theme":"text-muted"}`,children:r!=null&&r.quiz_score!==null?`${r.quiz_score} / 100`:"未提交"})]}),e.jsxs("div",{className:"flex flex-col gap-0.5 bg-surface p-1 rounded-lg border border-theme",children:[e.jsx("span",{className:"text-muted font-bold",children:"教学环节进度"}),e.jsxs("span",{className:"font-bold text-main text-[10px]",children:[Array.isArray(n)?n.length:0," / ",N.length]})]})]}),e.jsxs("div",{className:"text-[9px] text-muted leading-relaxed truncate mt-0.5 shrink-0",children:["环节: ",N.length>0?N.map((x,p)=>{const z=Array.isArray(n)&&n.includes(x.id);return e.jsxs("span",{className:`mr-1 px-1 py-0.2 rounded ${z?"bg-emerald-50 text-emerald-600 border border-emerald-100":"bg-surface text-muted border border-theme"}`,title:x.title,children:[p+1,":",z?"✓":"✗"]},x.id)}):e.jsx("span",{className:"italic text-muted",children:"暂无步骤"})]})]})})():e.jsxs("div",{className:"flex flex-col gap-1 text-xs text-main h-full justify-center",children:[e.jsxs("div",{className:"font-extrabold text-main border-b border-theme pb-1.5 flex items-center gap-1.5 shrink-0",children:[e.jsx(ye,{size:12,className:"text-primary-theme animate-pulse"}),e.jsx("span",{children:s==="zh"?"班级学情概况":"Class Overview"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-1.5 text-[9.5px] leading-tight mt-1.5 shrink-0",children:[e.jsxs("div",{className:"flex flex-col items-center bg-surface py-1 rounded-lg border border-theme",children:[e.jsx("span",{className:"text-muted font-medium",children:"在线/总数"}),e.jsxs("span",{className:"font-bold font-mono text-emerald-600 text-[11px] mt-0.5",children:[y.filter(t=>O.includes(t.id)).length,"/",y.length]})]}),e.jsxs("div",{className:"flex flex-col items-center bg-surface py-1 rounded-lg border border-theme",children:[e.jsx("span",{className:"text-muted font-medium",children:"屏幕锁定"}),e.jsx("span",{className:"font-bold font-mono text-rose-500 text-[11px] mt-0.5",children:y.filter(t=>t.locked_lesson_id===d).length})]}),e.jsxs("div",{className:"flex flex-col items-center bg-surface py-1 rounded-lg border border-theme",children:[e.jsx("span",{className:"text-muted font-medium",children:"平均进度"}),e.jsx("span",{className:"font-bold font-mono text-primary-theme text-[11px] mt-0.5",children:(()=>{const t=y.filter(o=>O.includes(o.id));if(t.length===0)return"0%";const r=t.reduce((o,n)=>{const x=F.find(p=>p.student_id===n.id);return o+(x?.progress_percent??0)},0);return`${Math.round(r/t.length)}%`})()})]})]})]})}),e.jsxs("div",{className:"h-[160px] flex flex-col border-t border-theme pt-3 min-h-0 gap-2 shrink-0",children:[e.jsxs("h3",{className:"text-[10px] font-black uppercase text-muted tracking-wider select-none flex justify-between items-center",children:[e.jsx("span",{children:s==="zh"?"课堂互动反馈流":"Live Classroom Feed"}),e.jsx("button",{onClick:()=>w([{id:"clear",time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),type:"info",message:"反馈流已清空。"}]),className:"text-[9px] hover:text-main text-muted underline transition-all",children:"Clear"})]}),e.jsx("div",{className:"flex-1 bg-surface-secondary border border-theme rounded-xl p-2.5 font-mono text-[9px] leading-relaxed overflow-y-auto space-y-2 select-text text-left text-main shadow-inner scrollbar-thin",children:Z.map(t=>e.jsxs("div",{className:"border-b border-theme pb-1.5 last:border-b-0",children:[e.jsxs("div",{className:"flex justify-between items-center text-muted font-bold mb-0.5",children:[e.jsx("span",{children:t.time}),e.jsx("span",{className:`px-1 rounded uppercase tracking-wide text-[7px] ${t.type==="success"?"bg-emerald-50 text-emerald-600 border border-emerald-100":t.type==="warning"?"bg-amber-50 text-amber-600 border border-amber-100":"bg-surface text-muted border border-theme"}`,children:t.type})]}),e.jsx("p",{className:t.type==="success"?"text-emerald-700 font-medium":t.type==="warning"?"text-amber-700 font-medium":"text-main",children:t.message})]},t.id))})]})]})]}),E&&e.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-surface rounded-2xl shadow-2xl max-w-2xl w-full max-h-[85vh] flex flex-col overflow-hidden border border-theme animate-in fade-in zoom-in duration-200 text-main",children:[e.jsxs("div",{className:"bg-surface-secondary px-6 py-4 border-b border-theme flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ne,{className:"text-primary-theme",size:18}),e.jsx("h3",{className:"text-sm font-bold text-main",children:s==="zh"?`[${E.studentName}] 的互动提交轨迹详情`:`Submission Details - ${E.studentName}`})]}),e.jsx("button",{onClick:()=>me(null),className:"text-muted hover:text-main p-1.5 hover:bg-surface-secondary rounded-lg transition-colors cursor-pointer",children:e.jsx(ut,{size:18})})]}),e.jsxs("div",{className:"p-6 overflow-y-auto space-y-4 flex-1 scrollbar-thin",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"bg-surface-secondary p-3 rounded-xl border border-theme",children:[e.jsx("div",{className:"text-[10px] text-muted font-bold uppercase tracking-wider",children:s==="zh"?"课件名称":"Courseware"}),e.jsx("div",{className:"text-xs font-semibold text-main mt-1 truncate",title:E.coursewareName,children:E.coursewareName})]}),e.jsxs("div",{className:"bg-surface-secondary p-3 rounded-xl border border-theme",children:[e.jsx("div",{className:"text-[10px] text-muted font-bold uppercase tracking-wider",children:s==="zh"?"提交成绩":"Score"}),e.jsx("div",{className:"text-xs font-bold text-primary-theme mt-1",children:E.score!==null?`${E.score} 分`:s==="zh"?"未打分":"N/A"})]}),e.jsxs("div",{className:"bg-surface-secondary p-3 rounded-xl border border-theme",children:[e.jsx("div",{className:"text-[10px] text-muted font-bold uppercase tracking-wider",children:s==="zh"?"课件完成度":"Completion"}),e.jsx("div",{className:"text-xs font-bold text-emerald-600 mt-1",children:E.completion!==null?`${Math.round(E.completion*100)}%`:"0%"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h4",{className:"text-xs font-bold text-main border-b border-theme pb-1.5 flex items-center gap-1.5 flex-wrap",children:[e.jsx(ye,{size:13,className:"text-primary-theme"}),e.jsx("span",{children:s==="zh"?"实时捕获轨迹事件流 (LMS Bridge)":"LMS Event Captures"})]}),We?e.jsxs("div",{className:"py-12 flex flex-col items-center justify-center text-muted gap-2",children:[e.jsx(X,{size:20,className:"animate-spin text-primary-theme"}),e.jsx("span",{className:"text-xs",children:s==="zh"?"正在查询原始数据...":"Loading raw data..."})]}):Array.isArray(he)&&he.length>0?e.jsx("div",{className:"space-y-3 font-mono text-[11px] max-h-[40vh] overflow-y-auto pr-1 scrollbar-thin",children:he.map((t,r)=>{let o={};try{o=typeof t.payload_json=="string"?JSON.parse(t.payload_json):t.payload_json}catch{}return e.jsxs("div",{className:"p-3 bg-slate-900 text-slate-200 rounded-xl border border-slate-800 flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex justify-between items-center text-[10px] text-slate-400 border-b border-slate-800 pb-1",children:[e.jsx("span",{className:"font-bold text-indigo-400 bg-indigo-950/50 border border-indigo-900/50 px-1.5 py-0.5 rounded",children:t.event_type}),e.jsx("span",{children:new Date(t.created_at).toLocaleTimeString()})]}),e.jsx("pre",{className:"overflow-x-auto text-[10px] leading-relaxed p-1 text-emerald-400/90 whitespace-pre-wrap word-break-all",children:JSON.stringify(o,null,2)})]},t.id||r)})}):e.jsx("div",{className:"py-8 text-center text-xs text-muted italic",children:s==="zh"?"该学生未产生任何轨迹事件数据。":"No trace events captured."})]})]}),e.jsxs("div",{className:"bg-surface-secondary px-6 py-4 border-t border-theme flex justify-between gap-3 shrink-0",children:[e.jsxs("div",{className:"text-[10px] text-muted flex items-center gap-1",children:[e.jsx(Ee,{size:10}),e.jsx("span",{children:"Powered by LMS Bridge API v1"})]}),e.jsx("button",{onClick:()=>me(null),className:"px-4 py-1.5 bg-surface hover:bg-surface-secondary border border-theme text-main font-bold rounded-lg text-xs transition-all cursor-pointer shadow-sm active:scale-95",children:s==="zh"?"关闭窗口":"Close"})]})]})})]})}export{Ct as LiveClassroomView};
|
package/dist/assets/{NotificationDetailModal-Bk1g_prI.js → NotificationDetailModal-BxrpnlWV.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-react-0Lg0vA-4.js";import{m as n}from"./index-
|
|
1
|
+
import{j as e}from"./vendor-react-0Lg0vA-4.js";import{m as n}from"./index-CYzNsYZB.js";import{m as o,o as d,x as l,ac as i}from"./vendor-icons-Dq6MhgH9.js";import"./vendor-pdf-Cp-cYteE.js";import"./vendor-utils-BEhuP0Zq.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-pptx-B_NheIKl.js";import"./vendor-charts-CRXa4AlU.js";function f({notification:s,onClose:t,lang:r,onOpenWorkspace:a}){return s?e.jsx("div",{className:"fixed inset-0 bg-gray-900/40 backdrop-blur-sm flex items-center justify-center p-6 z-50",children:e.jsxs(n.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white border text-gray-900 border-gray-200 rounded-2xl shadow-2xl w-full max-w-xl flex flex-col overflow-hidden max-h-[85vh] font-sans",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center justify-between bg-gray-50/80 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(o,{className:"text-indigo-600 font-sans shrink-0",size:20}),e.jsx("h2",{className:"font-bold text-gray-800 text-base font-sans truncate",children:s.title})]}),e.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 font-bold p-1 hover:bg-gray-200 rounded transition-colors text-lg",children:"×"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:[e.jsx("div",{className:"p-4 bg-indigo-50/50 rounded-xl border border-indigo-100 text-sm text-gray-700 leading-relaxed font-sans",children:s.message}),s.assignment&&e.jsxs("div",{className:"space-y-4 font-sans",children:[e.jsxs("div",{className:"border border-gray-150 rounded-xl p-4 bg-gray-50/50 space-y-3",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-xs text-gray-400 uppercase tracking-wider font-semibold font-sans",children:r==="zh"?"关联作业":"Associated Assignment"}),s.assignment.submission_status==="graded"&&e.jsx("span",{className:"bg-green-100 border border-green-200 text-green-800 text-xs font-bold px-2.5 py-1 rounded-full shadow-sm font-mono",children:r==="zh"?`得分:${s.assignment.score}%`:`Score: ${s.assignment.score}%`})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-bold text-base text-indigo-900 font-sans",children:s.assignment.title}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 font-sans",children:s.assignment.class_name})]}),s.assignment.feedback&&e.jsxs("div",{className:"mt-3 bg-white p-3 rounded-lg border border-gray-150 space-y-1 font-sans",children:[e.jsxs("div",{className:"text-xs font-bold text-green-700 flex items-center justify-between gap-2 font-sans",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(d,{size:14,className:"font-sans"}),e.jsx("span",{children:r==="zh"?"教师评审意见与反馈":"Teacher Feedback & Recommendations"})]}),s.assignment.graded_at&&e.jsxs("div",{className:"text-[10px] text-gray-400 font-mono flex items-center gap-1 font-normal select-none",children:[e.jsx(l,{size:11,className:"text-neutral-400"}),e.jsx("span",{children:new Date(s.assignment.graded_at).toLocaleString(r==="zh"?"zh-CN":"en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]})]}),e.jsx("div",{className:"text-xs text-gray-600 italic bg-green-50/30 p-2 rounded border border-green-50 mt-1 leading-relaxed whitespace-pre-wrap font-sans",children:s.assignment.feedback})]})]}),s.assignment.submission_content&&e.jsxs("div",{className:"space-y-1.5 font-sans",children:[e.jsx("div",{className:"text-xs text-gray-400 font-bold uppercase tracking-wider font-sans",children:r==="zh"?"我提交的内容":"My Submission Content"}),e.jsx("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-xl border border-gray-800 overflow-x-auto max-h-40 overflow-y-auto text-xs font-mono leading-relaxed whitespace-pre-wrap",children:s.assignment.submission_content})]})]})]}),e.jsxs("div",{className:"p-4 border-t border-gray-100 bg-gray-50/85 flex justify-end gap-2.5 shrink-0 font-sans",children:[e.jsx("button",{type:"button",onClick:t,className:"px-4 py-2 text-xs font-semibold border border-gray-200 text-gray-700 bg-white rounded-lg hover:bg-gray-100 transition-colors cursor-pointer",children:r==="zh"?"关闭":"Close"}),s.assignment&&e.jsxs("button",{type:"button",onClick:()=>a(s.assignment),className:"px-4 py-2 text-xs font-bold bg-indigo-600 text-white border border-indigo-700 rounded-lg hover:bg-indigo-700 hover:shadow shadow-sm transition-all cursor-pointer flex items-center gap-1.5 font-sans",children:[e.jsx(i,{size:14,className:"font-sans"}),r==="zh"?"打开画布 / 查看详情":"Open Workspace Canvas"]})]})]})}):null}export{f as NotificationDetailModal};
|