@eliceio/cdk-cli 0.1.0-alpha.3 → 0.1.0-alpha.5
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/README.md +288 -200
- package/es/cli.js +70 -66
- package/es/commands/build/index.d.ts +1 -1
- package/es/commands/build/index.js +27 -15
- package/es/commands/create/index.d.ts +5 -1
- package/es/commands/create/index.js +34 -15
- package/es/commands/create/install.d.ts +17 -0
- package/es/commands/create/install.js +53 -0
- package/es/commands/create/scaffold.d.ts +4 -1
- package/es/commands/create/scaffold.js +19 -13
- package/es/commands/dev/index.d.ts +1 -1
- package/es/commands/dev/index.js +5 -5
- package/es/commands/doctor/index.d.ts +29 -2
- package/es/commands/doctor/index.js +253 -55
- package/es/commands/mcp/index.d.ts +0 -12
- package/es/commands/mcp/index.js +6 -57
- package/es/commands/setup/index.d.ts +11 -3
- package/es/commands/setup/index.js +112 -37
- package/es/commands/skill/index.d.ts +46 -8
- package/es/commands/skill/index.js +151 -35
- package/es/commands/uninstall/index.d.ts +54 -0
- package/es/commands/uninstall/index.js +304 -0
- package/es/commands/update/index.d.ts +59 -0
- package/es/commands/update/index.js +251 -0
- package/es/commands/validate/index.d.ts +18 -0
- package/es/commands/{check → validate}/index.js +16 -10
- package/es/core/collect.d.ts +5 -2
- package/es/core/config.d.ts +99 -50
- package/es/core/config.js +244 -91
- package/es/core/latest.d.ts +21 -0
- package/es/core/latest.js +43 -0
- package/es/core/manifest.d.ts +2 -1
- package/es/core/manifest.js +2 -1
- package/es/core/minify.js +2 -2
- package/es/core/prepare.d.ts +18 -2
- package/es/core/prepare.js +48 -16
- package/es/core/project-check.d.ts +19 -8
- package/es/core/project-check.js +36 -9
- package/es/core/sandbox.js +2 -2
- package/es/core/sdk.d.ts +39 -0
- package/es/core/sdk.js +95 -0
- package/es/core/templates.d.ts +2 -4
- package/es/core/templates.js +2 -5
- package/es/dev/grading.d.ts +7 -8
- package/es/dev/grading.js +6 -16
- package/es/dev/host-page.d.ts +1 -1
- package/es/dev/host-page.js +12 -10
- package/es/dev/mock-api.d.ts +13 -18
- package/es/dev/mock-api.js +56 -66
- package/es/dev/server.js +52 -52
- package/es/rules/check.js +43 -31
- package/es/rules/index.d.ts +1 -1
- package/es/rules/index.js +1 -1
- package/es/rules/manifest.d.ts +28 -20
- package/es/rules/manifest.js +58 -55
- package/es/rules/types.d.ts +18 -20
- package/es/rules.json.js +2 -2
- package/es/test-packages.d.ts +7 -0
- package/package.json +3 -4
- package/rules.json +27 -43
- package/skills/_shared/always.md +4 -4
- package/skills/elice-content-check/SKILL.md +11 -8
- package/skills/elice-content-create/SKILL.md +8 -7
- package/skills/elice-content-guide/SKILL.md +42 -0
- package/skills/elice-content-guide/topics/00-what-the-person-decides.md +11 -0
- package/skills/elice-content-guide/topics/01-check-the-environment.md +10 -0
- package/skills/elice-content-guide/topics/02-design-the-material.md +35 -0
- package/skills/elice-content-guide/topics/03-create-the-project.md +22 -0
- package/skills/elice-content-guide/topics/04-rules.md +12 -0
- package/skills/elice-content-guide/topics/05-screen-code.md +101 -0
- package/skills/elice-content-guide/topics/06-using-the-quiz-template.md +22 -0
- package/skills/elice-content-guide/topics/07-move-existing-html.md +10 -0
- package/skills/elice-content-guide/topics/08-fix-check-errors.md +24 -0
- package/skills/elice-content-guide/topics/09-check.md +10 -0
- package/skills/elice-content-guide/topics/10-build.md +8 -0
- package/skills/elice-content-guide/topics/11-more.md +4 -0
- package/skills/elice-content-guide/topics/12-upload-with-the-material-mcp.md +41 -0
- package/skills/elice-content-migrate/SKILL.md +8 -7
- package/skills/elice-content-publish/SKILL.md +8 -7
- package/templates/_shared/lib/cdk-mock.d.ts +5 -13
- package/templates/_shared/lib/cdk-mock.js +49 -144
- package/templates/_shared/lib/elice-content.css +68 -1
- package/templates/_shared/lib/elice-content.d.ts +11 -38
- package/templates/_shared/lib/elice-content.js +43 -248
- package/templates/blank/README.md +12 -10
- package/templates/blank/metadata.json +9 -0
- package/templates/blank/package.json +13 -0
- package/templates/blank/screens/edit.js +1 -1
- package/templates/blank/screens/instructor.js +12 -5
- package/templates/blank/screens/learn.js +16 -11
- package/templates/blank/template.json +2 -2
- package/templates/quiz/README.md +15 -12
- package/templates/quiz/core/behaviors.js +4 -1
- package/templates/quiz/core/editor.d.ts +21 -10
- package/templates/quiz/core/editor.js +44 -31
- package/templates/quiz/core/model.d.ts +14 -0
- package/templates/quiz/core/model.js +76 -4
- package/templates/quiz/metadata.json +9 -0
- package/templates/quiz/package.json +13 -0
- package/templates/quiz/screens/edit.js +101 -34
- package/templates/quiz/screens/instructor.js +18 -12
- package/templates/quiz/screens/learn.js +45 -36
- package/templates/quiz/styles.css +65 -22
- package/templates/quiz/template.json +2 -2
- package/templates/quiz/ui/templates/edit.d.ts +1 -0
- package/templates/quiz/ui/templates/edit.js +65 -19
- package/templates/quiz/ui/templates/group.js +10 -2
- package/templates/quiz/ui/texts.js +11 -11
- package/es/commands/check/index.d.ts +0 -15
- package/es/commands/guide/index.d.ts +0 -29
- package/es/commands/guide/index.js +0 -120
- package/guides/content-development.md +0 -294
- package/templates/_shared/lib/cdk.js +0 -3
- package/templates/blank/completion.html +0 -15
- package/templates/blank/content.json +0 -4
- package/templates/blank/elice.config.json +0 -10
- package/templates/blank/screens/completion.js +0 -7
- package/templates/quiz/content.json +0 -35
- package/templates/quiz/elice.config.json +0 -9
- package/templates/quiz/grading.json +0 -4
package/skills/_shared/always.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
## Always
|
|
2
2
|
|
|
3
|
-
- Never put correct answers in the content zip. The edit screen saves them to `settings.grading` (locally
|
|
3
|
+
- Never put correct answers in the content zip. The edit screen saves them to `settings.grading` (locally `.ecdk/settings.json` from `ecdk dev`).
|
|
4
4
|
- The content runs in a sandboxed iframe on another origin: use the SDK (`app.useSubmit`, `app.useSave`) instead of storage, cookies, `alert`/`confirm`, new windows, the parent window or external requests.
|
|
5
5
|
- If `ecdk`, `node` or `npm` is "command not found", the app started without the person's shell PATH (macOS desktop apps such as Helpy Code Desktop). Run each command through their login shell instead: `"$SHELL" -ilc 'ecdk build --json'` (use `zsh -ilc` when `$SHELL` is empty). With `--json`, read only the last JSON block of the output (a login shell may print other text first). If that also fails, ask the person how Node was installed.
|
|
6
|
-
- Fix every `ecdk
|
|
7
|
-
- Ask the person before you settle correct answers, install anything globally, or upload or save to LXP (a saved version is visible to learners at once).
|
|
8
|
-
- LXP draws its own 이전 · 다음 bar under the material to move between lecture pages. For steps inside a material use the kit's `app.usePaging` (side chevrons, `n / N`; on the first and last step they become "이전 자료" · "다음 자료" to the previous / next lecture page,
|
|
6
|
+
- Fix every `ecdk validate` / `ecdk build` error before you report. Do not edit `lib/` (the screen kit). The SDK comes from npm through `package.json` (`npm update @eliceio/cdk`); `ecdk build` adds it to the zip as `lib/cdk.js`.
|
|
7
|
+
- Ask the person before you settle correct answers, install anything globally, or upload or save to LXP (a saved version is visible to learners at once). Before uploading, confirm the exact target page (기관 · 과목 · 수업 · 페이지) with the person.
|
|
8
|
+
- LXP draws its own 이전 · 다음 bar under the material to move between lecture pages. For steps inside a material use the kit's `app.usePaging` (side chevrons, `n / N`; on the first and last step they become "이전 자료" · "다음 자료" to the previous / next lecture page, `../elice-content-guide/topics/02-design-the-material.md`), never a look-alike bottom 이전 · 다음 bar.
|
|
9
9
|
- Answer the person in their language. The guide is in English.
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: elice-content-check
|
|
3
|
-
description: Find and fix problems in an Elice Custom HTML learning material - ecdk
|
|
3
|
+
description: Find and fix problems in an Elice Custom HTML learning material - ecdk validate or ecdk build errors, blocked browser APIs, missing or wrongly cased files, a zip that LXP rejects, or a material that stays on "Loading" or shows nothing in LXP. Use when the person reports an error with an Elice or LXP material or with ecdk.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Fix an Elice learning material
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Read guide topics with the Read tool from the sibling `elice-content-guide` skill folder (same parent folder as this skill), e.g. `../elice-content-guide/topics/05-screen-code.md`; its `SKILL.md` lists every topic. If that folder is missing, ask the person to run `ecdk setup --only skills` (it installs all five skills together; when these skills are in a project's `.claude/skills/`, run `ecdk setup --only skills --project` in that project folder instead), then continue. Topics for this skill: `../elice-content-guide/topics/08-fix-check-errors.md`, `../elice-content-guide/topics/04-rules.md`, `../elice-content-guide/topics/09-check.md`.
|
|
9
9
|
|
|
10
10
|
{{always}}
|
|
11
11
|
|
|
12
12
|
## Steps
|
|
13
13
|
|
|
14
|
-
1. **Reproduce with the CLI.** In the project, `ecdk doctor --json` and `ecdk
|
|
15
|
-
2. **Fix by the guide.** Look the id up in
|
|
14
|
+
1. **Reproduce with the CLI.** In the project, `ecdk doctor --json` and `ecdk validate --json`. For a zip someone made, `ecdk validate <file>.zip --json`. Each issue has an id, a file and a line.
|
|
15
|
+
2. **Fix by the guide.** Look the id up in `../elice-content-guide/topics/08-fix-check-errors.md`. Fix the cause in the source, not in `dist/`. Do not silence a rule with an `ecdk-ignore` comment unless the guide says so.
|
|
16
16
|
3. **Problems that show only in LXP.**
|
|
17
|
-
- Stays on "Loading" or shows nothing: rebuild with the current `ecdk build` (it adapts the pages to the LXP sandbox) and check the built zip with `ecdk
|
|
18
|
-
- Upload rejected: check `ecdk
|
|
19
|
-
-
|
|
20
|
-
|
|
17
|
+
- Stays on "Loading" or shows nothing: rebuild with the current `ecdk build` (it adapts the pages to the LXP sandbox) and check the built zip with `ecdk validate dist/content.zip`. Ask the person for the browser console error.
|
|
18
|
+
- Upload rejected: check `ecdk validate dist/content.zip`; a material needs `commentary.txt` and every file named in `metadata.json`.
|
|
19
|
+
- Screens show "아직 내용이 없습니다": nothing is saved yet; create the content in the edit screen (there is no default content file). `project.legacy-file`: an old `content.json` · `grading.json`; re-enter it in the edit screen and delete the file. An old `elice.config.json`, or `sdk.lib-copy` (an old `lib/cdk.js` copy): `ecdk doctor --fix`, then `npm install`.
|
|
20
|
+
- Answers or grading wrong: check the answers on the edit screen (saving in the `ecdk dev` content edit view writes `.ecdk/settings.json`) and that the submitted answer string matches the regex (`../elice-content-guide/topics/02-design-the-material.md`, `../elice-content-guide/topics/06-using-the-quiz-template.md`). In `ecdk dev` a submission is graded only when grading is saved; otherwise it is only accepted. Completing at the wrong time is the completion policy: 완료 정책은 LXP에 올린 뒤 설정 탭에서 교육자가 고른다 (not in the project; an old `completionPolicies` in `metadata.json` is ignored with `manifest.completion-policies-ignored`).
|
|
21
|
+
- doctor `cli.latest` warns: a newer ecdk is out and fixes may depend on it. Tell the person and, after they agree, run `ecdk update` (it installs the CLI globally, refreshes the skills and runs `npm update @eliceio/cdk` in a project); afterwards relay its closing note (Claude Code picks up changed skills in open sessions; `/reload-skills` only when it says the skills folder was just created; Helpy Code desktop needs a restart).
|
|
22
|
+
- `@eliceio/cdk 패키지를 찾지 못했습니다` or doctor `project.deps` fails: run `npm install` in the project. `sdk.outdated` (SDK 1.0.0-alpha.3 or older: saving in the LXP edit screen - draft save - fails): `npm update @eliceio/cdk` (on an old `lib/cdk.js` copy: `ecdk doctor --fix && npm install`), then build again.
|
|
23
|
+
4. **Confirm.** `ecdk validate` has no errors, `ecdk dev` works, and `ecdk build --json` returns `ok: true`. Tell the person what caused it and what you changed.
|
|
21
24
|
|
|
22
25
|
{{version}}
|
|
@@ -5,17 +5,18 @@ description: Create a new Elice Custom HTML learning material (LXP material type
|
|
|
5
5
|
|
|
6
6
|
# Create an Elice learning material
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Read guide topics with the Read tool from the sibling `elice-content-guide` skill folder (same parent folder as this skill), e.g. `../elice-content-guide/topics/05-screen-code.md`; its `SKILL.md` lists every topic. If that folder is missing, ask the person to run `ecdk setup --only skills` (it installs all five skills together; when these skills are in a project's `.claude/skills/`, run `ecdk setup --only skills --project` in that project folder instead), then continue. Read only the topics you need.
|
|
9
9
|
|
|
10
10
|
{{always}}
|
|
11
11
|
|
|
12
12
|
## Steps
|
|
13
13
|
|
|
14
|
-
1. **Design before code.** Read
|
|
15
|
-
2. **Environment and project.** `ecdk --version && ecdk doctor --json` (`ecdk
|
|
16
|
-
3. **Write.**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
1. **Design before code.** Read `../elice-content-guide/topics/00-what-the-person-decides.md` (what the person decides) and `../elice-content-guide/topics/02-design-the-material.md`. Decide ① what the student does, ② whether the student submits and the grading (`type` `pattern` or `rubric`, set on the edit screen; the quiz template uses `pattern`, so do not ask for a quiz). Do not decide the completion policy: 완료 정책은 LXP에 올린 뒤 설정 탭에서 교육자가 고른다 (the instructor picks `on_access` · `on_submit` · `on_graded` in the LXP settings tab after the upload; do not write it in `metadata.json`). Only tell the person which policy fits, ③ the instructor screen, ④ the content edit screen, ⑤ the purpose. Decide what the request leaves out and tell the person briefly; ask only when the learning goal is unclear.
|
|
15
|
+
2. **Environment and project.** `ecdk --version && ecdk doctor --json` (`../elice-content-guide/topics/01-check-the-environment.md`; when `cli.latest` warns, offer `ecdk update` and run it only after the person agrees), then `ecdk create --list` to pick a template and `ecdk create <folder> --template <name>` (`../elice-content-guide/topics/03-create-the-project.md`; it runs `npm install` for the SDK, so when that fails run `npm install` in the project).
|
|
16
|
+
3. **Write the screens.** You build the template: screens and code (`../elice-content-guide/topics/05-screen-code.md`, following its UI patterns: kit icon buttons, list rows, drop zones; the quiz template: `../elice-content-guide/topics/06-using-the-quiz-template.md`), and `commentary.txt` (key concepts and intent, no answers). The real content and answers are entered in the LXP edit screen after upload; there is no default content file. In `ecdk dev`, try the edit and learn screens with a little sample input (saved only locally in `.ecdk/settings.json`, never uploaded); do not author the full question set locally.
|
|
17
|
+
- If the person describes the content (for example "5 questions about perceptrons"), give it as draft text with the answers for the person to enter in the LXP edit screen. A quiz material holds one question, so several questions mean several quiz materials (pages).
|
|
18
|
+
4. **Check.** `ecdk validate`, fix errors (`../elice-content-guide/topics/08-fix-check-errors.md`), then `ecdk dev` and go through the screens (`../elice-content-guide/topics/09-check.md`). The person looks at the screens too.
|
|
19
|
+
5. **Build and report.** `ecdk build --json` must return `ok: true`. Report as `../elice-content-guide/topics/10-build.md` says.
|
|
20
|
+
6. **Upload** only after the person approves: the elice-content-publish skill (`../elice-content-guide/topics/12-upload-with-the-material-mcp.md`), or the person uploads `dist/content.zip` in LXP. Then the person enters the content and answers in the LXP edit screen and saves the page (the edit screen's button, then 저장 at the bottom of the LXP edit page; learners see it after that).
|
|
20
21
|
|
|
21
22
|
{{version}}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: elice-content-guide
|
|
3
|
+
description: The Elice Custom HTML learning material development guide (LXP material type 17, ecdk CLI) - design, the LXP sandbox rules, screen code and SDK, templates, fixing ecdk validate or build errors, checking, building and uploading. The other elice-content skills (create, migrate, check, publish) read its topic files; read it when you work on an Elice or LXP learning material.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Developing Elice Custom HTML learning materials
|
|
7
|
+
|
|
8
|
+
A Custom HTML learning material is **a small web app in one zip**. Anything that runs in a browser can be a learning material: an explanation, an interactive simulation or visualization, a guided exercise, a game-like activity, flashcards, a self-check or survey, a quiz, or the description of a practice problem.
|
|
9
|
+
|
|
10
|
+
Build it with the `ecdk` CLI (`@eliceio/cdk-cli`). This guide is split into topic files in `topics/` next to this file: read only the topics you need, with the Read tool (table below). For a command's options, run `ecdk <command> --help`.
|
|
11
|
+
|
|
12
|
+
One zip has up to three screens. The completion policy is not part of the zip: the instructor picks it in the LXP settings tab after the upload (ADR 0012).
|
|
13
|
+
|
|
14
|
+
| Screen | Files | What it does |
|
|
15
|
+
| ----------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
16
|
+
| Student (required) | `index.html` + `screens/learn.js` | The learning activity (read, interact, solve, make). Submits a result when needed |
|
|
17
|
+
| Instructor (optional) | `instructor.html` + `screens/instructor.js` | What only instructors see: activity summary, explanations, teaching tips |
|
|
18
|
+
| Content edit (optional) | `edit.html` + `screens/edit.js` | Instructors edit text and data without code and save it → `app.content` of the other screens. Also sets the grader and the answers or rubric, saved to `settings.grading` (never sent to students) |
|
|
19
|
+
|
|
20
|
+
Elice opens the content in a **sandboxed (`allow-scripts`) iframe on another origin**. There is no server: everything runs as browser JS, and only submission, saving and grading go to the Elice server.
|
|
21
|
+
|
|
22
|
+
## Topics
|
|
23
|
+
|
|
24
|
+
The other elice-content skills point to these files as `../elice-content-guide/topics/<file>` (this skill is installed next to them by `ecdk setup --only skills`). Cross references inside a topic ("see 2 ②") use the topic number.
|
|
25
|
+
|
|
26
|
+
| Topic file | Read when |
|
|
27
|
+
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
|
|
28
|
+
| `topics/00-what-the-person-decides.md` | Before you design or upload: what the person decides (goal, answers, grading, learning notes, upload) |
|
|
29
|
+
| `topics/01-check-the-environment.md` | At the start: `ecdk doctor`, installing or updating ecdk, registering the material MCP |
|
|
30
|
+
| `topics/02-design-the-material.md` | Designing: screens, submission and grading, learning notes, which completion policy fits |
|
|
31
|
+
| `topics/03-create-the-project.md` | Picking a template and running `ecdk create` |
|
|
32
|
+
| `topics/04-rules.md` | Before writing code: what the LXP sandbox blocks and what never goes in the zip |
|
|
33
|
+
| `topics/05-screen-code.md` | Writing screens: the SDK, the screen kit and its UI patterns |
|
|
34
|
+
| `topics/06-using-the-quiz-template.md` | Working on the quiz template |
|
|
35
|
+
| `topics/07-move-existing-html.md` | Moving existing HTML or a web demo into a project |
|
|
36
|
+
| `topics/08-fix-check-errors.md` | `ecdk validate` or `ecdk build` reports an error or warning (look the id up) |
|
|
37
|
+
| `topics/09-check.md` | Checking the screens in `ecdk dev` before you report |
|
|
38
|
+
| `topics/10-build.md` | Building the zip and reporting to the person |
|
|
39
|
+
| `topics/11-more.md` | Where to find more (SDK docs, `--help`) |
|
|
40
|
+
| `topics/12-upload-with-the-material-mcp.md` | Uploading to LXP with the `elice-material` MCP |
|
|
41
|
+
|
|
42
|
+
{{version}}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# 0. What the person decides
|
|
2
|
+
|
|
3
|
+
The person (the instructor or author) is responsible for the content and its answers. Do not settle the following on your own; ask, or get a confirmation.
|
|
4
|
+
|
|
5
|
+
1. **The learning goal, when it is unclear.** Decide the rest of the design to fit the goal and tell the person briefly what you decided.
|
|
6
|
+
2. **Correct answers.** You may draft answers and rubrics, but the person confirms that they are right.
|
|
7
|
+
3. **How it is graded**: whether the student submits, and the grader (`pattern` or `rubric`) set on the edit screen. Propose what fits the material and get a confirmation. The completion policy is not decided here: the instructor picks it in the LXP settings tab after the upload (완료 정책은 LXP에 올린 뒤 설정 탭에서 교육자가 고른다). Tell the person which policy fits (see the table in 2 ②).
|
|
8
|
+
4. **What the learning notes say** (`commentary.txt`). A material needs them (LXP rejects the upload without them); once they are filled in, AI Helpy answers only questions about this material, so let the person check the wording.
|
|
9
|
+
5. **Checking the screens.** The person looks at the student, tutoring, instructor, edit and mobile views in the preview. When they cannot, tell them what to check and in which order.
|
|
10
|
+
6. **Uploading to LXP.** A saved version is **visible to learners at once** (when the page is open). Before uploading, show what changes and get approval. The same goes for changing a material that is already open, changing answers, and restoring an older version.
|
|
11
|
+
7. **Global installs, accounts and permissions.** Leave them to the person.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# 1. Check the environment
|
|
2
|
+
|
|
3
|
+
```bash
|
|
4
|
+
ecdk --version && ecdk doctor --json
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
- Without `ecdk`: it needs Node.js 20.19 or later (22 LTS recommended) and `@eliceio/cdk-cli`. Tell the user how to install it, and run **a global install (`npm install -g @eliceio/cdk-cli`) only after the user agrees**. Without agreement, run `npx @eliceio/cdk-cli <command>`.
|
|
8
|
+
- `doctor` item `mcp.material` warns when the Elice material server MCP is not registered. It is used later to upload to LXP (the elice-content-publish skill), so it is not needed to make a material. To register it, ask the user first, then run `ecdk setup` (installs the skills and registers the MCP in one go; production by default, `--env qa5` for the QA server; `ecdk setup --only mcp` registers the MCP only) and tell the user the login step it prints.
|
|
9
|
+
- `doctor` item `cli.latest` warns when npm `latest` has a newer ecdk (`skip` when offline). Tell the user and run `ecdk update` **only after the user agrees** (it runs a global install, refreshes the skills with the new ecdk and runs `npm update @eliceio/cdk` when the current folder is a project; `ecdk update --check` only shows the plan). It never downgrades. After it, Claude Code picks up the changed skills in open sessions; only when the output (or `--json` `skillsDirCreated: true`) says the skills folder was just created, a Claude Code session that was already open needs `/reload-skills` once. Helpy Code desktop needs a restart. If it fails with `EACCES`, show the manual command it prints.
|
|
10
|
+
- Fix each `fail` item in `doctor` as its `fix.description` says. `--fix` fixes only the items that can be fixed automatically.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# 2. Design the material
|
|
2
|
+
|
|
3
|
+
Decide the following before writing code. Decide what the request leaves out to fit the material's purpose, and tell the user briefly what you decided. Ask only when the learning goal is unclear.
|
|
4
|
+
|
|
5
|
+
**① What the student does**
|
|
6
|
+
Read or watch / change values and observe (simulation, visualization) / follow steps / solve problems / make something. Tie the activity directly to the learning goal.
|
|
7
|
+
|
|
8
|
+
**② Submission and grading** (2026-11-12: the completion policy is an LXP setting the instructor picks in the settings tab after the upload, ADR 0012; the package does not list it. The grading settings `settings.grading` hold the grader `type` and its answers)
|
|
9
|
+
|
|
10
|
+
| Material | Policy to suggest (LXP setting) | Grading (`type`) | Student screen |
|
|
11
|
+
| ----------------------------------------------------------- | --------------------------------- | ----------------------- | ----------------------------------------- |
|
|
12
|
+
| Something to read or watch, such as a simulation | `on_access` (done on open) | - | No submission |
|
|
13
|
+
| Done when the activity ends (results, self-check, survey) | `on_submit` (100 on submit) | - | Submit the result with `useSubmit` |
|
|
14
|
+
| One correct answer or one set of answers | `on_graded` (done when it passes) | `pattern` (one regex) | `useSubmit` |
|
|
15
|
+
| Writing or assignments graded against a rubric (AI grading) | `on_graded` | `rubric` (the criteria) | `useSubmit`, the score comes back at once |
|
|
16
|
+
|
|
17
|
+
- **The grader and the answers are set on the edit screen** and saved to `settings.grading` with the edit token (`useSave` with `getGrading`): `{ "type": "pattern", "answer_key": "^…$" }` or `{ "type": "rubric", "rubric": "…" }`. The kit's default block `app.useGradingBlock()` uses LXP's wording (기준 답안 (정규표현식), 작성 예시 보기, 평가 기준). When the answers depend on the content's structure (questions, choices, steps), set them where the content is edited, for example in each question card. The answer to `pattern` is **one regular expression** that must match the whole submitted answer string (trimmed), so submit one string and build the regex from the instructor's choices.
|
|
18
|
+
- **The completion policy is picked in LXP**, not in the project: after the upload the instructor chooses `on_access`, `on_submit` or `on_graded` in the settings tab (ADR 0012). Do not write it in `metadata.json` (the old `completionPolicies` and `screens.completionPolicy` are ignored with the warning `manifest.completion-policies-ignored`, and `ecdk build` leaves them out of the zip). The content can read the current policy (SDK `material.completionPolicy`) but never sets it. Build what the suggested policy needs: a submission (`useSubmit`) for `on_submit` · `on_graded`, and the grading saved on the edit screen for `on_graded`. The server rejects `on_graded` without `settings.grading` (`MATERIAL_GRADING_REQUIRED`). The edit screen never sends a policy.
|
|
19
|
+
- Custom HTML does not use manual grading (`manual`) or no grading (`none`). There is no per-question grading: every question must be right for 100. Changing the answers does not regrade past submissions.
|
|
20
|
+
- Answers never go in the zip (`metadata.json` · data JSON · code), and there is no answer file in the project: answers exist only in `settings.grading`, saved on the edit screen. The old `gradingTypes` field is gone (2026-11-10): `ecdk build` warns when it is still in `metadata.json` or an old `elice.config.json`. A grading with the 11-10 policy and grader fields is rejected with how to rewrite it.
|
|
21
|
+
|
|
22
|
+
**②-1 Learning notes**: write the key concepts, the activity, and the intent of the questions in `commentary.txt` (plain text) at the top of the project. `build` puts it in the zip and writes `"commentary": "commentary.txt"` in `metadata.json`; LXP's AI Helpy and AI quiz generation read it. It is inside the zip, so students can read it: **never put answers in it.** A material needs it: LXP rejects an upload without learning notes, and `ecdk validate` reports `manifest.commentary-missing` (a problem description, `kind: description`, does not need it). Once it is filled in, AI Helpy answers only questions about this material.
|
|
23
|
+
|
|
24
|
+
**③ Does it need an instructor screen?** Make one when there are explanations, a summary of the answer conditions, or teaching tips. Turn it off when it would equal the student screen.
|
|
25
|
+
|
|
26
|
+
**④ Does it need a content edit screen?** When instructors may want to rewrite text, numbers or lists (for example a simulation's initial values, a card list, step descriptions), keep them in the content the edit screen saves (`app.content`, the material's `settings`) and let the edit screen change them. There is no default content file: until the edit screen saves, `app.content` is `{}`, `app.hasContent` is false, and the student and instructor screens show `app.emptyState()` ("아직 내용이 없습니다 …"). Turn the edit screen off only when the material needs no content at all (everything is in the code).
|
|
27
|
+
|
|
28
|
+
**⑤ Purpose**: the material itself (`kind: material`, the default), or the **problem description** of another material such as a practice (`kind: description`: student screen only, no grading).
|
|
29
|
+
|
|
30
|
+
**Steps inside one material (paging)**: LXP already draws a bar **under every material** with `< 이전 · 3/6 · 다음 >` that moves between **lecture pages** of the course. Inside the material, never draw a bottom bar with 이전 · 다음 (or "◀ 이전 · 2 / 6 · 다음 ▶") that looks like it: the student cannot tell which one moves the step and which one leaves the material. For a material with several steps (slides, STEP 1~5), use the kit's `app.usePaging` (see 5):
|
|
31
|
+
|
|
32
|
+
- Between steps: **round chevron buttons on the left and right edges** of the content, vertically centered, and a small **`n / N` indicator inside the content**.
|
|
33
|
+
- On the **first step the left button, on the last step the right button go to the previous / next lecture page** in LXP (SDK `app.navigation.previous()` · `next()`). They look different on purpose (a labeled pill "‹ 이전 자료" · "다음 자료 ›" instead of a bare chevron), so the student knows they are leaving this material. When there is no lecture page on that side, or the material is not in LXP (editor preview, local), they are hidden.
|
|
34
|
+
- If the last step has its own action (submit, "결과 보기"), keep it in the content; the right pill still leads on to the next material.
|
|
35
|
+
- On a phone (narrower than 512px) the kit puts the buttons under the content instead of over its edges.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# 3. Create the project
|
|
2
|
+
|
|
3
|
+
Run `ecdk create --list` first: it prints each template with its own version (`quiz@1.2.1`), what it is for and its screens. Pick the template from that list. `ecdk create` records the template and version in `package.json` `"ecdk"` (`template`), `ecdk build` copies it to `metadata.json` `build.template`, and `ecdk doctor` says when the installed ecdk ships a newer version of that template (nothing changes on its own).
|
|
4
|
+
|
|
5
|
+
| Case | Start with |
|
|
6
|
+
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
7
|
+
| A quiz (one question per quiz material; several questions mean several quiz materials) | `ecdk create <folder>` (quiz template: starts with no question; the edit screen adds one question of any of the five types with "문항 추가"; answers set on the edit screen; `pattern` grading, `on_graded` picked in LXP) |
|
|
8
|
+
| Any other material | `ecdk create <folder> --template blank` (skeleton of the three screens) |
|
|
9
|
+
| A dark screen | Add `--theme dark` to the above |
|
|
10
|
+
| A problem description | Create with blank, set `metadata.json` to `{ "kind": "description", "screens": { "learn": { "enabled": true, "entry": "index.html" } }, "commentary": "commentary.txt" }`, delete the other screen files |
|
|
11
|
+
| An existing HTML page | [7. Move existing HTML](07-move-existing-html.md) |
|
|
12
|
+
|
|
13
|
+
`create` refuses a folder that is not empty. Use a new subfolder. It then runs `npm install` in the project (the SDK `@eliceio/cdk` comes from npm through `package.json`; `--no-install` skips it). When the install fails, the project stays: run `npm install` in it (network or proxy problem; tell the user).
|
|
14
|
+
|
|
15
|
+
The project files: screens, `lib/` (the screen kit, copied as is), `metadata.json` (screens · `commentary`; `ecdk build` copies it and fills only `build`), `package.json` (the SDK version in `dependencies`, build options `minify` · `sourcemap` · `root` · `outDir` · `exclude` · `template` under `"ecdk"`). There is no `lib/cdk.js` in the project: `ecdk build` and `ecdk dev` take it from `node_modules/@eliceio/cdk`. To update the SDK run `npm update @eliceio/cdk`.
|
|
16
|
+
|
|
17
|
+
Then:
|
|
18
|
+
|
|
19
|
+
1. Set `screens` in `metadata.json` to the design (`{ "enabled": true, "entry": "edit.html" }` for a screen you keep, `{ "enabled": false }` for one you drop). In `ecdk dev`, saving in the content edit view writes the whole settings (content and answers) to `.ecdk/settings.json`; it stays out of the zip and out of `ecdk build` · `check`.
|
|
20
|
+
2. Make the edit screen save the data in ④. **Local work builds only the template (screens and code)**; the real content and answers are entered in the LXP edit screen after upload (2026-11-11). In `ecdk dev`, try the edit and learn screens with a little sample input; it is saved only in `.ecdk/settings.json` and never uploaded, so do not author the full content locally. When the person describes the content, give it as draft text for them to enter in LXP.
|
|
21
|
+
3. Write the screen code ([5](05-screen-code.md)). Delete the HTML and JS of screens you do not use.
|
|
22
|
+
4. Check ([9](09-check.md)) → build ([10](10-build.md)).
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# 4. Rules
|
|
2
|
+
|
|
3
|
+
1. **Never put correct answers in the content**: not in a data JSON file, the screen code, or comments. They reach the student's browser. Answers go only in `settings.grading` through the edit screen (the server never sends it to students; `ecdk dev` keeps it in `.ecdk/settings.json`, left out of the zip).
|
|
4
|
+
2. **Screen code calls only `lib/elice-content.js` (the kit).** Do not edit `lib/`. Do not call the SDK (`lib/cdk.js`, added by `ecdk build` from `node_modules`) directly.
|
|
5
|
+
3. **Do not use blocked features**: `localStorage` · `sessionStorage` · `indexedDB` · `document.cookie` · `alert`/`confirm`/`prompt` · `window.open` · `<form>` submission · access to `window.parent`/`top` · `fetch`/`WebSocket` to external addresses · external `<script src>`. To keep progress, submit it (`useSubmit`); to keep content, save it from the edit screen.
|
|
6
|
+
4. **Libraries and media go inside the zip.** Download libraries for charts, visualization or physics (for example Chart.js, D3, p5.js) into `vendor/` and load them by relative path instead of a CDN. Fonts, images and sounds also go in the zip. Limits: zip 20 MB, 300 files. Upload long videos separately as Elice video materials.
|
|
7
|
+
5. **Use relative paths** (`img/a.png`). Paths starting with `/` break. Match file name case. Prefer letters, digits, `-` and `_`.
|
|
8
|
+
6. **Switch views inside one HTML.** Show and hide steps or pages within the same HTML. Moving to another HTML or reloading loses the access token and shows "please reopen the material".
|
|
9
|
+
7. **Never insert user input as HTML**: use `textContent`. When `innerHTML` is really needed, escape it and leave `// ecdk-ignore-next-line sec.html-injection` with the reason.
|
|
10
|
+
8. **Colors and fonts use EDS tokens** (`var(--eds-primary-main)`, `var(--eds-text-primary)`, `var(--eds-background-paper)` …). When drawing on canvas or SVG, read them with `getComputedStyle(document.documentElement).getPropertyValue('--eds-primary-main')`. Do not write colors directly (the dark theme will not match).
|
|
11
|
+
9. **Mobile and accessibility**: touch targets 44 px or more, input text 16 px, no breakage at 360 px width. Work with touch (Pointer Events) and keyboard, not only a mouse. Give images `alt`.
|
|
12
|
+
10. Never include keys, tokens or passwords (comments are checked too).
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# 5. Screen code
|
|
2
|
+
|
|
3
|
+
```js
|
|
4
|
+
import { start } from '../lib/elice-content.js';
|
|
5
|
+
|
|
6
|
+
// Student screen
|
|
7
|
+
const app = await start({ screen: 'learn' });
|
|
8
|
+
// Content is only what the edit screen saved (no default content file). Before that, show the kit's notice
|
|
9
|
+
if (app.hasContent) render(app.content);
|
|
10
|
+
else root.replaceChildren(app.emptyState());
|
|
11
|
+
|
|
12
|
+
// Only for materials with a submission: say how to collect and restore the answer (result).
|
|
13
|
+
// Locking, restoring and result messages are handled by the kit.
|
|
14
|
+
app.useSubmit({
|
|
15
|
+
getAnswer: () => ({ result: currentResult() }), // small JSON (a few KB at most)
|
|
16
|
+
setAnswer: a => restore(a?.result), // filled on reopen and in tutoring
|
|
17
|
+
validate: a => a.result != null || 'Finish the activity before submitting.',
|
|
18
|
+
onResult: res => showFeedback(res), // grading result (score · isCorrect)
|
|
19
|
+
});
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
// Content edit screen: render the fields and say what to save
|
|
24
|
+
const app = await start({ screen: 'edit' });
|
|
25
|
+
renderForm(app.content);
|
|
26
|
+
app.useSave({
|
|
27
|
+
getContent: () => ({ ...app.content, title: titleInput.value, steps: readSteps() }),
|
|
28
|
+
validate: c => c.title.trim() !== '' || 'Enter a title.',
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
// Edit screen with the grader block: the kit draws LXP's grader radios, the "기준 답안 (정규표현식)" field
|
|
34
|
+
// with "작성 예시 보기", and the "평가 기준" field. useSave saves the content and the grader in one save.
|
|
35
|
+
const grading = app.useGradingBlock();
|
|
36
|
+
app.useSave({ getContent: () => app.content, getGrading: () => grading.getGrading() });
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- `getGrading` returns the grading settings (`{ type: 'pattern', answer_key }` or `{ type: 'rubric', rubric }`) or an error message that blocks saving. `app.grading` is the saved grading (only on the edit screen).
|
|
40
|
+
- When the edit screen saves the grading, the student screen must submit (`grading.no-submit` warns when the edit screen uses `useGradingBlock` · `getGrading` · `grading:` but no code calls `useSubmit` · `submit(`).
|
|
41
|
+
- Saving on the edit screen (`useSave`) **saves to the material's draft** (SDK `saveSettings`, with the edit token LXP opens the edit screen with). LXP's previews show the draft right away; learners see it only after the person presses 저장 at the bottom of the LXP edit page, which publishes the draft as a new version. In `ecdk dev` there is no publish step, so the student view changes at once. The kit shows the result and the failure messages (the upload is not saved yet, the upload is still processing, session expired), so the screen code does not announce "saved" itself.
|
|
42
|
+
- Materials without a submission do not call `useSubmit` (only `on_access` fits them in LXP).
|
|
43
|
+
- Use `app.mode` (`learn` · `preview` · `tutor` · `instructor` · `edit`), `app.readOnly` (tutoring) and `app.account.anonymousId` (for example a per-person fixed random seed) only when needed. The kit handles per-mode behavior such as the tutoring lock, so the screen code does not branch on the mode.
|
|
44
|
+
- Steps inside one material (see "Steps inside one material" in 2): let the kit draw the side buttons and the `n / N` indicator. Never draw an LXP-like bottom 이전 · 다음 bar.
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
app.usePaging({
|
|
48
|
+
count: steps.length,
|
|
49
|
+
// also called once at start. Draw only into `content` (#app by default); the kit keeps its buttons outside it
|
|
50
|
+
onChange: (i, { content }) => content.replaceChildren(renderStep(steps[i])),
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The kit wraps the content area (`root`, default `#app`) in its own frame and puts the side buttons and `n / N` in the frame, so redrawing `#app` (`replaceChildren`, `innerHTML`) does not remove them. Toggling `hidden` on prepared step elements works too. `usePaging({ count, onChange, start, root })` returns `{ element, content, go(i), step, ready }`. Use `go(i)` to jump (for example "다시 배분하기" back to step 3). Gating a step (for example "submit before moving on") is the screen's job: show a message in the step, the kit does not lock the arrows.
|
|
55
|
+
|
|
56
|
+
- Run simulations and animations with `requestAnimationFrame` and stop them while the view is hidden. Split heavy computation into small pieces.
|
|
57
|
+
|
|
58
|
+
### UI patterns
|
|
59
|
+
|
|
60
|
+
Build screens from the kit's classes in `lib/elice-content.css` (EDS values, both themes) so every material looks and behaves the same. The quiz template follows these patterns; copy its markup from `ui/templates/`.
|
|
61
|
+
|
|
62
|
+
| Where | Pattern |
|
|
63
|
+
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
64
|
+
| Edit screen, a card for one item (question, step) | Title on the left, then a type `<select>` in regular weight. On the right, borderless icon buttons `button.ec-icon-button`: ↑ · ↓ · delete with a **trash** icon. Hide ↑ · ↓ when there is only one card. |
|
|
65
|
+
| Edit screen, one row in a list (choice, group) | `⠿` drag handle → the answer control (radio or checkbox) → number → text input → remove with `button.ec-icon-button.ec-danger` (a red **circle with −**, no border). A wide answer control (a `<select>`) goes after the input instead. Disable remove at the minimum count. |
|
|
66
|
+
| Student screen, an empty drop target | `.ec-dropzone`: a dashed box with an icon, a bold line `.ec-dropzone-title` (for example "보기를 여기로 끌어 놓으세요") and a hint `<p>` ("또는 보기를 누른 뒤 이곳을 눌러 주세요."). It also takes clicks, not only drops. |
|
|
67
|
+
| Student screen, undo actions ("답안 초기화") | Show only when there is something to undo (for example at least one item placed), hide on read-only screens, and keep the row height fixed so nothing below jumps. Keep it away from the submit button. |
|
|
68
|
+
| Any Korean text in a narrow box | `word-break: keep-all` so lines do not break inside a word. |
|
|
69
|
+
|
|
70
|
+
Icon buttons always need `aria-label`. Icons are inline SVG with `stroke="currentColor"`, so color follows the button:
|
|
71
|
+
|
|
72
|
+
```html
|
|
73
|
+
<!-- trash (delete a card) -->
|
|
74
|
+
<svg
|
|
75
|
+
viewBox="0 0 24 24"
|
|
76
|
+
width="18"
|
|
77
|
+
height="18"
|
|
78
|
+
fill="none"
|
|
79
|
+
stroke="currentColor"
|
|
80
|
+
stroke-width="2"
|
|
81
|
+
stroke-linecap="round"
|
|
82
|
+
stroke-linejoin="round"
|
|
83
|
+
aria-hidden="true"
|
|
84
|
+
>
|
|
85
|
+
<path d="M4 7h16M10 11v6M14 11v6M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4h6v3" />
|
|
86
|
+
</svg>
|
|
87
|
+
<!-- circle with − (remove one row) -->
|
|
88
|
+
<svg
|
|
89
|
+
viewBox="0 0 24 24"
|
|
90
|
+
width="22"
|
|
91
|
+
height="22"
|
|
92
|
+
fill="none"
|
|
93
|
+
stroke="currentColor"
|
|
94
|
+
stroke-width="1.5"
|
|
95
|
+
stroke-linecap="round"
|
|
96
|
+
aria-hidden="true"
|
|
97
|
+
>
|
|
98
|
+
<circle cx="12" cy="12" r="9" />
|
|
99
|
+
<path d="M8 12h8" />
|
|
100
|
+
</svg>
|
|
101
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# 6. Using the quiz template
|
|
2
|
+
|
|
3
|
+
- The template starts with **no questions**: the student and instructor screens show "아직 내용이 없습니다" until the edit screen saves. The person adds the question and answer on the LXP edit screen after upload ("문항 추가", any of the five types, the answer in the same card). **One quiz material holds one question**, like the legacy LXP quiz: once there is a question the edit screen shows a hint instead of "문항 추가", and several questions mean several quiz materials (pages). A quiz already saved with more questions still shows and saves. Locally, add a sample question in `ecdk dev` to check the screens; give the requested question set as draft text, one question per quiz material.
|
|
4
|
+
- Question types: `select_one` · `select_multiple` · `order` · `text` · `group`. Question, choice and group ids (`q1`, `a`, `g1`) are lower-case letters and digits; once set, do not change them.
|
|
5
|
+
- Student answer: **one string**, `id=answer` per question joined by `;` in question order: `q1=b;q2=a,d;q3=c,a,b;q4=weight;q5=g1:a|g2:b,c`. Multiple choice lists choice ids **sorted**, order lists them in slot order, group lists `group:choices(sorted)` in group order joined by `|`, and a text answer is trimmed and `encodeURIComponent`-encoded.
|
|
6
|
+
- Answers: the instructor picks the answer in each question card of the edit screen. Single and multiple choice mark it in the option rows (a "정답" radio or checkbox per option), group sorting picks each option's group in its row, order uses a separate "정답" section, and text questions take one allowed answer per line. Saving builds one regex and checks it, and blocks the save with the question number when an answer is missing, points at a deleted choice, or the regex does not match the answers back or still matches a changed answer. The quiz grades with `pattern` (no hand-written regex); in LXP the instructor normally picks `on_graded` for it. `pattern` compares the whole answer at once, so **everything must match for 100** (no partial score per question).
|
|
7
|
+
|
|
8
|
+
```json
|
|
9
|
+
{
|
|
10
|
+
"type": "pattern",
|
|
11
|
+
"answer_key": "^q1=b;q2=a,d;q3=c,a,b;q4=(?:weight|%EA%B0%80%EC%A4%91%EC%B9%98);q5=g1:a\\|g2:b,c$"
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
- File split: **`ui/` is the look** (edit freely), **`screens/` is the layout** (which blocks in which order), **`core/` is behavior and the grading contract** (do not edit).
|
|
16
|
+
- Colors, spacing, corners, choice cards: the `--qz-*` variables in `ui/theme.css` (they point at EDS tokens, so `--theme dark` also fits)
|
|
17
|
+
- Text: `ui/texts.js` (tab title, loading, student, instructor, edit, and validation messages)
|
|
18
|
+
- Markup: the `` html`…` `` snippets in `ui/templates/*.js` (`choice` card, `question` frame, `order`, `group`, `text`, `page` header, `edit` fields). Inserted values are escaped. Classes and tags are free; **keep the `data-role` attributes** (`result` · `explanation` · `choice` · `input` · `pool` · `slots` · `items` and so on, listed at the top of each file) and selecting, dragging and the answer strings keep working.
|
|
19
|
+
- Behavior adds state as attributes: `data-result="correct|wrong"` · `data-dragging` · `data-ghost`. Style them in CSS.
|
|
20
|
+
- After a change, solve all five types in `ecdk dev` by clicking and dragging, submit, and check that the answer string (local grading) is unchanged.
|
|
21
|
+
|
|
22
|
+
To mix a visualization or simulation into a quiz, edit the quiz template, or write the question data in the same shape on top of blank.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# 7. Move existing HTML
|
|
2
|
+
|
|
3
|
+
1. Create a skeleton with `ecdk create <new folder> --template blank`.
|
|
4
|
+
2. Move the original body, styles and scripts to the student screen (`index.html` · `screens/learn.js` · `styles.css`). Copy image, font and library folders as they are and use relative paths.
|
|
5
|
+
3. Download external CDN scripts and fonts into the zip.
|
|
6
|
+
4. Replace blocked code (storage, `alert`, external sends) as in [4](04-rules.md).
|
|
7
|
+
5. Merge multiple HTML pages into one HTML that switches views.
|
|
8
|
+
6. Decide submission and grading as in [2 ②](02-design-the-material.md). The completion policy is not written in the project: the instructor picks it in the LXP settings tab after the upload (suggest `on_access` when there is no submission).
|
|
9
|
+
7. Turn off the instructor and edit screens in `metadata.json` `screens` (`{ "enabled": false }`) and delete their files when they are not needed.
|
|
10
|
+
8. An old ecdk project with `elice.config.json` or `lib/cdk.js` and no `@eliceio/cdk` in `package.json`: run `ecdk doctor --fix` (moves the settings to `metadata.json` and `package.json` `"ecdk"`, adds the SDK dependency), then `npm install`.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# 8. Fix check errors
|
|
2
|
+
|
|
3
|
+
Read `check.issues[]` (`id` · `level` · `path` · `line` · `message`) from `ecdk build --json`. With an `error` no zip is made. Each `message` says how to fix it.
|
|
4
|
+
|
|
5
|
+
| id | Fix |
|
|
6
|
+
| ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
7
|
+
| `ref.missing` · `ref.case-mismatch` | Match the path and case to the real file |
|
|
8
|
+
| `ref.root-absolute` | Change `/…` to a relative path |
|
|
9
|
+
| `ref.external-script` · `ref.external-request` | Put the library or font in the zip and use a relative path |
|
|
10
|
+
| `api.storage` · `api.cookie` | Do not use storage. Submit results; save content from the edit screen |
|
|
11
|
+
| `api.dialog` · `api.window-open` · `html.form` | An in-page message · the same view · a button click + `useSubmit` |
|
|
12
|
+
| `api.external-send` | Remove the external send |
|
|
13
|
+
| `sec.html-injection` | Use `textContent`. If justified: escape + `ecdk-ignore` + the reason |
|
|
14
|
+
| `sec.secret` · `file.secret` | Remove the secret or the answer file (if it was already uploaded, tell the user to **revoke the key**) |
|
|
15
|
+
| `manifest.completion-policies-ignored` (warn) | Remove the old `completionPolicies` and `screens.completionPolicy` from `metadata.json` (and the completion policy screen files). The instructor picks the policy in the LXP settings tab |
|
|
16
|
+
| `grading.no-submit` (warn) | The edit screen saves the grading but nothing submits: add `useSubmit` to the student screen, or drop the grading block when the material is not graded |
|
|
17
|
+
| `project.legacy-file` (warn, project only) | An old `elice.config.json` · `content.json` · `grading.json` is left: `ecdk doctor --fix` moves `elice.config.json`; re-enter the content and answers in the edit screen, then delete the other files |
|
|
18
|
+
| `sdk.outdated` (error) | The SDK in the zip is older than the minimum (1.0.0-alpha.3 or older cannot save in the LXP edit screen - draft save fails): `npm update @eliceio/cdk` (an old `lib/cdk.js` copy: `ecdk doctor --fix && npm install`), then build again |
|
|
19
|
+
| `sdk.lib-copy` (warn, project only) | An old `lib/cdk.js` copy and no `@eliceio/cdk` in `package.json`: `ecdk doctor --fix`, then `npm install` |
|
|
20
|
+
| `build.template-unknown` (warn) | The material was made with a template or template version this ecdk does not know. Update ecdk (`npm i -g @eliceio/cdk-cli`) or check `template` in `package.json` `"ecdk"` |
|
|
21
|
+
| `manifest.*` · `entry.*` | Check `screens` and `kind` in `metadata.json` |
|
|
22
|
+
| `limit.*` · `file.large-image` | Shrink images and video, drop unused files (build output: "files not referenced anywhere") |
|
|
23
|
+
|
|
24
|
+
Use `ecdk-ignore`, which turns a rule off, only for legitimate code a regular expression cannot tell apart, and **always with the reason**. Do not scatter it to silence errors.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# 9. Check
|
|
2
|
+
|
|
3
|
+
```bash
|
|
4
|
+
ecdk dev # http://localhost:4170: student, tutoring, instructor, content edit; desktop and mobile widths
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
- With a browser tool, open it and finish the student activity (with the score and result when it submits), then check the tutoring lock, saving on the edit screen → the change on the student screen, saving answers on the edit view → grading of the student view (without saved grading a submission is only accepted, with no score), the mobile width, and the dark theme. Without one, ask the user to check in this order.
|
|
8
|
+
- Even after your own check, the person looks at the screens before uploading (see [0. What the person decides](00-what-the-person-decides.md)).
|
|
9
|
+
- Fix the content console errors and 404s printed in the terminal.
|
|
10
|
+
- Opening files directly with `file://` is not a check.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# 10. Build
|
|
2
|
+
|
|
3
|
+
```bash
|
|
4
|
+
ecdk build --json
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
- With `ok: true` the zip is `dist/content.zip`. To make it smaller, set `"minify": true` in `package.json` `"ecdk"` (quiz template about 122 KB → 87 KB).
|
|
8
|
+
- Report to the user: what the material is (what the student does, which screens are on, how it completes), the zip path and size, **what to pick in the LXP settings tab** (the completion policy that fits, which the instructor picks there, the grading type, and where the answers are set), the upload steps (Custom HTML material in LXP → upload the zip → settings tab → save → check the student and instructor screens), and anything left to check. Saving makes the new version visible to learners at once, so the person approves it first (see [0. What the person decides](00-what-the-person-decides.md)).
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# 12. Upload with the material MCP
|
|
2
|
+
|
|
3
|
+
The `elice-material` MCP server (elice-material backend) uploads a built zip to a LXP Custom page and saves it as a new version. Register it with `ecdk setup` (QA: `ecdk setup --only mcp --env qa5`) and log in once per tool (Claude Code `/mcp` → elice-material → Authenticate, Helpy Code `⌘ ;`). Every page tool takes `org` (the organization's `name_short`, the subdomain of `https://{org}.elice.io`) and `lecture_page_id`.
|
|
4
|
+
|
|
5
|
+
**Confirm the target page.** Never upload to a page the person has not explicitly confirmed. Before any upload call (`create_package_upload`, `submit_package`), show the full target, 기관 · 과목 · 수업 · 페이지 (names and ids), and its LXP edit URL, then wait for an explicit yes. This holds every time: also when `.ecdk/link.json` exists and when the person gave a URL (confirm the names it resolves to). `.ecdk/link.json` and an edit URL give only the org's `name_short`: get the 기관 name from `list_my_organizations` and the 과목 · 수업 · 페이지 names from `get_material`. Never pick a page yourself (not the first in a list, not a guess by title, not a page from another project); if the answer is ambiguous, ask again. Creating a page (`create_custom_page`) needs its own yes that names the 수업 it goes into.
|
|
6
|
+
|
|
7
|
+
**Order**
|
|
8
|
+
|
|
9
|
+
| Step | Tool or command | Notes |
|
|
10
|
+
| ------------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| Build | `ecdk build --json` | `ok: true` required. Use `zip` and `zipBytes` |
|
|
12
|
+
| Find the page | `list_my_organizations` → `list_courses` → `list_lectures` → `list_custom_pages` | Or read `.ecdk/link.json` (written after a save, see below), or parse the LXP edit URL `https://{org}.…/courses/{c}/lectures/{l}/lecturepages/{id}/edit`. Only lectures with `can_hold_pages: true` hold pages. The person picks; then confirm the full target (above) |
|
|
13
|
+
| New page (optional) | `create_custom_page` (`org`, `lecture_id`) | Its own yes, naming the 수업. The page is closed to learners and has no title until its first save. Fails where the elice-api change is not deployed: then use an existing Custom page |
|
|
14
|
+
| Current version | `get_material` | Keep `current_version.id` (null for a page never saved) |
|
|
15
|
+
| Upload URL | `create_package_upload` (`size_bytes`) | At most 20 MB. Returns `key` and `curl_command` |
|
|
16
|
+
| Upload | the `curl_command`, `package.zip` replaced by the zip path | From a desktop app, run it through a login shell (see Always) |
|
|
17
|
+
| Draft | `submit_package` (`key`) → `get_draft` every 2–3 s | `ready`: shows `preview_urls`, `warnings`, the package metadata. `failed`: report `failure` with `ecdk validate dist/content.zip` and stop |
|
|
18
|
+
| Approve | — | Show page, title, answers saved or not, `preview_urls`. Saving is visible to learners at once when the page is open |
|
|
19
|
+
| Save | `save_draft` (`material_draft_id`, `expected_current_version_id`) | See below (no content or `grading` from the project). `MATERIAL_CHANGED`: someone saved after your `get_material`; do not retry blindly, tell the person |
|
|
20
|
+
| Title, icon | `update_material` (`expected_current_version_id`, `payload`) | Only keys to change, e.g. `{ "title": "…", "icon": "quiz" }`. Read the new version id with `get_material` first |
|
|
21
|
+
|
|
22
|
+
After a successful save, write `.ecdk/link.json` in the project (it is not put in the zip; add `.ecdk/` to `.gitignore`):
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{ "org": "trial-cdk-qa5", "lecture_page_id": 129, "version_id": "…" }
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Next time, read it, confirm the page with the person as above (기관 · 과목 · 수업 · 페이지 and the URL), and compare `version_id` with `get_material`'s `current_version.id`: if they differ, someone saved in LXP since — tell the person before uploading.
|
|
29
|
+
|
|
30
|
+
**Completion policy and answers**
|
|
31
|
+
|
|
32
|
+
- Do not pass `completion_policy` to `save_draft` (2026-11-12, ADR 0012): the completion policy is an LXP setting. After saving, tell the person to pick it in the LXP settings tab (`on_access` complete on open, `on_submit` complete on any submission, `on_graded` complete when the grading passes) and say which one fits the material.
|
|
33
|
+
- Content and answers are not uploaded from the project (2026-11-11): local `ecdk dev` builds only the template (screens and code), and `.ecdk/settings.json` is sample input for local checks that is never uploaded. Do not pass content or `grading` to `save_draft`. After saving, tell the person to open the LXP edit screen, enter the content and answers (`settings`, with `settings.grading` for `on_graded`), save with the edit screen's own button (the quiz template: "편집 완료"), then press 저장 at the bottom of the LXP edit page: the edit screen saves to the draft, and learners see it only after that 저장 makes a new version. Answers never go into the zip.
|
|
34
|
+
- A quiz has no answers at its first upload: the person sets the answers on the edit screen, then picks `on_graded` in the settings tab. If `save_draft` returns `MATERIAL_GRADING_REQUIRED` (the page already uses `on_graded`), stop and tell the person.
|
|
35
|
+
- The quiz template grades with a pattern; other materials follow the design (②).
|
|
36
|
+
|
|
37
|
+
**Icon**: one of `note`, `video`, `pdf`, `exercise`, `quiz`, `notebook`, `live`, `assignment`, `external`, `survey`, or `null` (free-form, the default). Use `quiz` for the quiz template, otherwise `null` unless the person picks one. Title and icon also update the lecture page list.
|
|
38
|
+
|
|
39
|
+
**Errors**: a login prompt → ask the person to log in again (`/mcp`). A permission error → the account needs HeadTA or higher in that course. `MATERIAL_GRADING_REQUIRED` → `on_graded` without `grading`. `PACKAGE_TOO_LARGE` → over 20 MB.
|
|
40
|
+
|
|
41
|
+
**After saving**: report 기관 · 과목 · 수업 · 페이지 (names and ids), the LXP URL, the saved version, and whether the page is closed to learners (a new page stays closed until the person opens it in LXP). If the LXP edit tab of the page is open, it must be refreshed before editing there, or it overwrites this save.
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: elice-content-migrate
|
|
3
|
-
description: Move existing HTML, JavaScript or a web demo into an Elice Custom HTML learning material with the ecdk CLI - wrap it in an ecdk project, replace browser features the LXP sandbox blocks, add
|
|
3
|
+
description: Move existing HTML, JavaScript or a web demo into an Elice Custom HTML learning material with the ecdk CLI - wrap it in an ecdk project, replace browser features the LXP sandbox blocks, add submission or grading, and build the upload zip. Use when the person has an HTML file, folder or zip they want to run as Elice or LXP learning content.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Move existing HTML into an Elice learning material
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Read guide topics with the Read tool from the sibling `elice-content-guide` skill folder (same parent folder as this skill), e.g. `../elice-content-guide/topics/05-screen-code.md`; its `SKILL.md` lists every topic. If that folder is missing, ask the person to run `ecdk setup --only skills` (it installs all five skills together; when these skills are in a project's `.claude/skills/`, run `ecdk setup --only skills --project` in that project folder instead), then continue.
|
|
9
9
|
|
|
10
10
|
{{always}}
|
|
11
11
|
|
|
12
12
|
## Steps
|
|
13
13
|
|
|
14
|
-
1. **Read**
|
|
14
|
+
1. **Read** `../elice-content-guide/topics/07-move-existing-html.md` (move existing HTML) and `../elice-content-guide/topics/04-rules.md` (rules).
|
|
15
15
|
2. **Look at the original first.** List its entry HTML, the files it loads, and anything the sandbox blocks (storage, cookies, dialogs, `window.open`, the parent window, external requests, absolute `/` paths). Tell the person what will change.
|
|
16
|
-
3. **Wrap it.** Make or reuse an ecdk project as
|
|
17
|
-
4. **
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
3. **Wrap it.** Make or reuse an ecdk project as `../elice-content-guide/topics/07-move-existing-html.md` says, keep the original files as they are where possible, and write `commentary.txt`. An old ecdk project (`elice.config.json`, or `lib/cdk.js` without `@eliceio/cdk` in `package.json`): `ecdk doctor --fix`, then `npm install`.
|
|
17
|
+
4. **Submission and grading.** Decide whether it submits and how it grades (`../elice-content-guide/topics/02-design-the-material.md`). Do not write a completion policy: 완료 정책은 LXP에 올린 뒤 설정 탭에서 교육자가 고른다 (tell the person which one fits, e.g. `on_access` without a submission). When it grades, set the grader and the answers on the edit screen (`app.useGradingBlock()`). Ask the person for correct answers when it is graded. Data the instructor should edit goes in the content the edit screen saves, not in a default JSON file; until it is saved the screens show `app.emptyState()`.
|
|
18
|
+
Keep the original design on the student screen. Screens you add (an edit screen, an empty state) follow the UI patterns in `../elice-content-guide/topics/05-screen-code.md`.
|
|
19
|
+
5. **Check.** `ecdk validate`, fix errors (`../elice-content-guide/topics/08-fix-check-errors.md`), `ecdk dev`, compare with the original.
|
|
20
|
+
6. **Build and report.** `ecdk build --json` returns `ok: true`; report what changed from the original (`../elice-content-guide/topics/10-build.md`).
|
|
20
21
|
|
|
21
22
|
{{version}}
|