@learnpack/learnpack 5.0.319 → 5.0.320
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/lib/commands/serve.js +17 -17
- package/lib/creatorDist/assets/{index-XZDcEWl9.js → index-BhqDgBS9.js} +588 -585
- package/lib/creatorDist/index.html +1 -1
- package/package.json +1 -1
- package/src/commands/serve.ts +3462 -3461
- package/src/creator/src/components/syllabus/SyllabusEditor.tsx +20 -9
- package/src/creatorDist/assets/{index-XZDcEWl9.js → index-BhqDgBS9.js} +588 -585
- package/src/creatorDist/index.html +1 -1
- package/src/ui/_app/app.css +1 -1
- package/src/ui/_app/app.js +2264 -2273
- package/src/ui/app.tar.gz +0 -0
|
@@ -76,7 +76,7 @@ const SyllabusEditor: React.FC = () => {
|
|
|
76
76
|
}, [syllabus, navigate])
|
|
77
77
|
|
|
78
78
|
useEffect(() => {
|
|
79
|
-
;(async () => {
|
|
79
|
+
; (async () => {
|
|
80
80
|
const { token } = checkParams(["token"])
|
|
81
81
|
if (token) {
|
|
82
82
|
const user = await loginWithToken(token)
|
|
@@ -242,23 +242,34 @@ const SyllabusEditor: React.FC = () => {
|
|
|
242
242
|
|
|
243
243
|
setIsGenerating(true)
|
|
244
244
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
245
|
+
let contentIndex = syllabus.courseInfo.contentIndex
|
|
246
|
+
|
|
247
|
+
if (uploadedFiles.length > 0) {
|
|
248
|
+
contentIndex = contentIndex + " " + uploadedFiles.map((f) => `<FILE name="${f.name}">${f.text}</FILE>`).join("\n")
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const extendedSyllabus = {
|
|
252
|
+
...syllabus,
|
|
253
|
+
courseInfo: {
|
|
254
|
+
...syllabus.courseInfo,
|
|
255
|
+
contentIndex: contentIndex,
|
|
256
|
+
},
|
|
257
|
+
}
|
|
258
|
+
|
|
249
259
|
try {
|
|
250
|
-
await createCourse(
|
|
260
|
+
await createCourse(extendedSyllabus, tokenToUse, auth.bcToken)
|
|
261
|
+
setTimeout(() => {
|
|
262
|
+
cleanAll()
|
|
263
|
+
window.location.href = `/preview/${syllabus.courseInfo.slug}?token=${auth.bcToken}&language=${syllabus.courseInfo.language}&mode=${mode}`
|
|
264
|
+
}, 2000)
|
|
251
265
|
} catch (error) {
|
|
252
266
|
console.error("Failed to create course:", error)
|
|
253
|
-
clearTimeout(timeout)
|
|
254
267
|
setIsGenerating(false)
|
|
255
268
|
}
|
|
256
269
|
}
|
|
257
270
|
|
|
258
271
|
if (!syllabus) return null
|
|
259
272
|
|
|
260
|
-
console.log(syllabus.courseInfo)
|
|
261
|
-
|
|
262
273
|
return isGenerating ? (
|
|
263
274
|
<>
|
|
264
275
|
<Loader
|