openlearn-next 0.2.8 → 0.2.9

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.
Files changed (45) hide show
  1. package/dist/assets/BatchPickerModal-9BhmNM2R.js +1 -0
  2. package/dist/assets/{ClassesView-B1B3wlkx.js → ClassesView-DKScQDos.js} +2 -2
  3. package/dist/assets/CloudDriveModal-cPtTMriS.js +1 -0
  4. package/dist/assets/CourseManagement-AoauIULq.js +1 -0
  5. package/dist/assets/CourseWizardModal-BOgLpLz7.js +3 -0
  6. package/dist/assets/{Dashboard-DQ91dQio.js → Dashboard-BPxkmnvI.js} +2 -2
  7. package/dist/assets/ExportWeightModal-DSzySeqh.js +1 -0
  8. package/dist/assets/{HelpView-DLAKVpwf.js → HelpView-CuNDka5n.js} +3 -3
  9. package/dist/assets/ImportLessonsModal-Bwy2r-96.js +1 -0
  10. package/dist/assets/InteractiveWhiteboard-C7JMplbp.js +62 -0
  11. package/dist/assets/{LazyWhiteboard-B6rDWBFb.js → LazyWhiteboard-BIepzrv9.js} +1 -1
  12. package/dist/assets/LessonEditorView-C-mvYRUd.js +1 -0
  13. package/dist/assets/LiveClassroomView-CqRbWNis.js +1 -0
  14. package/dist/assets/NotificationDetailModal-Bk1g_prI.js +1 -0
  15. package/dist/assets/{PluginView-DCY4yi2h.js → PluginView-C6s7Ltcy.js} +1 -1
  16. package/dist/assets/QuizGeneratorModal-DWH1zP0X.js +1 -0
  17. package/dist/assets/StudentAssignmentView-CfTjeoAp.js +1 -0
  18. package/dist/assets/StudentLessonView-D2XvNGnW.js +1 -0
  19. package/dist/assets/StudentPreviewModal-BwXG6Cis.js +1 -0
  20. package/dist/assets/StudentView-DT-373QP.js +2 -0
  21. package/dist/assets/SystemResourceLibraryModal-BTL8rB0g.js +1 -0
  22. package/dist/assets/TeacherView-XdD-y67J.js +2 -0
  23. package/dist/assets/index-C5FKWIUq.js +190 -0
  24. package/dist/assets/{vendor-pptx-B0hlo0eh.js → vendor-pptx-B_NheIKl.js} +5 -5
  25. package/dist/index.html +1 -1
  26. package/dist/server.cjs +92 -1
  27. package/package.json +1 -1
  28. package/dist/assets/BatchPickerModal-Bt8Qx0Av.js +0 -1
  29. package/dist/assets/CloudDriveModal-BSZaWIex.js +0 -1
  30. package/dist/assets/CourseManagement-Bnezm9Vv.js +0 -1
  31. package/dist/assets/CourseWizardModal-BvfTvcQT.js +0 -3
  32. package/dist/assets/ExportWeightModal-al1iIVxb.js +0 -1
  33. package/dist/assets/ImportLessonsModal-DwhvqzY_.js +0 -1
  34. package/dist/assets/InteractiveWhiteboard-CQ-4meYj.js +0 -102
  35. package/dist/assets/LessonEditorView-DixwX1Kw.js +0 -1
  36. package/dist/assets/LiveClassroomView-j93YOxSh.js +0 -1
  37. package/dist/assets/NotificationDetailModal-CQ9PIqkD.js +0 -1
  38. package/dist/assets/QuizGeneratorModal-BvTcmD68.js +0 -1
  39. package/dist/assets/StudentAssignmentView-4R0WxStx.js +0 -1
  40. package/dist/assets/StudentLessonView-DZ0i9-tX.js +0 -1
  41. package/dist/assets/StudentPreviewModal-CfsB1dPY.js +0 -1
  42. package/dist/assets/StudentView-D7GtUiYR.js +0 -2
  43. package/dist/assets/SystemResourceLibraryModal-Ilnthwpw.js +0 -1
  44. package/dist/assets/TeacherView-DjnjsQ_3.js +0 -2
  45. package/dist/assets/index-D8x6bUeG.js +0 -150
package/dist/index.html CHANGED
@@ -15,7 +15,7 @@
15
15
  }
16
16
  }
17
17
  </script>
18
- <script type="module" crossorigin src="/assets/index-D8x6bUeG.js"></script>
18
+ <script type="module" crossorigin src="/assets/index-C5FKWIUq.js"></script>
19
19
  <link rel="stylesheet" crossorigin href="/assets/index-CATki2cp.css">
20
20
  </head>
21
21
  <body>
package/dist/server.cjs CHANGED
@@ -2605,7 +2605,9 @@ parentPort.on('message', async function(msg) {
2605
2605
  }
2606
2606
 
2607
2607
  // \u6784\u5EFA\u63D2\u4EF6\u81EA\u5EFA\u8868 API (dbApi)
2608
- var tablePrefix = 'plugin_' + workerData.pluginId.replace(/[^a-zA-Z0-9_]/g, '_') + '_';
2608
+ // \u8868\u524D\u7F00\u5FC5\u987B\u7528 manifestId\uFF08\u4E0E\u547D\u4EE4\u547D\u540D\u7A7A\u95F4 L525 \u53CA ServiceHost \u7684 DDL \u5B88\u536B\u4E00\u81F4\uFF09\uFF0C
2609
+ // \u5426\u5219 Worker \u63D2\u4EF6\u5728\u81EA\u5DF1\u547D\u540D\u7A7A\u95F4\u5EFA\u8868\u4F1A\u88AB\u8BEF\u5224\u4E3A\u8D8A\u6743 DDL\u3002
2610
+ var tablePrefix = 'plugin_' + (workerData.manifestId || workerData.pluginId).replace(/[^a-zA-Z0-9_]/g, '_') + '_';
2609
2611
  var dbService = rawServices['@openlearn/core:IDatabase'];
2610
2612
  var dbApi = dbService ? {
2611
2613
  ensureTable: function(tableName, schema) {
@@ -18681,6 +18683,27 @@ var BRIDGE_SDK_CODE = `(function() {
18681
18683
  }
18682
18684
  } catch (e) {}
18683
18685
 
18686
+ // \u2500\u2500 Bidirectional host\u2192courseware command bus \u2500\u2500
18687
+ var __lmsHandlers = {};
18688
+ var __lmsPendingRequests = {};
18689
+ window.addEventListener('message', function(event) {
18690
+ var d = event.data;
18691
+ if (!d || typeof d !== 'object') return;
18692
+ if (d.type === 'LMS_HOST_COMMAND' && d.event) {
18693
+ var cbs = __lmsHandlers[d.event] || [];
18694
+ for (var i = 0; i < cbs.length; i++) {
18695
+ try { cbs[i](d.payload); } catch (e) {}
18696
+ }
18697
+ } else if (d.type === 'LMS_PROGRESS_RESPONSE' && d.requestId) {
18698
+ var pending = __lmsPendingRequests[d.requestId];
18699
+ if (pending) {
18700
+ delete __lmsPendingRequests[d.requestId];
18701
+ clearTimeout(pending.timer);
18702
+ pending.resolve(d.progress || null);
18703
+ }
18704
+ }
18705
+ });
18706
+
18684
18707
  window.LMS = {
18685
18708
  submit(data) {
18686
18709
  window.parent.postMessage({
@@ -18720,6 +18743,43 @@ var BRIDGE_SDK_CODE = `(function() {
18720
18743
  event: event,
18721
18744
  payload: data
18722
18745
  }, "*");
18746
+ },
18747
+ on(event, callback) {
18748
+ (__lmsHandlers[event] = __lmsHandlers[event] || []).push(callback);
18749
+ return function() {
18750
+ var arr = __lmsHandlers[event] || [];
18751
+ var idx = arr.indexOf(callback);
18752
+ if (idx >= 0) arr.splice(idx, 1);
18753
+ };
18754
+ },
18755
+ off(event, callback) {
18756
+ var arr = __lmsHandlers[event] || [];
18757
+ var idx = arr.indexOf(callback);
18758
+ if (idx >= 0) arr.splice(idx, 1);
18759
+ },
18760
+ setConfig(config) {
18761
+ window.parent.postMessage({
18762
+ type: "LMS_CONFIG",
18763
+ uuid: window.__LMS_COURSEWARE__?.uuid,
18764
+ attempt_id: window.__LMS_STUDENT__?.attempt_id,
18765
+ config: config
18766
+ }, "*");
18767
+ },
18768
+ getProgress() {
18769
+ return new Promise(function(resolve) {
18770
+ var requestId = 'prog_' + Math.random().toString(36).slice(2) + '_' + Date.now();
18771
+ var timer = setTimeout(function() {
18772
+ delete __lmsPendingRequests[requestId];
18773
+ resolve(null);
18774
+ }, 5000);
18775
+ __lmsPendingRequests[requestId] = { resolve: resolve, timer: timer };
18776
+ window.parent.postMessage({
18777
+ type: "LMS_GET_PROGRESS",
18778
+ uuid: window.__LMS_COURSEWARE__?.uuid,
18779
+ attempt_id: window.__LMS_STUDENT__?.attempt_id,
18780
+ requestId: requestId
18781
+ }, "*");
18782
+ });
18723
18783
  }
18724
18784
  };
18725
18785
 
@@ -19162,6 +19222,8 @@ window.__LMS_COURSEWARE__ = {
19162
19222
  html = html.replace(/<script[^>]*src='[^']*frog-sdk\.js'[^>]*><\/script>/gi, "<!-- Removed frog-sdk.js to prevent sandboxed iframe crash -->");
19163
19223
  html = html.replace(/<script[^>]*src="[^"]*init-frog\.js"[^>]*><\/script>/gi, "<!-- Removed init-frog.js to prevent sandboxed iframe crash -->");
19164
19224
  html = html.replace(/<script[^>]*src='[^']*init-frog\.js'[^>]*><\/script>/gi, "<!-- Removed init-frog.js to prevent sandboxed iframe crash -->");
19225
+ html = html.replace(/<base\b[^>]*>/gi, "<!-- Removed base tag -->");
19226
+ html = html.replace(/<meta[^>]*http-equiv\s*=\s*["']?refresh["']?[^>]*>/gi, "<!-- Removed meta refresh -->");
19165
19227
  if (html.toLowerCase().includes("<head>")) {
19166
19228
  html = html.replace(/<head>/i, `<head>${injection}`);
19167
19229
  } else if (html.toLowerCase().includes("<html>")) {
@@ -19979,6 +20041,14 @@ function registerCoursewareRoutes(ctx) {
19979
20041
  }
19980
20042
  }
19981
20043
  io.emit("courseware-attempt-updated", { attemptId, type: "log" });
20044
+ void kernelContainer.eventBus.publish({
20045
+ id: "evt_" + import_crypto9.default.randomBytes(8).toString("hex"),
20046
+ type: "courseware.event_logged",
20047
+ source: "builtin.courseware",
20048
+ payload: { attemptId, eventType, payload },
20049
+ timestamp: Date.now(),
20050
+ correlationId: attemptId
20051
+ });
19982
20052
  res.json({ success: true });
19983
20053
  } catch (e) {
19984
20054
  res.status(500).json({ error: e.message });
@@ -20069,6 +20139,27 @@ function registerCoursewareRoutes(ctx) {
20069
20139
  res.status(500).json({ error: e.message });
20070
20140
  }
20071
20141
  });
20142
+ app.get("/api/courseware/attempts/:attemptId/progress", (req, res) => {
20143
+ try {
20144
+ const { attemptId } = req.params;
20145
+ const result = kernelContainer.db.prepare(
20146
+ "SELECT score, comment, completion, extra_json FROM submission_result WHERE attempt_id = ?"
20147
+ ).get(attemptId);
20148
+ if (!result) {
20149
+ return res.json({ progress: null });
20150
+ }
20151
+ let extra = {};
20152
+ try {
20153
+ extra = JSON.parse(result.extra_json || "{}");
20154
+ } catch {
20155
+ }
20156
+ res.json({
20157
+ progress: { score: result.score, comment: result.comment, completion: result.completion, extra }
20158
+ });
20159
+ } catch (e) {
20160
+ res.status(500).json({ error: e.message });
20161
+ }
20162
+ });
20072
20163
  app.post("/api/courseware/attempts/:attemptId/promote", async (req, res) => {
20073
20164
  try {
20074
20165
  const { attemptId } = req.params;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openlearn-next",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "private": false,
5
5
  "description": "A plugin-driven Educational OS / LMS platform with AI agent teaching assistant",
6
6
  "keywords": [
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-react-0Lg0vA-4.js";import{m as g}from"./index-D8x6bUeG.js";import"./vendor-icons-_c3xpwjZ.js";import"./vendor-utils-4FcTwKPj.js";import"./vendor-pdf-CVyNPGVr.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-charts-B7ViBL9w.js";function z({batchPicker:l,setBatchPicker:o,batchPickerLesson:t,setBatchPickerLesson:a,batchPickerDate:i,setBatchPickerDate:n,batchPickerTargetClass:d,setBatchPickerTargetClass:c,lessons:x,classes:u,expandedClassId:m,confirmBatchPicker:h,lang:r}){return l?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(g.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"bg-white border text-gray-900 border-gray-200 rounded-2xl shadow-2xl w-full max-w-md flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center justify-between bg-gray-50/80",children:[e.jsx("h2",{className:"font-bold text-gray-800 text-base",children:l==="schedule"?r==="zh"?"批量排课":"Batch Schedule":l==="lockedLesson"?r==="zh"?"批量设置锁定课程":"Batch Lock Lesson":r==="zh"?"批量转班":"Batch Transfer"}),e.jsx("button",{onClick:()=>o(null),className:"text-gray-400 hover:text-gray-600 text-lg font-bold p-1 hover:bg-gray-200 rounded",children:"×"})]}),e.jsxs("div",{className:"p-5 space-y-4",children:[(l==="schedule"||l==="lockedLesson")&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-gray-600",children:r==="zh"?"选择课程":"Select Lesson"}),e.jsxs("select",{value:t,onChange:s=>a(s.target.value),className:"w-full border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500",children:[e.jsx("option",{value:"",children:r==="zh"?"— 请选择 —":"— Select —"}),x.map(s=>e.jsx("option",{value:s.id,children:s.title},s.id))]})]}),l==="schedule"&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-gray-600",children:r==="zh"?"上课日期":"Schedule Date"}),e.jsx("input",{type:"date",value:i,onChange:s=>n(s.target.value),className:"w-full border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"})]}),l==="transfer"&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-gray-600",children:r==="zh"?"选择目标班级":"Select Target Class"}),e.jsxs("select",{value:d,onChange:s=>c(s.target.value),className:"w-full border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500",children:[e.jsx("option",{value:"",children:r==="zh"?"— 请选择 —":"— Select —"}),u.filter(s=>s.id!==m).map(s=>e.jsx("option",{value:s.id,children:s.name},s.id))]})]})]}),e.jsxs("div",{className:"p-4 border-t border-gray-100 flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>o(null),className:"px-4 py-2 text-sm rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-100 cursor-pointer",children:r==="zh"?"取消":"Cancel"}),e.jsx("button",{onClick:h,className:"px-4 py-2 text-sm rounded-lg bg-indigo-600 text-white hover:bg-indigo-700 cursor-pointer",children:r==="zh"?"确认":"Confirm"})]})]})}):null}export{z as BatchPickerModal};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-react-0Lg0vA-4.js";import{L as o}from"./LazyCourseware-g7b8EXR_.js";import{a9 as a,_ as x,X as c,a6 as d}from"./vendor-icons-_c3xpwjZ.js";import{M as m}from"./index-D8x6bUeG.js";import"./vendor-pdf-CVyNPGVr.js";import"./vendor-utils-4FcTwKPj.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-charts-B7ViBL9w.js";function g({vfsNodes:r,currentVfsParent:n,setCurrentVfsParent:t,cloudDrivePreviewNode:l,setCloudDrivePreviewNode:i}){return e.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0",children:[e.jsxs("div",{className:"w-64 border-r border-gray-100 flex flex-col bg-gray-50 shrink-0",children:[e.jsx("div",{className:"p-3 border-b border-gray-200 flex items-center gap-2",children:e.jsxs("button",{onClick:()=>{t(null),i(null)},className:`text-sm font-medium w-full text-left flex items-center gap-2 p-2 rounded cursor-pointer ${n===null?"bg-indigo-100 text-indigo-800 font-bold":"text-gray-600 hover:bg-gray-200"}`,children:[e.jsx(a,{size:16})," Data Root"]})}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-2",children:[n&&e.jsxs("button",{onClick:()=>t(null),className:"flex items-center gap-2 p-2 text-xs text-indigo-600 w-full hover:bg-gray-200 rounded mb-2 font-medium cursor-pointer",children:[e.jsx(x,{className:"rotate-180",size:14})," Back to Root"]}),e.jsx("div",{className:"text-xs uppercase font-semibold text-gray-400 px-2 py-1 mb-1",children:"Current Path Nodes"}),r.filter(s=>s.type==="dir").map(s=>e.jsxs("button",{onClick:()=>{t(s.id),i(null)},className:"w-full text-left p-2 rounded text-sm text-gray-700 hover:bg-gray-200 flex items-center gap-2 group mb-1 cursor-pointer",children:[e.jsx(a,{size:14,className:"text-indigo-400 group-hover:text-indigo-600"}),e.jsx("span",{className:"truncate",children:s.name})]},s.id))]})]}),e.jsx("div",{className:"flex-1 flex flex-col bg-white overflow-hidden min-w-0",children:l?e.jsxs("div",{className:"flex-1 flex flex-col h-full min-h-0",children:[e.jsxs("div",{className:"p-3 border-b border-gray-100 bg-gray-50 flex items-center gap-2 shrink-0",children:[e.jsx("button",{onClick:()=>i(null),className:"text-gray-500 hover:text-gray-700 cursor-pointer",children:e.jsx(c,{size:16})}),e.jsxs("span",{className:"text-sm font-medium text-gray-700",children:["Previewing: ",l.name]})]}),l.name.endsWith(".html")||l.name.endsWith(".htm")||l.content?.includes("<html")?e.jsx("div",{className:"flex-1 relative bg-gray-50",children:e.jsx(o,{coursewareId:l.id})}):e.jsx("div",{className:"flex-1 overflow-y-auto p-6 bg-white prose prose-sm max-w-none",children:e.jsx(m,{children:l.content})})]}):e.jsx("div",{className:"flex-1 p-6 overflow-y-auto",children:e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[r.length===0&&e.jsx("div",{className:"col-span-full h-32 flex items-center justify-center text-sm text-gray-400 italic",children:"This directory is empty."}),r.map(s=>e.jsxs("div",{onClick:()=>{s.type==="dir"?t(s.id):i({id:s.id,name:s.name,content:s.content||"*(Empty file)*"})},className:"border border-gray-200 hover:border-indigo-300 hover:shadow-md cursor-pointer rounded-xl p-4 flex flex-col gap-3 transition-all bg-white",children:[e.jsx("div",{className:"p-3 rounded-xl w-12 h-12 flex items-center justify-center shrink-0 shadow-sm bg-gray-50 border border-gray-100",children:s.type==="dir"?e.jsx(a,{size:24,className:"text-indigo-500"}):e.jsx(d,{size:24,className:"text-gray-500"})}),e.jsx("div",{className:"text-sm font-medium text-gray-800 break-words",children:s.name})]},s.id))]})})})]})}function v(r){return r.isOpen?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("div",{className:"bg-white border text-gray-900 border-gray-200 rounded-2xl shadow-2xl w-full max-w-5xl h-[85vh] flex flex-col overflow-hidden",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(a,{size:20,className:"text-indigo-600"}),e.jsx("h2",{className:"font-semibold text-gray-800 text-lg",children:"Cloud Course Resource Browser"})]}),e.jsx("button",{onClick:r.onClose,className:"text-gray-400 hover:text-gray-600 font-bold p-1 hover:bg-gray-200 rounded transition-colors cursor-pointer",children:"×"})]}),e.jsx(g,{...r})]})}):null}export{v as CloudDriveModal,g as CloudDrivePanel};
@@ -1 +0,0 @@
1
- import{r as o,j as e}from"./vendor-react-0Lg0vA-4.js";import{p as h,a4 as P,a7 as v,ad as w,X as R,U as C,aB as V,aC as W,aa as Z,al as O,l as z}from"./vendor-icons-_c3xpwjZ.js";import{M as X}from"./index-D8x6bUeG.js";import"./vendor-utils-4FcTwKPj.js";import"./vendor-pdf-CVyNPGVr.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-charts-B7ViBL9w.js";function Q({lang:t,lessons:l,lessonsSearchQuery:d,setLessonsSearchQuery:c,lessonsSortOrder:k,setLessonsSortOrder:S,filteredLessons:x,onOpenImportLessons:D,onOpenCourseWizard:g,onViewCourse:u,onDeleteCourse:A,onCopyCourse:E,filterEnrollment:b,setFilterEnrollment:M,filterHasContent:p,setFilterHasContent:T,filterThisMonth:f,setFilterThisMonth:L,copyingLessonId:$}){const[r,m]=o.useState(null),[a,i]=o.useState(null),[y,j]=o.useState(!1),[F,N]=o.useState(!1),B=async s=>{m(s),i(null),N(!0);try{const n=await fetch(`/api/lessons/${s.id}/stats`);if(n.ok){const I=await n.json();i(I)}}catch{i({whiteboardCount:0,scheduleCount:0,enrollmentCount:0,assignmentCount:0})}finally{N(!1)}},U=async()=>{if(r){j(!0);try{await A(r.id),m(null),i(null)}finally{j(!1)}}};return e.jsxs("div",{className:"flex-1 flex flex-col gap-6 h-full overflow-y-auto",children:[e.jsxs("div",{className:"flex-1 bg-white border border-gray-200 rounded-xl shadow-sm flex flex-col min-h-0",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center justify-between shrink-0",children:[e.jsxs("h3",{className:"font-medium text-gray-700 flex items-center gap-2",children:[e.jsx(h,{size:16,className:"text-gray-400"}),t==="zh"?"课程与教学环节管理 (SQLite)":"Courses & Lessons Management"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{id:"import-lessons-csv-btn",onClick:D,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs bg-indigo-50 hover:bg-indigo-100 text-indigo-700 border border-indigo-200 font-semibold rounded-lg shadow-3xs transition-all hover:shadow-xs hover:-translate-y-0.5 cursor-pointer",children:[e.jsx(P,{size:14}),t==="zh"?"批量导入课程 (CSV)":"Import Lessons (CSV)"]}),e.jsxs("button",{id:"add-course-wizard-btn",onClick:g,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs bg-indigo-600 hover:bg-indigo-700 text-white font-semibold rounded-lg shadow-sm transition-all hover:shadow-md hover:-translate-y-0.5 cursor-pointer",children:[e.jsx(v,{size:14}),t==="zh"?"手动添加课程 (向导)":"Add Course Wizard"]})]})]}),l.length>0&&e.jsxs("div",{className:"px-5 py-3.5 border-b border-gray-100 bg-gray-50/50 flex flex-col sm:flex-row items-center justify-between gap-3 shrink-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 w-full sm:w-auto",children:[e.jsxs("div",{className:"relative w-full sm:w-64",children:[e.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-gray-400",children:e.jsx(w,{size:14})}),e.jsx("input",{type:"text",placeholder:"Search courses by title...",value:d,onChange:s=>c(s.target.value),className:"w-full pl-9 pr-8 py-1.5 text-xs bg-white border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 text-gray-800 shadow-sm"}),d&&e.jsx("button",{onClick:()=>c(""),className:"absolute inset-y-0 right-0 flex items-center pr-2.5 text-gray-400 hover:text-gray-600",children:e.jsx(R,{size:12,className:"bg-gray-100 hover:bg-gray-200 rounded-full p-0.5"})})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-wider",children:t==="zh"?"排序方式:":"Sort by:"}),e.jsxs("select",{value:k,onChange:s=>S(s.target.value),className:"bg-white border border-gray-200 text-xs text-gray-755 font-bold px-2.5 py-1.5 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 shadow-sm",id:"courses-sort-select",children:[e.jsx("option",{value:"recent",children:t==="zh"?"最新创建":"Most Recent"}),e.jsx("option",{value:"alphabetical",children:t==="zh"?"按名称 (A-Z)":"Alphabetical (A-Z)"}),e.jsx("option",{value:"enrollment",children:t==="zh"?"学生选课人次":"Student Enrollment Count"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("button",{onClick:()=>M(!b),className:`px-2 py-1 text-[10px] font-bold rounded-md border transition-all cursor-pointer ${b?"bg-emerald-50 text-emerald-700 border-emerald-200":"bg-white text-gray-500 border-gray-200 hover:border-gray-300"}`,children:[e.jsx(C,{size:11,className:"inline mr-0.5 -mt-0.5"}),t==="zh"?"有人选":"Enrolled"]}),e.jsxs("button",{onClick:()=>T(!p),className:`px-2 py-1 text-[10px] font-bold rounded-md border transition-all cursor-pointer ${p?"bg-indigo-50 text-indigo-700 border-indigo-200":"bg-white text-gray-500 border-gray-200 hover:border-gray-300"}`,children:[e.jsx(h,{size:11,className:"inline mr-0.5 -mt-0.5"}),t==="zh"?"有内容":"Has Content"]}),e.jsx("button",{onClick:()=>L(!f),className:`px-2 py-1 text-[10px] font-bold rounded-md border transition-all cursor-pointer ${f?"bg-amber-50 text-amber-700 border-amber-200":"bg-white text-gray-500 border-gray-200 hover:border-gray-300"}`,children:t==="zh"?"本月":"This Month"})]}),e.jsxs("div",{className:"text-xs font-semibold text-gray-500",children:["Found ",e.jsx("span",{className:"text-indigo-650 font-bold",children:x.length})," of ",e.jsx("span",{className:"text-gray-700 font-bold",children:l.length})," course",l.length===1?"":"s"]})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:l.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-400 min-h-[300px]",children:[e.jsx(h,{size:48,className:"mb-4 opacity-30 text-indigo-500"}),e.jsx("h3",{className:"text-lg font-bold text-gray-800",children:t==="zh"?"暂无可用课程":"No Courses Available"}),e.jsx("p",{className:"mt-2 text-sm text-gray-500 text-center max-w-xs",children:t==="zh"?"系统中暂未部署任何课程。请通过下方按钮启动添加向导指南。":"There are no courses active in the system yet. Build your first curriculum!"}),e.jsxs("button",{id:"empty-add-course-btn",onClick:g,className:"mt-5 flex items-center gap-2 px-5 py-2.5 bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-xl shadow-md transition-all cursor-pointer",children:[e.jsx(v,{size:16}),t==="zh"?"使用向导指南来创建新课程":"Create Course via Wizard"]})]}):x.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12 text-gray-450 text-center",children:[e.jsx(w,{size:44,className:"mb-3 opacity-30 text-gray-450"}),e.jsxs("h4",{className:"font-semibold text-gray-700 text-sm",children:['No Courses Match "',d,'"']}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 max-w-xs",children:"Double-check the spelling or try searching for another curriculum keyword."}),e.jsx("button",{onClick:()=>c(""),className:"mt-3 text-xs bg-indigo-50 hover:bg-indigo-100 text-indigo-700 border border-indigo-200 font-semibold px-3 py-1.5 rounded-lg transition-colors",children:"Clear Search Filter"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:x.map(s=>{const n=$===s.id;return e.jsxs("div",{className:`border border-gray-200 hover:border-indigo-300 rounded-xl p-4 flex flex-col bg-gray-50/50 hover:shadow-md transition-all ${n?"opacity-60 pointer-events-none":""}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 gap-2",children:[e.jsx("div",{className:"font-semibold text-gray-800 text-lg truncate cursor-pointer hover:text-indigo-600 transition-colors",title:s.title,onClick:()=>u(s.id),children:s.title}),e.jsxs("span",{className:"inline-flex items-center gap-1 bg-indigo-50 text-indigo-700 px-1.5 py-0.5 border border-indigo-100 rounded text-[10px] font-bold shrink-0",children:[e.jsx(C,{size:10,className:"text-indigo-500"}),s.enrollment_count||0]})]}),e.jsx("div",{className:"text-sm text-gray-500 line-clamp-3 mb-4 flex-1",children:e.jsx(X,{children:s.content})}),e.jsxs("div",{className:"flex justify-between items-center mt-auto",children:[e.jsxs("div",{className:"text-xs text-gray-400",children:["ID: ",s.id.substring(0,8),"..."]}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx("button",{onClick:()=>u(s.id),className:"p-1.5 text-gray-400 hover:text-indigo-600 hover:bg-indigo-50 rounded transition-colors cursor-pointer",title:t==="zh"?"查看编辑":"View & Edit",children:e.jsx(V,{size:15})}),e.jsx("button",{onClick:()=>E(s.id),className:"p-1.5 text-gray-400 hover:text-emerald-600 hover:bg-emerald-50 rounded transition-colors cursor-pointer",title:t==="zh"?"复制课程":"Copy Course",children:e.jsx(W,{size:14})}),e.jsx("button",{onClick:()=>B(s),className:"p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded transition-colors cursor-pointer",title:t==="zh"?"删除课程":"Delete Course",children:e.jsx(Z,{size:14})})]})]})]},s.id)})})})]}),r&&e.jsx("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-[2px] flex items-center justify-center z-[9999] p-4",children:e.jsxs("div",{className:"bg-white rounded-xl shadow-2xl max-w-md w-full border border-gray-100 overflow-hidden",children:[e.jsxs("div",{className:"px-5 py-4 border-b border-gray-100 bg-red-50 flex items-center gap-2",children:[e.jsx(O,{size:18,className:"text-red-600"}),e.jsx("h3",{className:"font-bold text-red-800 text-sm",children:t==="zh"?"确认删除课程":"Confirm Course Deletion"})]}),e.jsxs("div",{className:"p-5 space-y-3",children:[e.jsx("p",{className:"text-sm text-gray-700",children:t==="zh"?e.jsxs(e.Fragment,{children:["确定要删除课程 ",e.jsx("span",{className:"font-bold text-red-600",children:r.title})," 吗?"]}):e.jsxs(e.Fragment,{children:["Are you sure you want to delete ",e.jsx("span",{className:"font-bold text-red-600",children:r.title}),"?"]})}),e.jsx("p",{className:"text-xs text-red-600 font-medium",children:t==="zh"?"此操作不可撤销,将删除课程的所有关联数据。":"This action is irreversible and will delete all associated data."}),F?e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500 py-2",children:[e.jsx(z,{size:14,className:"animate-spin"}),t==="zh"?"正在统计关联数据...":"Counting related data..."]}):a?e.jsxs("div",{className:"bg-gray-50 rounded-lg p-3 space-y-1.5 text-xs",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:t==="zh"?"白板元素":"Whiteboard Elements"}),e.jsx("span",{className:"font-bold text-gray-800",children:a.whiteboardCount})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:t==="zh"?"排课记录":"Schedules"}),e.jsx("span",{className:"font-bold text-gray-800",children:a.scheduleCount})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:t==="zh"?"选课学生":"Enrollments"}),e.jsx("span",{className:"font-bold text-gray-800",children:a.enrollmentCount})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:t==="zh"?"作业任务":"Assignments"}),e.jsx("span",{className:"font-bold text-gray-800",children:a.assignmentCount})]})]}):null]}),e.jsxs("div",{className:"px-5 py-3 border-t border-gray-100 bg-gray-50 flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>{m(null),i(null)},className:"px-4 py-2 text-xs font-medium text-gray-600 hover:bg-gray-100 border border-gray-200 rounded-lg transition-colors cursor-pointer",children:t==="zh"?"取消":"Cancel"}),e.jsxs("button",{onClick:U,disabled:y,className:"px-4 py-2 text-xs font-bold text-white bg-red-600 hover:bg-red-700 rounded-lg transition-colors cursor-pointer disabled:opacity-50 flex items-center gap-1.5",children:[y&&e.jsx(z,{size:12,className:"animate-spin"}),t==="zh"?"确认删除":"Confirm Delete"]})]})]})})]})}export{Q as CourseManagement};
@@ -1,3 +0,0 @@
1
- import{j as e,r as f}from"./vendor-react-0Lg0vA-4.js";import{m as A,M as P}from"./index-D8x6bUeG.js";import{p as y,f as j,i as W,a7 as L,g as I,D as v,_ as E,l as M}from"./vendor-icons-_c3xpwjZ.js";import"./vendor-utils-4FcTwKPj.js";import"./vendor-pdf-CVyNPGVr.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-charts-B7ViBL9w.js";function q(z){const{isCourseWizardOpen:w,setIsCourseWizardOpen:N,lang:t,wizardStep:o,setWizardStep:g,wizardIsSubmitting:x,wizardCourseTitle:p,setWizardCourseTitle:C,wizardCourseDescription:u,setWizardCourseDescription:k,wizardCourseCategory:n,setWizardCourseCategory:S,wizardCourseTimeline:i,setWizardCourseTimeline:c,wizardCourseContent:m,setWizardCourseContent:h,addToast:b,generateTemplateContent:T,handleDeployWizardCourse:D}=z;return e.jsx(e.Fragment,{children:w&&e.jsx("div",{className:"fixed inset-0 bg-gray-900/50 backdrop-blur-sm flex items-center justify-center p-4 md:p-6 z-50 overflow-y-auto text-gray-850",children:e.jsxs(A.div,{initial:{opacity:0,y:15,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.98},className:"bg-white border text-gray-900 border-gray-250 rounded-2xl shadow-2xl w-full max-w-4xl flex flex-col overflow-hidden max-h-[92vh] font-sans text-left",children:[e.jsxs("div",{className:"p-4 md:p-5 border-b border-gray-100 flex items-center justify-between bg-slate-50 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-indigo-50 border border-indigo-100 rounded-lg text-indigo-650",children:e.jsx(y,{size:20,className:"animate-pulse"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold text-gray-850 text-base md:text-lg",children:t==="zh"?"⭐ 互动课程发布与时间轴向导":"⭐ Course Design Guide & Wizard"}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:t==="zh"?"遵循系统设计法,逐步构建您的学科专属教案与课堂时间轴流程。":"Follow best practices to define curriculum content, timeline segments, and deploy."})]})]}),e.jsx("button",{onClick:()=>N(!1),className:"text-gray-400 hover:text-gray-650 font-bold p-1 rounded-lg hover:bg-gray-150 transition-all text-xl leading-none",children:"×"})]}),e.jsx("div",{className:"px-6 py-4.5 border-b border-gray-50 bg-slate-50/50 flex items-center justify-between gap-2 shrink-0 select-none",children:[{step:1,zh:"1内容选题",en:"1 Background"},{step:2,zh:"2课堂脉络",en:"2 Timeslots"},{step:3,zh:"3编写大纲",en:"3 Syllabus"},{step:4,zh:"4总览部署",en:"4 Deploy"}].map((r,a)=>{const l=o===r.step,s=o>r.step;return e.jsxs(f.Fragment,{children:[e.jsxs("div",{onClick:()=>!x&&g(r.step),className:`flex items-center gap-2 cursor-pointer transition-all ${l?"text-indigo-650 font-boldScale":s?"text-emerald-600 font-medium":"text-gray-400 hover:text-gray-600"}`,children:[e.jsx("div",{className:`w-5 h-5 rounded-full flex items-center justify-center text-[10px] border ${l?"bg-indigo-600 border-indigo-600 text-white shadow-xs font-bold":s?"bg-emerald-50 border-emerald-500 text-emerald-600 font-bold":"bg-white border-gray-250 text-gray-500"}`,children:s?"✓":r.step}),e.jsx("span",{className:"text-xs font-semibold hidden sm:inline",children:t==="zh"?r.zh:r.en})]}),a<3&&e.jsx("div",{className:`flex-1 h-0.5 max-w-[40px] md:max-w-none transition-all ${o>r.step?"bg-emerald-500":"bg-gray-200"}`})]},r.step)})}),e.jsxs("div",{className:"flex-grow overflow-y-auto p-5 md:p-6 space-y-5",children:[o===1&&e.jsxs("div",{className:"space-y-4 animate-in fade-in duration-200 text-left",children:[e.jsxs("div",{className:"bg-indigo-50/70 py-3.5 px-4.5 rounded-xl border border-indigo-100 text-xs text-indigo-750 font-sans leading-relaxed flex items-start gap-2",children:[e.jsx(j,{size:16,className:"text-indigo-500 shrink-0 mt-0.5 animate-bounce"}),e.jsxs("div",{children:[e.jsx("strong",{children:t==="zh"?"设计理念:":"Instructional ConceptTip:"}),e.jsx("p",{className:"mt-0.5",children:t==="zh"?"一个高品质的课程往往始于明确的选题背景。选择适当的学科科目分类,系统不仅会按您的选择在后续步骤推荐量身定做的教案摸板,还可以一键预装适合该学科的课堂互动时间轴模板。":"Selecting a clear title and specific subject category helps pre-populate customized Markdown content outlines and specialized scheduling presets."})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 font-sans",children:[e.jsxs("div",{className:"md:col-span-2 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:t==="zh"?"📍 课程/课件名称 *":"📍 Course Title *"}),e.jsx("input",{type:"text",required:!0,value:p,onChange:r=>C(r.target.value),placeholder:t==="zh"?"例:西方哲学:康德的三大批判、Python编程入门、高中物理电路并联原理":"e.g. Introduction to regressions, Western Philosophies, Lever Principles",className:"w-full px-4 py-3 border border-gray-250 rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500 text-gray-800 text-sm shadow-xs"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:t==="zh"?"🎯 课程设计简介与要点说明 (Objectives)":"🎯 Description & Lesson Objectives"}),e.jsx("textarea",{rows:4,value:u,onChange:r=>k(r.target.value),placeholder:t==="zh"?"在此处编写您的授课背景、面向学段及最关键的 2-3 个核心教学总目标。":"Write a short description stating learning outcomes and student prerequisite goals.",className:"w-full p-4 border border-gray-255 rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500 text-gray-800 text-sm shadow-xs resize-none"})]})]}),e.jsxs("div",{className:"col-span-1 border-l border-gray-100 md:pl-6 space-y-4 text-left",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:t==="zh"?"🎨 学部科目分类":"🎨 Subject Category"}),e.jsxs("select",{value:n,onChange:r=>{S(r.target.value)},className:"w-full bg-white border border-gray-250 text-gray-755 font-bold px-3 py-2.5 rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500 shadow-xs text-sm cursor-pointer",children:[e.jsx("option",{value:"Mathematics",children:t==="zh"?"📐 基础数学与几何":"📐 Mathematics"}),e.jsx("option",{value:"ComputerScience",children:t==="zh"?"💻 计算机软件与人工智能":"💻 Computer Science"}),e.jsx("option",{value:"Literature",children:t==="zh"?"✍️ 语言文字与阅读理解":"✍️ Literature & Writing"}),e.jsx("option",{value:"Physics",children:t==="zh"?"⚡ 物理实验与自然探索":"⚡ Physics & Science"}),e.jsx("option",{value:"History",children:t==="zh"?"🏛️ 历史脉络与人地分析":"🏛️ History & Humanities"}),e.jsx("option",{value:"Art",children:t==="zh"?"🎨 交互设计与先锋创意艺术":"🎨 Visual Arts & Design"}),e.jsx("option",{value:"Other",children:t==="zh"?"🔮 交叉素养与综合学习":"🔮 General & Other"})]})]}),e.jsxs("div",{className:"bg-slate-50 p-4 rounded-xl border border-gray-100 space-y-2 select-none text-left",children:[e.jsx("span",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-wider block",children:t==="zh"?"科目时间轴专家建议":"SUBJECT HEURISTICS"}),e.jsxs("div",{className:"text-xs text-gray-600 leading-relaxed font-sans mt-1",children:[n==="Mathematics"&&(t==="zh"?"💡 数学:偏向理论推演。推荐 20分公式精讲 + 15分黑板实践互动,强化基础。":"💡 Math recommends: 20m Core Lecture + 15m Practice for theorem grounding."),n==="ComputerScience"&&(t==="zh"?"💡 计算机:偏重编码体验。推荐 15分白板代码推演 + 20分终端实验与分享。":"💡 CS recommends: 15m Algorithms + 20m Interactive workshops on virtual boards."),n==="Literature"&&(t==="zh"?"💡 语文文学:注重文本深度。推荐 10分范文研习 + 20分分组思辨,提升理解。":"💡 Lit recommends: 10m Reading Analysis + 20m Collaborative Discussions."),n==="Physics"&&(t==="zh"?"💡 科学类:逻辑导向。推荐 10分虚拟视频实验 + 20分机理讲解 + 10分钟随堂答卷。":"💡 Science recommends: 10m virtual showcase + 20m principles + 10m evaluation."),n==="History"&&(t==="zh"?"💡 历史人文:情景引入。推荐 15分人文画卷重塑 + 15分史实论驳辩论。":"💡 History recommends: 15m Context Mapping + 15m Interactive Debate panels."),n==="Art"&&(t==="zh"?"💡 视觉创意:自由度高。推荐 10分美术鉴赏 + 25分白板手绘画布互动体验。":"💡 Art recommends: 10m Aesthetics inspiration + 25m real-time board drawing."),n==="Other"&&(t==="zh"?"💡 其他科目:均分各小节时间,循序渐进,打造完整的教学循环闭环。":"💡 Generic: Divide evenly into sequential warm-up, core presentation and quiz.")]})]})]})]})]}),o===2&&e.jsxs("div",{className:"space-y-5 animate-in fade-in duration-200 text-left font-sans",children:[e.jsxs("div",{className:"bg-emerald-50/40 py-3.5 px-4.5 rounded-xl border border-emerald-100 text-xs text-emerald-850 leading-relaxed flex items-start gap-2 text-left",children:[e.jsx(W,{size:16,className:"text-emerald-555 shrink-0 mt-0.5 animate-pulse"}),e.jsxs("div",{children:[e.jsx("strong",{children:t==="zh"?"专家课堂时间轴预设:":"Dynamic Class Presets:"}),e.jsx("p",{className:"mt-0.5",children:t==="zh"?"好的教授节奏必须动静相宜。以下提供三种国际领先的精品课件时间节点设计,点击即可一键刷装配置。您也可以在下方自由增删和重新指定每个环节的长短!":"Curating temporal context maximizes classroom retention. Load from predefined templates or tweak the active steps on the dynamic table."})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:t==="zh"?"💡 点击应用典型课堂框架模板 (Quick Apply)":"💡 Click to Auto-Apply Structure Presets"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[{id:"preset_standard",title:t==="zh"?"经典 5-20-15-5 讲授模式":"Traditional Dual-Lecture Paradigm",desc:t==="zh"?"由浅入深:先通过场景导入,后精讲,接着在白板配合大屏进行演练。":"Perfect dynamic for most standard classes.",segments:[{id:"seg-preset-1",title:"Course Orientation / 课堂导入",type:"intro",duration:"5m",color:"bg-blue-50 text-blue-700 border-blue-200 hover:bg-blue-100",notes:"Warm up topic"},{id:"seg-preset-2",title:"Subject Core Lecture / 核心理论精讲",type:"lecture",duration:"20m",color:"bg-indigo-50 text-indigo-700 border-indigo-200 hover:bg-indigo-100",notes:"Main content slide"},{id:"seg-preset-3",title:"Interactive Lab Work / 随堂协同演练",type:"practice",duration:"15m",color:"bg-green-50 text-green-700 border-green-200 hover:bg-green-100",notes:"Exercises & questions"},{id:"seg-preset-4",title:"Wrap up / 课堂成果总结与答疑",type:"summary",duration:"5m",color:"bg-purple-50 text-purple-700 border-purple-200 hover:bg-purple-100",notes:"Check answer notes"}]},{id:"preset_seminar",title:t==="zh"?"主题讨论工作坊模式":"Active Discussion Workshop",desc:t==="zh"?"协同探究:教师5分钟破冰,学生15分钟小组演练,15分钟对决汇报,10分钟定级。":"Discussion and presentation heavy layout.",segments:[{id:"seg-preset-5",title:"Debate Scenario Brief / 讨论情境简述",type:"intro",duration:"5m",color:"bg-amber-50 text-amber-700 border-amber-200 hover:bg-amber-100",notes:"Define debate metrics"},{id:"seg-preset-6",title:"Cooperative Ideation / 精英白板协作设计",type:"practice",duration:"15m",color:"bg-green-50 text-green-700 border-green-200 hover:bg-green-100",notes:"Joint workspace analysis"},{id:"seg-preset-7",title:"Student Team Presentation / 各小组交互汇报",type:"lecture",duration:"15m",color:"bg-indigo-50 text-indigo-700 border-indigo-200 hover:bg-indigo-100",notes:"Group screen sharing"},{id:"seg-preset-8",title:"Review & Grade Feedback / 教师深度对标点评",type:"summary",duration:"10m",color:"bg-purple-50 text-purple-700 border-purple-200 hover:bg-purple-100",notes:"Score reviews"}]},{id:"preset_flipped",title:t==="zh"?"翻转课堂高强度训练":"Targeted Problem-Solving Sprint",desc:t==="zh"?"应试/解惑突破:10分钟温习,15分钟重难盲点攻坚,15分钟专项题演习。":"Perfect for exams and targeted training courses.",segments:[{id:"seg-preset-9",title:"Blind Spot Evaluation / 温史自学效果自测",type:"intro",duration:"10m",color:"bg-blue-50 text-blue-700 border-blue-200 hover:bg-blue-100",notes:"Scan quiz"},{id:"seg-preset-10",title:"Advanced Principle Explores / 重难考点极限拆解",type:"lecture",duration:"15m",color:"bg-rose-50 text-rose-700 border-rose-200 hover:bg-rose-100",notes:"Analyse weak metrics"},{id:"seg-preset-11",title:"Mock Solving Battle / 核心精选题实操对抗",type:"practice",duration:"15m",color:"bg-emerald-50 text-emerald-700 border-emerald-200 hover:bg-emerald-100",notes:"Sprint workout"},{id:"seg-preset-12",title:"Anchor Recap / 知识网架构网节点固化",type:"summary",duration:"5m",color:"bg-purple-50 text-purple-700 border-purple-200 hover:bg-purple-100",notes:"Highlight checklist"}]}].map(r=>e.jsxs("button",{type:"button",onClick:()=>{c(r.segments),b(t==="zh"?"预设已刷装":"Preset Configured",t==="zh"?`已将《${r.title}》应用到您当前设计的课程中。`:`Assigned "${r.title}" timeslots.`,"success")},className:"bg-white border rounded-xl p-3 text-left transition-all hover:bg-indigo-50/20 hover:border-indigo-400 cursor-pointer active:scale-98",children:[e.jsx("div",{className:"font-bold text-gray-800 text-xs sm:text-sm",children:r.title}),e.jsx("div",{className:"text-[10px] text-gray-400 mt-1.5 leading-relaxed",children:r.desc})]},r.id))})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 select-none",children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider",children:t==="zh"?"📌 流程时间卡编辑 (拖拽或直接对表格字段赋值)":"📌 Custom Timeslot Table (Edit fields directly)"}),e.jsxs("button",{type:"button",onClick:()=>{const r={id:`seg-w-custom-${Date.now()}`,title:t==="zh"?`自理授课阶段 ${i.length+1}`:`Interactive Step ${i.length+1}`,type:"practice",duration:"10m",color:"bg-slate-50 text-slate-700 border-slate-200 hover:bg-slate-100",notes:""};c([...i,r])},className:"flex items-center gap-1 text-[11px] font-bold text-indigo-600 hover:text-indigo-800 cursor-pointer",children:[e.jsx(L,{size:12})," ",t==="zh"?"增设阶段":"Append Phase"]})]}),e.jsx("div",{className:"space-y-2 border border-gray-150 rounded-xl p-3.5 bg-gray-50/50",children:i.map((r,a)=>e.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-3 bg-white border border-gray-200 rounded-lg p-2.5 shadow-xs",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[e.jsx("span",{className:"w-5 h-5 rounded-full bg-slate-100 flex items-center justify-center text-[10px] text-gray-500 font-bold shrink-0",children:a+1}),e.jsx("input",{type:"text",value:r.title,onChange:l=>{const s=[...i];s[a].title=l.target.value,c(s)},className:"font-bold text-xs text-gray-800 bg-transparent border-b border-transparent hover:border-gray-200 focus:border-indigo-500 py-0.5 px-1 focus:outline-none focus:bg-gray-50/50 rounded flex-1 sm:w-56",placeholder:"Phase Title"})]}),e.jsxs("div",{className:"flex items-center gap-2.5 w-full sm:w-auto justify-end sm:ml-auto",children:[e.jsxs("div",{className:"flex items-center gap-1 bg-slate-50 border border-gray-200 rounded px-2 py-0.5 shrink-0",children:[e.jsx("span",{className:"text-[10px] font-bold text-gray-400",children:"时长:"}),e.jsx("input",{type:"text",value:r.duration,onChange:l=>{const s=[...i];s[a].duration=l.target.value,c(s)},className:"w-8 text-[11px] text-gray-800 font-extrabold bg-transparent text-center focus:outline-none"})]}),e.jsxs("select",{value:r.type,onChange:l=>{const s=l.target.value,d=[...i];d[a].type=s,s==="intro"?d[a].color="bg-blue-50 text-blue-700 border-blue-200 hover:bg-blue-100":s==="lecture"?d[a].color="bg-indigo-50 text-indigo-700 border-indigo-200 hover:bg-indigo-100":s==="practice"?d[a].color="bg-green-50 text-green-700 border-green-200 hover:bg-green-100":s==="summary"?d[a].color="bg-purple-50 text-purple-700 border-purple-200 hover:bg-purple-100":d[a].color="bg-gray-50 text-gray-700 border-gray-205 hover:bg-gray-100",c(d)},className:"bg-slate-50 border border-gray-200 text-[10px] font-bold text-gray-600 rounded p-1 focus:outline-none cursor-pointer",children:[e.jsx("option",{value:"intro",children:t==="zh"?"温习 / 导入":"Warm-up / Intro"}),e.jsx("option",{value:"lecture",children:t==="zh"?"主体 / 精讲":"Core Lecture"}),e.jsx("option",{value:"practice",children:t==="zh"?"交互白板练习":"Practice Workshop"}),e.jsx("option",{value:"summary",children:t==="zh"?"总结 / 定级":"Wrap-up / Recap"})]}),e.jsx("button",{type:"button",onClick:()=>{if(i.length<=1){alert(t==="zh"?"请保留至少一个核心环节!":"At least one segment must exist.");return}const l=i.filter((s,d)=>d!==a);c(l)},className:"text-gray-400 hover:text-rose-600 font-bold p-1 cursor-pointer text-sm select-none",title:"Delete this segment",children:"×"})]})]},r.id))}),e.jsxs("div",{className:"mt-2 text-[10px] text-right text-gray-500 font-mono select-none",children:[t==="zh"?"📈 环节累加公式:":"📈 Dynamic aggregation formula: ",e.jsx("span",{className:"text-gray-800 font-semibold",children:i.map(r=>r.duration).join(" + ")})]})]})]}),o===3&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 animate-in fade-in duration-200 font-sans text-left",children:[e.jsxs("div",{className:"space-y-3 flex flex-col h-full min-h-[360px] text-left",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-2",children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider select-none shrink-0",children:t==="zh"?"✏️ 使用 Markdown 语法编写课时材料":"✏️ Lesson Materials (Markdown)"}),e.jsxs("button",{type:"button",onClick:()=>{const r=T(p,n);h(r),b(t==="zh"?"大纲模板生成成功":"Curriculum Loaded",t==="zh"?"针对所选择的模型和属性已一键刷装教案模板框架。":"Prepopulated Markdown structure.","success")},className:"flex items-center gap-1 text-xs bg-indigo-50 border border-indigo-100 text-indigo-755 hover:bg-indigo-100 px-3 py-1 rounded-lg transition-colors font-bold cursor-pointer",children:[e.jsx(j,{size:13,className:"text-indigo-500 animate-spin"}),t==="zh"?"✨ 一键生成专家级教学大纲模版":"✨ Autofill Outline Template"]})]}),e.jsx("textarea",{rows:14,value:m,onChange:r=>h(r.target.value),placeholder:t==="zh"?`# 西方哲学三大经典原理
2
-
3
- 在此输入您的具体内容讲解、白板图形绘制节点、以及课后实践任务大纲...`:"# Course curriculum content",className:"w-full flex-grow p-4 bg-slate-900 text-slate-100 border border-slate-700 rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500 font-mono text-xs shadow-inner leading-relaxed text-left"})]}),e.jsxs("div",{className:"space-y-3 flex flex-col h-full border border-gray-150 rounded-xl bg-slate-50/50 p-4 text-left",children:[e.jsxs("span",{className:"block text-xs font-bold text-gray-400 uppercase tracking-wider select-none shrink-0",children:["🖥️ ",t==="zh"?"大纲资料实时交互渲染":"Syllabus Live Context rendering"]}),e.jsx("div",{className:"flex-grow overflow-y-auto bg-white border border-gray-150 rounded-lg p-4 text-xs font-sans text-gray-700 max-h-[380px] overflow-x-hidden text-left select-text",children:m.trim()?e.jsx("div",{className:"markdown-body",children:e.jsx(P,{children:m})}):e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-400 italic py-16",children:[e.jsx(y,{size:32,className:"mb-2 opacity-20 text-indigo-500"}),e.jsx("span",{children:t==="zh"?"教案空无内容,等待输入或一键填充模板...":"Waiting for materials..."})]})})]})]}),o===4&&e.jsxs("div",{className:"space-y-6 animate-in fade-in duration-200 text-center font-sans max-w-xl mx-auto py-3",children:[e.jsx("div",{className:"inline-flex p-3 bg-emerald-50 border border-emerald-100 text-emerald-500 rounded-full",children:e.jsx(I,{size:36,className:"animate-pulse text-emerald-555"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-extrabold text-gray-800 text-base md:text-lg",children:t==="zh"?"🚀 互动课程已精心筹备成功!":"🚀 Materials Generated successfully!"}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:t==="zh"?"设计与时间轴逻辑全部检验合格。请在下方核验新课卡片,确认无误一键部署入 SQLite 内核数据库。":"Curriculum parameters are ready to boot inside the Secure Host."})]}),e.jsxs("div",{className:"border border-indigo-200 rounded-2xl p-5 bg-linear-to-b from-indigo-50/20 to-white shadow-md text-left space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-indigo-50 pb-3 gap-2",children:[e.jsx("div",{className:"font-bold text-indigo-950 text-base sm:text-lg truncate",children:p||(t==="zh"?"未指定课程主题":"Blank Topic")}),e.jsx("span",{className:"inline-flex px-2 py-0.5 rounded text-[10px] font-extrabold bg-indigo-50 text-indigo-800 uppercase tracking-wide border border-indigo-150 shrink-0",children:n})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-xs",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400 block tracking-wider text-[10px] font-bold",children:t==="zh"?"教研环节数":"TOTAL STEPS"}),e.jsxs("span",{className:"text-gray-800 font-extrabold text-sm block mt-1",children:[i.length," ",t==="zh"?"项教学环节":"slots"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400 block tracking-wider text-[10px] font-bold",children:t==="zh"?"发布载体引擎":"STORAGE MEDIUM"}),e.jsxs("div",{className:"flex items-center gap-1 text-emerald-650 font-extrabold text-sm mt-1",children:[e.jsx(v,{size:11,className:"text-emerald-500"}),e.jsx("span",{children:"SQLite DB"})]})]})]}),e.jsx("div",{className:"bg-slate-50 border border-gray-150 p-3 rounded-lg text-[11px] text-gray-600 line-clamp-2 italic leading-relaxed text-left",children:u||(t==="zh"?"无科目描述内容":"No description written.")}),e.jsxs("div",{className:"space-y-1.5 select-none",children:[e.jsx("span",{className:"text-[10px] font-extrabold text-gray-400 uppercase tracking-wider block",children:t==="zh"?"教学时间轴环流预览":"TIMELINE PROGRESS OVERVIEW"}),e.jsx("div",{className:"flex items-center gap-1 w-full overflow-x-auto py-1",children:i.map((r,a)=>e.jsxs(f.Fragment,{children:[e.jsxs("div",{className:`px-2 py-1 text-[10px] font-bold rounded border truncate max-w-[120px] ${r.color.split(" ")[0]}`,children:[r.title.split(" / ")[0]," (",r.duration,")"]}),a<i.length-1&&e.jsx(E,{size:11,className:"text-gray-300"})]},r.id))})]})]})]})]}),e.jsxs("div",{className:"p-4 border-t border-gray-105 bg-slate-50 flex justify-between items-center shrink-0",children:[e.jsx("span",{className:"text-[11px] font-bold font-mono text-gray-400 uppercase select-none",children:t==="zh"?"⚙️ SQLITE 写入预检通过":"⚙️ SQLITE VERIFICATION SUCCESS"}),e.jsxs("div",{className:"flex items-center gap-2",children:[o>1&&e.jsx("button",{type:"button",onClick:()=>g(r=>r-1),disabled:x,className:"px-4 py-2 text-xs font-semibold border border-gray-200 text-gray-700 bg-white hover:bg-gray-50 rounded-lg transition-colors cursor-pointer select-none",children:t==="zh"?"上一步":"Back"}),o<4?e.jsx("button",{type:"button",onClick:()=>{if(o===1&&!p.trim()){alert(t==="zh"?"请输入课程课题名称!":"Please type course title to proceed.");return}g(r=>r+1)},className:"px-4.5 py-2 text-xs font-bold bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg shadow-sm flex items-center gap-1 cursor-pointer select-none",children:t==="zh"?"继续前进":"Continue"}):e.jsx("button",{type:"button",onClick:D,disabled:x,className:"px-5 py-2 text-xs font-bold bg-emerald-600 hover:bg-emerald-700 text-white rounded-lg shadow-md flex items-center gap-1.5 cursor-pointer disabled:opacity-50 select-none animate-bounce",children:x?e.jsxs(e.Fragment,{children:[e.jsx(M,{size:13,className:"animate-spin"}),e.jsx("span",{children:t==="zh"?"写入底库中...":"Deploying..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(v,{size:13}),e.jsx("span",{children:t==="zh"?"部署并激活新课程":"Deploy & Activate"})]})})]})]})]})})})}export{q as CourseWizardModal};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-react-0Lg0vA-4.js";import{m as z}from"./index-D8x6bUeG.js";import{ab as k,ac as C,R as S,T as $,a5 as q}from"./vendor-icons-_c3xpwjZ.js";import"./vendor-utils-4FcTwKPj.js";import"./vendor-pdf-CVyNPGVr.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-charts-B7ViBL9w.js";function E({isExportWeightModalOpen:p,setIsExportWeightModalOpen:x,lang:s,quizzesWeight:g,setQuizzesWeight:h,assignmentsWeight:m,setAssignmentsWeight:b,handleQuizzesWeightChange:f,handleAssignmentsWeightChange:j,customCategoryOverrides:u,setCustomCategoryOverrides:y,classDashboardMap:i,exportClassId:r,exportClassName:N,csvPreviewData:n,handleExportGrades:v}){return p?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(z.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-2xl flex flex-col overflow-hidden max-h-[85vh]",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(k,{className:"text-indigo-600 font-sans",size:20}),e.jsx("h2",{className:"font-bold text-gray-800 text-lg font-sans",children:s==="zh"?"导出成绩权重设置":"Grade Export & Weighting Settings"})]}),e.jsx("button",{onClick:()=>x(!1),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-6",children:[e.jsx("div",{className:"bg-indigo-50 border border-indigo-150 rounded-xl p-4 text-indigo-800 text-xs font-sans leading-relaxed",children:s==="zh"?"您可以自定义测验与作业在期末成绩(平均分)中的计算权重。系统已根据测验名和内容自动对课程内容进行分类,您可以在下方手动微调分类。":"Customize the calculation weight of quizzes and assignments in the calculated average score. The system automatically classifies items, but you can manually override categorized groups below."}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("h3",{className:"font-bold text-sm text-gray-800 flex items-center gap-2 font-sans",children:[e.jsx(C,{size:16,className:"text-indigo-500 font-sans"}),s==="zh"?"定义成绩占比权重":"Define Weighting Percentages"]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 bg-gray-50 p-4 rounded-xl border border-gray-100 font-sans",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-700",children:s==="zh"?"测验权重 (Quizzes)":"Quizzes Weight"}),e.jsxs("span",{className:"text-xs font-bold text-indigo-600 bg-indigo-50 px-2 py-0.5 rounded border border-indigo-100",children:[g,"%"]})]}),e.jsx("input",{type:"range",min:"0",max:"100",value:g,onChange:t=>f(Number(t.target.value)),className:"w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-indigo-600"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-700",children:s==="zh"?"作业权重 (Assignments)":"Assignments Weight"}),e.jsxs("span",{className:"text-xs font-bold text-indigo-600 bg-indigo-50 px-2 py-0.5 rounded border border-indigo-100",children:[m,"%"]})]}),e.jsx("input",{type:"range",min:"0",max:"100",value:m,onChange:t=>j(Number(t.target.value)),className:"w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-indigo-600"})]})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>{h(50),b(50)},className:"text-[10px] text-gray-500 hover:text-gray-700 bg-white border border-gray-200 hover:bg-gray-50 font-bold px-2.5 py-1 rounded transition-colors cursor-pointer",children:s==="zh"?"均衡配比 50/50":"Balance 50/50"}),e.jsx("button",{type:"button",onClick:()=>{h(40),b(60)},className:"text-[10px] text-gray-500 hover:text-gray-700 bg-white border border-gray-200 hover:bg-gray-50 font-bold px-2.5 py-1 rounded transition-colors cursor-pointer",children:s==="zh"?"推荐配比 40/60":"Recommend 40/60"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h3",{className:"font-bold text-sm text-gray-800 flex items-center justify-between font-sans",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(S,{size:16,className:"text-indigo-500"}),s==="zh"?"期末考核项目微调":"Item Categorization Overrides"]}),e.jsx("span",{className:"text-[10px] text-gray-400 font-medium font-sans",children:s==="zh"?`共 ${i[r]?.assignments?.length||0} 项`:`${i[r]?.assignments?.length||0} items total`})]}),e.jsxs("div",{className:"border border-gray-150 rounded-xl overflow-hidden divide-y divide-gray-100 max-h-60 overflow-y-auto bg-white shadow-inner",children:[(i[r]?.assignments||[]).map(t=>{const d=t.content&&t.content.startsWith('{"quizType":"mcq_learning_objectives"'),l=t.title&&(t.title.toLowerCase().includes("quiz")||t.title.toLowerCase().includes("test")||t.title.includes("测验")||t.title.includes("测试")),o=d||l?"quiz":"assignment",a=u[t.id]||o;return e.jsxs("div",{className:"p-3 flex items-center justify-between gap-4 font-sans hover:bg-gray-50/50 transition-colors",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-semibold text-xs text-gray-800 truncate",title:t.title,children:t.title}),e.jsx("div",{className:"text-[10px] text-gray-400 truncate mt-0.5",children:t.description||(s==="zh"?"无描述信息":"No description provided")})]}),e.jsxs("div",{className:"flex border border-gray-200 rounded-lg p-0.5 bg-gray-50 shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>y(c=>({...c,[t.id]:"quiz"})),className:`px-2.5 py-1 text-[10px] font-bold rounded-md transition-all cursor-pointer ${a==="quiz"?"bg-indigo-600 text-white shadow":"text-gray-500 hover:text-gray-800 hover:bg-gray-100"}`,children:s==="zh"?"测验":"Quiz"}),e.jsx("button",{type:"button",onClick:()=>y(c=>({...c,[t.id]:"assignment"})),className:`px-2.5 py-1 text-[10px] font-bold rounded-md transition-all cursor-pointer ${a==="assignment"?"bg-emerald-600 text-white shadow":"text-gray-500 hover:text-gray-800 hover:bg-gray-100"}`,children:s==="zh"?"作业":"Assignment"})]})]},t.id)}),(!i[r]?.assignments||i[r].assignments.length===0)&&e.jsx("div",{className:"p-8 text-center text-xs text-gray-400 italic",children:s==="zh"?"此班级暂未创建任何考核项目":"No graded items exist in this class."})]})]}),n&&n.rows.length>0&&e.jsxs("div",{className:"space-y-3 pt-2",children:[e.jsxs("h3",{className:"font-bold text-sm text-gray-800 flex items-center justify-between font-sans",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx($,{size:16,className:"text-emerald-500"}),s==="zh"?"CSV 实时成绩表预览 (前5行数据)":"Live CSV Grade Preview (First 5 Rows)"]}),e.jsx("span",{className:"text-[10px] bg-emerald-50 text-emerald-700 border border-emerald-100 font-bold px-2 py-0.5 rounded shadow-xs font-sans",children:s==="zh"?`展示 5 / ${n.totalStudents} 名学生`:`Showing 5 of ${n.totalStudents} students`})]}),e.jsx("div",{className:"border border-gray-150 rounded-xl overflow-hidden bg-white shadow-xs max-w-full",children:e.jsx("div",{className:"overflow-x-auto max-h-56 overflow-y-auto",children:e.jsxs("table",{className:"w-full border-collapse text-left",children:[e.jsx("thead",{children:e.jsx("tr",{className:"bg-gray-50 border-b border-gray-150 sticky top-0 z-10",children:n.headers.map((t,d)=>{const l=t.includes("Average")||t.includes("Avg")||t.includes("Score"),o=t.includes("Weighted");return e.jsx("th",{className:`p-2.5 text-[10px] font-bold tracking-wider uppercase border-r border-gray-150 whitespace-nowrap font-sans font-semibold ${o?"text-indigo-700 bg-indigo-50/70 border-indigo-150 font-bold":l?"text-emerald-700 bg-emerald-50/70":"text-gray-500"}`,children:t},d)})})}),e.jsx("tbody",{className:"divide-y divide-gray-100",children:n.rows.map((t,d)=>e.jsx("tr",{className:"hover:bg-gray-50/50 transition-colors font-mono text-[10px]",children:t.map((l,o)=>{const a=n.headers[o]||"",c=a.includes("Weighted"),w=a.includes("Average")||a.includes("Avg")||a.includes("Score");return e.jsx("td",{className:`p-2 border-r border-gray-100 font-mono text-[10px] text-gray-700 whitespace-nowrap text-center ${c?"bg-indigo-50/30 font-bold text-indigo-700 border-indigo-100":w?"bg-emerald-50/10 font-semibold text-emerald-800":o<2?"text-left font-sans font-medium":""}`,children:l},o)})},d))})]})})}),e.jsx("p",{className:"text-[10px] text-gray-400 font-sans italic",children:s==="zh"?"* 改变上方权重占比或调整项目分类时,此预览与计算结果会立即实时刷新。":"* Calculations and layout values in this preview refresh dynamically as you tweak sliders and overrides."})]})]}),e.jsxs("div",{className:"p-4 border-t border-gray-100 bg-gray-50/85 flex justify-end gap-2.5 shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>x(!1),className:"px-4 py-2 text-xs font-semibold border border-gray-300 text-gray-700 bg-white rounded-lg hover:bg-gray-100 transition-colors cursor-pointer",children:s==="zh"?"取消":"Cancel"}),e.jsxs("button",{type:"button",disabled:!i[r]?.assignments||i[r].assignments.length===0,onClick:()=>{v(r,N,g,m,u),x(!1)},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 flex items-center gap-1.5 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(q,{size:14}),s==="zh"?"导出 CSV 成绩表":"Export Grade Sheet"]})]})]})}):null}export{E as ExportWeightModal};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-react-0Lg0vA-4.js";import{m as v}from"./index-D8x6bUeG.js";import{a4 as g,a5 as N,l as w,g as C,y as z}from"./vendor-icons-_c3xpwjZ.js";import"./vendor-utils-4FcTwKPj.js";import"./vendor-pdf-CVyNPGVr.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-charts-B7ViBL9w.js";function L(h){const{isImportLessonsOpen:p,setIsImportLessonsOpen:i,lang:s,importStatus:r,setIsDraggingImport:d,handleCSVFileChange:x,downloadCsvTemplate:b,isDraggingImport:u,previewImportData:a,setPreviewImportData:m,setImportStatus:c,importProgress:l,importProgressTotal:n,importErrorMsg:f,setImportErrorMsg:y,handleCSVImportSubmit:j}=h;return e.jsx(e.Fragment,{children:p&&e.jsx("div",{className:"fixed inset-0 bg-gray-900/50 backdrop-blur-sm flex items-center justify-center p-4 md:p-6 z-50 overflow-y-auto text-gray-850",children:e.jsxs(v.div,{initial:{opacity:0,y:15,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.98},className:"bg-white border text-gray-900 border-gray-250 rounded-2xl shadow-2xl w-full max-w-2xl flex flex-col overflow-hidden max-h-[90vh] font-sans text-left",children:[e.jsxs("div",{className:"p-4 md:p-5 border-b border-gray-100 flex items-center justify-between bg-slate-50 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-indigo-50 border border-indigo-100 rounded-lg text-indigo-650",children:e.jsx(g,{size:20,className:"animate-pulse"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold text-gray-850 text-base md:text-lg",children:s==="zh"?"批量导入课程 (CSV)":"Bulk-Import Courses (CSV)"}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:s==="zh"?"上传包含标准表头的 CSV 教案,一键实现秒级批量底库写入。":"Upload a standard CSV file matching our predefined schema to perform instantaneous bulk curriculum imports."})]})]}),e.jsx("button",{onClick:()=>{r!=="importing"&&i(!1)},disabled:r==="importing",className:"text-gray-400 hover:text-gray-650 font-bold p-1 rounded-lg hover:bg-gray-150 transition-all text-xl leading-none disabled:opacity-40",children:"×"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r==="idle"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-4 bg-indigo-50/50 border border-indigo-100 rounded-xl",children:[e.jsxs("h4",{className:"text-xs font-bold text-indigo-850 uppercase tracking-wide flex items-center gap-1",children:[e.jsx("span",{children:"📌"}),s==="zh"?"预定义数据格式说明":"Predefined Schema Information"]}),e.jsx("p",{className:"text-xs text-indigo-900 mt-1 leading-relaxed",children:s==="zh"?"CSV 文件的首行必须 define 列标题(分大小写且无多余空格),包含以下两项必需内容:":"Your CSV file must include exactly these header columns on the first row (case-insensitive):"}),e.jsxs("ul",{className:"list-disc pl-5 mt-2 text-xs text-indigo-950 space-y-1",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"title"}),": ",s==="zh"?'课程名 (非空,例如 "代数几何")':'Course title (Required, e.g. "Linear Algebra")']}),e.jsxs("li",{children:[e.jsx("strong",{children:"content"}),": ",s==="zh"?"教学大纲 / Markdown 格式的课堂细目":"Syllabus content supporting rich markdown."]})]}),e.jsx("div",{className:"mt-3.5 flex justify-start",children:e.jsxs("button",{onClick:b,className:"flex items-center gap-1 p-2 text-xs font-bold text-indigo-700 bg-white border border-indigo-200 rounded-lg shadow-3xs hover:bg-indigo-50 hover:-translate-y-0.5 hover:shadow-xs transition-all cursor-pointer",children:[e.jsx(N,{size:12}),s==="zh"?"获取标准 CSV 模板":"Download Template CSV"]})})]}),e.jsxs("div",{onDragOver:t=>{t.preventDefault(),d(!0)},onDragLeave:()=>d(!1),onDrop:t=>{t.preventDefault(),d(!1),t.dataTransfer.files&&t.dataTransfer.files[0]&&x(t.dataTransfer.files[0])},onClick:()=>{document.getElementById("import-csv-file-picker")?.click()},className:`border-2 border-dashed rounded-2xl p-8 text-center cursor-pointer transition-all flex flex-col items-center justify-center min-h-[180px] ${u?"border-indigo-500 bg-indigo-50/70 scale-[1.01]":"border-gray-250 bg-gray-50/50 hover:bg-gray-50 hover:border-indigo-400"}`,children:[e.jsx("input",{id:"import-csv-file-picker",type:"file",accept:".csv",className:"hidden",onChange:t=>{t.target.files&&t.target.files[0]&&x(t.target.files[0])}}),e.jsx("div",{className:"p-3 bg-gray-100 border border-gray-200 rounded-full text-indigo-600 mb-3 group-hover:scale-105 transition-all",children:e.jsx(g,{size:24})}),e.jsx("span",{className:"text-sm font-bold text-gray-800",children:s==="zh"?"选择 CSV 文件或拖放至此处":"Click to select or drag and drop CSV file here"}),e.jsx("span",{className:"text-xs text-gray-400 mt-1",children:s==="zh"?"支持标准 CSV 文件,最大不超过 5MB":"Supports standard CSV format up to 5MB"})]})]}),r==="parsing"&&a.length>0&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs font-bold text-emerald-600 bg-emerald-50 border border-emerald-200 px-2.5 py-1 rounded-full",children:["✓ ",s==="zh"?`解析成功:查找到 ${a.length} 门课程`:`Parsed Successfully: Found ${a.length} records`]}),e.jsx("button",{onClick:()=>{m([]),c("idle")},className:"text-xs text-indigo-600 hover:text-indigo-800 font-semibold",children:s==="zh"?"重新上传":"Upload Different File"})]}),e.jsx("div",{className:"border border-gray-200 rounded-xl overflow-hidden shadow-3xs max-h-[300px] overflow-y-auto",children:e.jsxs("table",{className:"w-full text-left text-xs border-collapse",children:[e.jsx("thead",{className:"bg-gray-50 text-gray-600 border-b border-gray-200 font-bold",children:e.jsxs("tr",{children:[e.jsx("th",{className:"p-3 w-1/4",children:s==="zh"?"课程名称":"Course Title"}),e.jsx("th",{className:"p-3 w-3/4",children:s==="zh"?"大纲简介片段":"Syllabus Preview"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-100 bg-white",children:a.map((t,o)=>e.jsxs("tr",{className:"hover:bg-slate-50/50",children:[e.jsx("td",{className:"p-3 font-semibold text-gray-800 align-top truncate max-w-[150px]",title:t.title,children:t.title}),e.jsx("td",{className:"p-3 text-gray-500 font-mono text-[11px] leading-relaxed break-words col-span-2",children:t.content.length>150?t.content.substring(0,150)+"...":t.content||e.jsx("em",{className:"text-gray-300 italic",children:"None"})})]},o))})]})}),e.jsxs("div",{className:"bg-amber-50 border border-amber-100 text-amber-900 text-xs rounded-xl p-3 flex gap-2.5 items-start",children:[e.jsx("span",{className:"text-base leading-none",children:"⚠️"}),e.jsx("p",{className:"leading-relaxed",children:s==="zh"?'请确认课程名称没有与系统已有的课程同名。确认无误后点击下方"开始导入"写入 SQLite。':"Please ensure column details are accurate. Clicking Import will instantly commit all parsed courses into the server SQLite backend."})]})]}),r==="importing"&&e.jsxs("div",{className:"py-8 flex flex-col items-center justify-center space-y-4",children:[e.jsxs("div",{className:"relative w-20 h-20 flex items-center justify-center",children:[e.jsx(w,{size:36,className:"text-indigo-600 animate-spin"}),e.jsxs("span",{className:"absolute text-[11px] font-extrabold text-indigo-700",children:[Math.round(l/n*100),"%"]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"font-bold text-gray-800 text-sm",children:s==="zh"?"正在写入数据库":"Populating Database Records"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:s==="zh"?`正在导入第 ${l} / ${n} 项...`:`Importing item ${l} of ${n}...`})]}),e.jsx("div",{className:"w-full max-w-sm bg-gray-100 h-2 rounded-full overflow-hidden border border-gray-200",children:e.jsx("div",{className:"bg-indigo-600 h-full transition-all duration-300 rounded-full",style:{width:`${l/n*100}%`}})}),e.jsxs("div",{className:"w-full max-w-md bg-gray-50 rounded-xl p-3 border border-gray-150 font-mono text-[10px] text-gray-400 max-h-[140px] overflow-y-auto",children:[e.jsx("div",{children:"[API] POST /api/lessons -> Request batch transaction..."}),a.slice(0,l).map((t,o)=>e.jsx("div",{className:"text-indigo-600 font-bold mt-1",children:`✓ [${o+1}] "${t.title}" -> status 200 (Success)`},o))]})]}),r==="success"&&e.jsxs("div",{className:"py-8 text-center flex flex-col items-center justify-center space-y-4",children:[e.jsx("div",{className:"w-16 h-16 bg-emerald-50 rounded-full flex items-center justify-center border border-emerald-200 text-emerald-600 animate-bounce",children:e.jsx(C,{size:32})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-gray-800 text-base",children:s==="zh"?"🎉 批量导入大功告成":"🎉 Bulk-Import Complete"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 max-w-md mx-auto",children:s==="zh"?`所有 ${a.length} 门学科教案数据已顺畅写入系统底层 SQLite 数据仓库,现在已可以用于备课。`:`All ${a.length} curriculum lessons records have been successfully saved into security logs and SQLite storage.`})]})]}),r==="error"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-4 bg-rose-50 border border-rose-100 rounded-xl flex gap-3 items-start",children:[e.jsx("span",{className:"text-rose-600 font-bold text-lg leading-none",children:"⚠️"}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-bold text-rose-850",children:s==="zh"?"数据导入或解析中断":"Import or Parsing Error"}),e.jsx("p",{className:"text-xs text-rose-900 mt-1 leading-relaxed",children:f||(s==="zh"?"未知异常或文件破损。":"An unknown exception or corrupted CSV formatting occurred.")})]})]}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx("button",{onClick:()=>{c("idle"),y("")},className:"px-4 py-2 text-xs font-bold text-gray-700 bg-white border border-gray-250 cursor-pointer hover:bg-gray-50 rounded-lg transition-all",children:s==="zh"?"返回重试":"Go Back & Retry"}),e.jsx("button",{onClick:()=>i(!1),className:"px-4 py-2 text-xs font-bold text-white bg-indigo-600 cursor-pointer hover:bg-indigo-700 rounded-lg transition-all",children:s==="zh"?"关闭窗口":"Close"})]})]})]}),r!=="idle"&&r!=="error"&&e.jsxs("div",{className:"p-4 md:p-5 border-t border-gray-100 flex items-center justify-between bg-slate-50 shrink-0",children:[e.jsx("button",{onClick:()=>{m([]),c("idle")},disabled:r==="importing",className:"px-4 py-2 text-xs font-bold text-gray-650 bg-white border border-gray-200 hover:bg-gray-100 rounded-lg transition-all disabled:opacity-40 cursor-pointer",children:s==="zh"?"重置重选":"Reset & Clear"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>i(!1),disabled:r==="importing",className:"px-4 py-2 text-xs font-bold text-gray-600 hover:text-gray-800 transition-all disabled:opacity-40 cursor-pointer",children:s==="zh"?"取消":"Cancel"}),r==="parsing"&&e.jsxs("button",{onClick:j,className:"px-4 py-2 text-xs font-bold text-white bg-indigo-600 hover:bg-indigo-700 rounded-lg shadow-sm transition-all flex items-center gap-1 cursor-pointer",children:[e.jsx(z,{size:12}),s==="zh"?`开始导入 (${a.length} 类)`:`Proceed and Import (${a.length})`]}),r==="success"&&e.jsx("button",{onClick:()=>i(!1),className:"px-4 py-2 text-xs font-bold text-white bg-indigo-600 hover:bg-indigo-700 rounded-lg shadow-sm transition-all cursor-pointer",children:s==="zh"?"完成":"Done"})]})]})]})})})}export{L as ImportLessonsModal};