@eliceio/cdk-cli 0.1.0-alpha.2 → 0.1.0-alpha.4
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 +263 -191
- package/es/cli.js +93 -33
- package/es/commands/build/index.d.ts +1 -1
- package/es/commands/build/index.js +21 -12
- package/es/commands/check/index.d.ts +11 -2
- package/es/commands/check/index.js +51 -5
- package/es/commands/create/index.d.ts +6 -0
- package/es/commands/create/index.js +56 -8
- package/es/commands/create/install.d.ts +17 -0
- package/es/commands/create/install.js +53 -0
- package/es/commands/create/scaffold.d.ts +6 -1
- package/es/commands/create/scaffold.js +27 -17
- package/es/commands/dev/index.d.ts +1 -1
- package/es/commands/dev/index.js +6 -2
- package/es/commands/doctor/index.d.ts +21 -0
- package/es/commands/doctor/index.js +255 -38
- package/es/commands/mcp/index.d.ts +134 -0
- package/es/commands/mcp/index.js +399 -0
- package/es/commands/setup/index.d.ts +40 -0
- package/es/commands/setup/index.js +157 -0
- package/es/commands/skill/index.d.ts +2 -5
- package/es/commands/skill/index.js +1 -29
- package/es/core/collect.d.ts +5 -2
- package/es/core/config.d.ts +141 -31
- package/es/core/config.js +341 -59
- 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 +47 -18
- package/es/core/project-check.d.ts +26 -0
- package/es/core/project-check.js +53 -0
- 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 +25 -0
- package/es/core/templates.js +41 -0
- package/es/dev/grading.d.ts +14 -7
- package/es/dev/grading.js +27 -13
- package/es/dev/host-page.d.ts +1 -1
- package/es/dev/host-page.js +34 -34
- package/es/dev/mock-api.d.ts +19 -4
- package/es/dev/mock-api.js +75 -9
- package/es/dev/server.d.ts +7 -0
- package/es/dev/server.js +112 -32
- package/es/rules/check.js +95 -10
- package/es/rules/index.d.ts +1 -1
- package/es/rules/index.js +1 -1
- package/es/rules/manifest.d.ts +23 -9
- package/es/rules/manifest.js +60 -35
- package/es/rules/node.js +3 -1
- package/es/rules/semver.d.ts +5 -0
- package/es/rules/semver.js +32 -0
- package/es/rules/types.d.ts +38 -7
- package/es/rules.json.js +2 -2
- package/es/test-packages.d.ts +7 -0
- package/guides/content-development.md +150 -55
- package/package.json +3 -3
- package/rules.json +77 -7
- package/skills/_shared/always.md +4 -2
- package/skills/elice-content-check/SKILL.md +3 -1
- package/skills/elice-content-create/SKILL.md +5 -4
- package/skills/elice-content-migrate/SKILL.md +2 -2
- package/skills/elice-content-publish/SKILL.md +23 -0
- package/templates/_shared/lib/cdk-mock.d.ts +21 -3
- package/templates/_shared/lib/cdk-mock.js +241 -82
- package/templates/_shared/lib/elice-content.css +204 -0
- package/templates/_shared/lib/elice-content.d.ts +115 -6
- package/templates/_shared/lib/elice-content.js +656 -43
- package/templates/blank/README.md +19 -7
- package/templates/blank/completion.html +15 -0
- package/templates/blank/gitignore +1 -0
- package/templates/blank/metadata.json +11 -0
- package/templates/blank/package.json +13 -0
- package/templates/blank/screens/completion.js +7 -0
- package/templates/blank/screens/edit.js +3 -0
- package/templates/blank/screens/instructor.js +12 -5
- package/templates/blank/screens/learn.js +16 -11
- package/templates/blank/template.json +6 -0
- package/templates/quiz/README.md +41 -31
- package/templates/quiz/core/behaviors.d.ts +5 -0
- package/templates/quiz/core/behaviors.js +12 -0
- package/templates/quiz/core/editor.d.ts +12 -1
- package/templates/quiz/core/editor.js +28 -5
- package/templates/quiz/core/model.d.ts +41 -1
- package/templates/quiz/core/model.js +272 -5
- package/templates/quiz/gitignore +1 -0
- package/templates/quiz/metadata.json +11 -0
- package/templates/quiz/package.json +13 -0
- package/templates/quiz/screens/edit.js +176 -46
- package/templates/quiz/screens/instructor.js +18 -12
- package/templates/quiz/screens/learn.js +43 -38
- package/templates/quiz/styles.css +47 -0
- package/templates/quiz/template.json +6 -0
- package/templates/quiz/ui/templates/edit.d.ts +3 -0
- package/templates/quiz/ui/templates/edit.js +53 -14
- package/templates/quiz/ui/texts.js +56 -29
- package/templates/_shared/lib/cdk.js +0 -3
- package/templates/blank/content.json +0 -4
- package/templates/blank/elice.config.json +0 -12
- package/templates/quiz/content.json +0 -81
- package/templates/quiz/elice.config.json +0 -14
- package/templates/quiz/grading.json +0 -13
|
@@ -4,13 +4,14 @@ A Custom HTML learning material is **a small web app in one zip**. Anything that
|
|
|
4
4
|
|
|
5
5
|
Build it with the `ecdk` CLI (`@eliceio/cdk-cli`). Read one topic of this guide with `ecdk guide <topic>` (`ecdk guide` lists the topics). For a command's options, run `ecdk <command> --help`.
|
|
6
6
|
|
|
7
|
-
One zip has up to
|
|
7
|
+
One zip has up to four screens.
|
|
8
8
|
|
|
9
|
-
| Screen
|
|
10
|
-
|
|
|
11
|
-
| Student (required)
|
|
12
|
-
| Instructor (optional)
|
|
13
|
-
| Content edit (optional)
|
|
9
|
+
| Screen | Files | What it does |
|
|
10
|
+
| ---------------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| Student (required) | `index.html` + `screens/learn.js` | The learning activity (read, interact, solve, make). Submits a result when needed |
|
|
12
|
+
| Instructor (optional) | `instructor.html` + `screens/instructor.js` | What only instructors see: activity summary, explanations, teaching tips |
|
|
13
|
+
| 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) |
|
|
14
|
+
| Completion policy (optional) | `completion.html` + `screens/completion.js` | The instructor picks when the material counts as done, among `completionPolicies` (`screens.completionPolicy`). Off when the material lists one policy |
|
|
14
15
|
|
|
15
16
|
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.
|
|
16
17
|
|
|
@@ -20,7 +21,7 @@ The person (the instructor or author) is responsible for the content and its ans
|
|
|
20
21
|
|
|
21
22
|
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.
|
|
22
23
|
2. **Correct answers.** You may draft answers and rubrics, but the person confirms that they are right.
|
|
23
|
-
3. **
|
|
24
|
+
3. **How it completes and how it is graded**: which completion policies the material supports (`completionPolicies`, the first one is the default) and the grader. One policy fixes it; more than one lets the instructor pick on a completion policy screen. Propose what fits the material and get a confirmation.
|
|
24
25
|
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.
|
|
25
26
|
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.
|
|
26
27
|
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.
|
|
@@ -33,6 +34,7 @@ ecdk --version && ecdk doctor --json
|
|
|
33
34
|
```
|
|
34
35
|
|
|
35
36
|
- 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>`.
|
|
37
|
+
- `doctor` item `mcp.material` warns when the Elice material server MCP is not registered. It is used later to upload to LXP (the publish skill is not available yet), 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 mcp setup` registers the MCP only) and tell the user the login step it prints.
|
|
36
38
|
- Fix each `fail` item in `doctor` as its `fix.description` says. `--fix` fixes only the items that can be fixed automatically.
|
|
37
39
|
|
|
38
40
|
## 2. Design the material
|
|
@@ -42,48 +44,63 @@ Decide the following before writing code. Decide what the request leaves out to
|
|
|
42
44
|
**① What the student does**
|
|
43
45
|
Read or watch / change values and observe (simulation, visualization) / follow steps / solve problems / make something. Tie the activity directly to the learning goal.
|
|
44
46
|
|
|
45
|
-
**② Completion and grading** (
|
|
47
|
+
**② Completion policy and grading** (2026-11-11: the material lists the completion policies it supports in `completionPolicies` and the server sets the first one; the grading settings `settings.grading` hold the grader `type` and its answers)
|
|
46
48
|
|
|
47
|
-
| Material | type
|
|
48
|
-
| ----------------------------------------------------------- |
|
|
49
|
-
| Something to read or watch, such as a simulation | `on_access` (done on open)
|
|
50
|
-
| Done when the activity ends (results, self-check, survey) | `on_submit` (100 on submit)
|
|
51
|
-
| One correct answer or one set of answers | `
|
|
52
|
-
| Writing or assignments graded against a rubric (AI grading) | `rubric`
|
|
49
|
+
| Material | Completion policy | Grading (`type`) | Student screen |
|
|
50
|
+
| ----------------------------------------------------------- | --------------------------------- | ----------------------- | ----------------------------------------- |
|
|
51
|
+
| Something to read or watch, such as a simulation | `on_access` (done on open) | - | No submission |
|
|
52
|
+
| Done when the activity ends (results, self-check, survey) | `on_submit` (100 on submit) | - | Submit the result with `useSubmit` |
|
|
53
|
+
| One correct answer or one set of answers | `on_graded` (done when it passes) | `pattern` (one regex) | `useSubmit` |
|
|
54
|
+
| Writing or assignments graded against a rubric (AI grading) | `on_graded` | `rubric` (the criteria) | `useSubmit`, the score comes back at once |
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
- **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.
|
|
57
|
+
- **`completionPolicies` is required** in the project's `metadata.json` (a material without it, or with an empty list, fails `manifest.completion-policies-missing`): for example `"completionPolicies": ["on_submit"]`. The server sets the **first** value as the material's policy on upload. Put `on_graded` in it only when the edit screen saves the grading. The grader is not listed here: it is `settings.grading.type` (`pattern` · `rubric`), set on the edit screen.
|
|
58
|
+
- **One policy fixes it** (`["on_graded"]` in the quiz template; no completion policy screen). **More than one** lets the instructor pick among them on the **completion policy screen** (`screens.completionPolicy`, `app.useCompletion()`, which shows only the listed policies). That screen saves through `app.completion.set()` → SDK `saveCompletionPolicy` (`PATCH` `completion_policy`); it never touches `settings`, and the edit screen never sends a policy. The server rejects `on_graded` without `settings.grading` (`MATERIAL_GRADING_REQUIRED`). More than one policy without the screen warns `completion.no-screen`; one policy with the screen warns `completion.screen-unused`. The blank template lists `["on_submit", "on_access"]` with the screen.
|
|
59
|
+
- 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.
|
|
60
|
+
- 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.
|
|
55
61
|
|
|
56
62
|
**②-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 check` 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.
|
|
57
63
|
|
|
58
64
|
**③ 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.
|
|
59
65
|
|
|
60
|
-
**④ 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),
|
|
66
|
+
**④ 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).
|
|
61
67
|
|
|
62
|
-
**⑤ 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
|
|
68
|
+
**⑤ 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).
|
|
69
|
+
|
|
70
|
+
**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):
|
|
71
|
+
|
|
72
|
+
- 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**.
|
|
73
|
+
- 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.
|
|
74
|
+
- If the last step has its own action (submit, "결과 보기"), keep it in the content; the right pill still leads on to the next material.
|
|
75
|
+
- On a phone (narrower than 512px) the kit puts the buttons under the content instead of over its edges.
|
|
63
76
|
|
|
64
77
|
## 3. Create the project
|
|
65
78
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
|
69
|
-
|
|
|
70
|
-
| A
|
|
71
|
-
|
|
|
72
|
-
|
|
|
79
|
+
Run `ecdk create --list` first: it prints each template with its own version (`quiz@1.1.0`), what it is for, its screens and its completion policy. 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).
|
|
80
|
+
|
|
81
|
+
| Case | Start with |
|
|
82
|
+
| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
83
|
+
| 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; `"completionPolicies": ["on_graded"]` + `pattern`) |
|
|
84
|
+
| Any other material | `ecdk create <folder> --template blank` (skeleton of the three screens) |
|
|
85
|
+
| A dark screen | Add `--theme dark` to the above |
|
|
86
|
+
| 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 |
|
|
87
|
+
| An existing HTML page | [7. Move existing HTML](#7-move-existing-html) |
|
|
88
|
+
|
|
89
|
+
`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).
|
|
73
90
|
|
|
74
|
-
`
|
|
91
|
+
The project files: screens, `lib/` (the screen kit, copied as is), `metadata.json` (screens · `completionPolicies` · `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`.
|
|
75
92
|
|
|
76
93
|
Then:
|
|
77
94
|
|
|
78
|
-
1. Set `screens` in `
|
|
79
|
-
2.
|
|
95
|
+
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). Set `completionPolicies` too. In `ecdk dev`, saving in the content edit view writes the whole settings (content and answers) to `.ecdk/settings.json`, and the completion policy view writes `.ecdk/completion.json`; both stay out of the zip and out of `ecdk build` · `check`.
|
|
96
|
+
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.
|
|
80
97
|
3. Write the screen code ([5](#5-screen-code)). Delete the HTML and JS of screens you do not use.
|
|
81
98
|
4. Check ([9](#9-check)) → build ([10](#10-build)).
|
|
82
99
|
|
|
83
100
|
## 4. Rules
|
|
84
101
|
|
|
85
|
-
1. **Never put correct answers in the content**: not in
|
|
86
|
-
2. **Screen code calls only `lib/elice-content.js` (the kit).** Do not edit `lib/`. Do not call the SDK (`lib/cdk.js`) directly.
|
|
102
|
+
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).
|
|
103
|
+
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.
|
|
87
104
|
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.
|
|
88
105
|
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.
|
|
89
106
|
5. **Use relative paths** (`img/a.png`). Paths starting with `/` break. Match file name case. Prefer letters, digits, `-` and `_`.
|
|
@@ -100,7 +117,9 @@ import { start } from '../lib/elice-content.js';
|
|
|
100
117
|
|
|
101
118
|
// Student screen
|
|
102
119
|
const app = await start({ screen: 'learn' });
|
|
103
|
-
|
|
120
|
+
// Content is only what the edit screen saved (no default content file). Before that, show the kit's notice
|
|
121
|
+
if (app.hasContent) render(app.content);
|
|
122
|
+
else root.replaceChildren(app.emptyState());
|
|
104
123
|
|
|
105
124
|
// Only for materials with a submission: say how to collect and restore the answer (result).
|
|
106
125
|
// Locking, restoring and result messages are handled by the kit.
|
|
@@ -122,24 +141,50 @@ app.useSave({
|
|
|
122
141
|
});
|
|
123
142
|
```
|
|
124
143
|
|
|
125
|
-
|
|
144
|
+
```js
|
|
145
|
+
// Edit screen with the grader block: the kit draws LXP's grader radios, the "기준 답안 (정규표현식)" field
|
|
146
|
+
// with "작성 예시 보기", and the "평가 기준" field. useSave saves the content and the grader in one save.
|
|
147
|
+
const grading = app.useGradingBlock();
|
|
148
|
+
app.useSave({ getContent: () => app.content, getGrading: () => grading.getGrading() });
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
```js
|
|
152
|
+
// Completion policy screen (screens.completionPolicy): radios for the policies in completionPolicies and the save button.
|
|
153
|
+
// It saves through app.completion.set() → SDK saveCompletionPolicy (PATCH completion_policy), not settings.
|
|
154
|
+
const app = await start({ screen: 'completionPolicy' });
|
|
155
|
+
app.useCompletion();
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
- `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 and completion policy screens). `app.completion.get()` · `set(policy)` read and change the completion policy (`set` only on the completion policy screen and only within `completionPolicies`).
|
|
159
|
+
- With `on_graded` in `completionPolicies`, the edit screen must save the grading (`completion.no-grading` warns when its code never uses `useGradingBlock` · `getGrading` · `grading:`).
|
|
160
|
+
- Saving on the edit screen (`useSave`) **saves to the material at once** (SDK `saveSettings`, with the edit token LXP opens the edit screen with): a new version, shown on the student and instructor screens right away. The kit shows the result and the failure messages (the upload is not saved yet, someone saved in between, session expired), so the screen code does not announce "saved" itself.
|
|
126
161
|
- Materials without a submission (`on_access`) do not call `useSubmit`.
|
|
127
162
|
- 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.
|
|
163
|
+
- 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.
|
|
164
|
+
|
|
165
|
+
```js
|
|
166
|
+
app.usePaging({
|
|
167
|
+
count: steps.length,
|
|
168
|
+
// also called once at start. Draw only into `content` (#app by default); the kit keeps its buttons outside it
|
|
169
|
+
onChange: (i, { content }) => content.replaceChildren(renderStep(steps[i])),
|
|
170
|
+
});
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
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.
|
|
174
|
+
|
|
128
175
|
- Run simulations and animations with `requestAnimationFrame` and stop them while the view is hidden. Split heavy computation into small pieces.
|
|
129
176
|
|
|
130
177
|
## 6. Using the quiz template
|
|
131
178
|
|
|
179
|
+
- 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.
|
|
132
180
|
- 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.
|
|
133
|
-
- Student answer
|
|
134
|
-
- Answers (
|
|
181
|
+
- 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.
|
|
182
|
+
- 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 lists only `on_graded` (`"completionPolicies": ["on_graded"]`) and grades with `pattern`, so it has no completion policy screen and no hand-written regex. `pattern` compares the whole answer at once, so **everything must match for 100** (no partial score per question).
|
|
135
183
|
|
|
136
184
|
```json
|
|
137
185
|
{
|
|
138
186
|
"type": "pattern",
|
|
139
|
-
"
|
|
140
|
-
"answer_key": {
|
|
141
|
-
"answers": { "q1": "b", "q2": "a,d", "q3": "c,a,b", "q4": "weight", "q5": "g1:a|g2:b,c" }
|
|
142
|
-
}
|
|
187
|
+
"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$"
|
|
143
188
|
}
|
|
144
189
|
```
|
|
145
190
|
|
|
@@ -159,35 +204,45 @@ To mix a visualization or simulation into a quiz, edit the quiz template, or wri
|
|
|
159
204
|
3. Download external CDN scripts and fonts into the zip.
|
|
160
205
|
4. Replace blocked code (storage, `alert`, external sends) as in [4](#4-rules).
|
|
161
206
|
5. Merge multiple HTML pages into one HTML that switches views.
|
|
162
|
-
6. Decide completion and grading as in [2 ②](#2-design-the-material)
|
|
163
|
-
7.
|
|
207
|
+
6. Decide completion and grading as in [2 ②](#2-design-the-material). Without grading, pick `on_access` or `on_submit` and write it in `metadata.json` (`"completionPolicies": ["on_access"]` when there is no submission).
|
|
208
|
+
7. Turn off the instructor, edit and completion policy screens in `metadata.json` `screens` (`{ "enabled": false }`) and delete their files when they are not needed.
|
|
209
|
+
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`.
|
|
164
210
|
|
|
165
211
|
## 8. Fix check errors
|
|
166
212
|
|
|
167
213
|
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.
|
|
168
214
|
|
|
169
|
-
| id | Fix
|
|
170
|
-
| ---------------------------------------------- |
|
|
171
|
-
| `ref.missing` · `ref.case-mismatch` | Match the path and case to the real file
|
|
172
|
-
| `ref.root-absolute` | Change `/…` to a relative path
|
|
173
|
-
| `ref.external-script` · `ref.external-request` | Put the library or font in the zip and use a relative path
|
|
174
|
-
| `api.storage` · `api.cookie` | Do not use storage. Submit results; save content from the edit screen
|
|
175
|
-
| `api.dialog` · `api.window-open` · `html.form` | An in-page message · the same view · a button click + `useSubmit`
|
|
176
|
-
| `api.external-send` | Remove the external send
|
|
177
|
-
| `sec.html-injection` | Use `textContent`. If justified: escape + `ecdk-ignore` + the reason
|
|
178
|
-
| `sec.secret` · `file.secret` | Remove the secret or the answer file (if it was already uploaded, tell the user to **revoke the key**)
|
|
179
|
-
| `manifest
|
|
180
|
-
| `
|
|
215
|
+
| id | Fix |
|
|
216
|
+
| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
217
|
+
| `ref.missing` · `ref.case-mismatch` | Match the path and case to the real file |
|
|
218
|
+
| `ref.root-absolute` | Change `/…` to a relative path |
|
|
219
|
+
| `ref.external-script` · `ref.external-request` | Put the library or font in the zip and use a relative path |
|
|
220
|
+
| `api.storage` · `api.cookie` | Do not use storage. Submit results; save content from the edit screen |
|
|
221
|
+
| `api.dialog` · `api.window-open` · `html.form` | An in-page message · the same view · a button click + `useSubmit` |
|
|
222
|
+
| `api.external-send` | Remove the external send |
|
|
223
|
+
| `sec.html-injection` | Use `textContent`. If justified: escape + `ecdk-ignore` + the reason |
|
|
224
|
+
| `sec.secret` · `file.secret` | Remove the secret or the answer file (if it was already uploaded, tell the user to **revoke the key**) |
|
|
225
|
+
| `manifest.completion-policies-missing` (error) | Add `"completionPolicies": ["on_submit"]` (or the policies you chose, default first) to `metadata.json` |
|
|
226
|
+
| `completion.no-screen` (warn) | Turn on the completion policy screen (`screens.completionPolicy`), or keep only one policy |
|
|
227
|
+
| `completion.screen-unused` (warn) | One policy is fixed: remove the completion policy screen, or list more policies |
|
|
228
|
+
| `completion.no-edit` (error) | `on_graded` needs an edit screen to set the answers: turn on `screens.edit`, or pick `on_submit` · `on_access` |
|
|
229
|
+
| `completion.no-grading` (warn) | Add `app.useGradingBlock()` to the edit screen and pass `getGrading` to `useSave` |
|
|
230
|
+
| `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 |
|
|
231
|
+
| `sdk.outdated` (error) | The SDK in the zip is older than the minimum: `npm update @eliceio/cdk` (an old `lib/cdk.js` copy: `ecdk doctor --fix && npm install`), then build again |
|
|
232
|
+
| `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` |
|
|
233
|
+
| `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"` |
|
|
234
|
+
| `manifest.*` · `entry.*` | Check `screens` and `kind` in `metadata.json` |
|
|
235
|
+
| `limit.*` · `file.large-image` | Shrink images and video, drop unused files (build output: "files not referenced anywhere") |
|
|
181
236
|
|
|
182
237
|
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.
|
|
183
238
|
|
|
184
239
|
## 9. Check
|
|
185
240
|
|
|
186
241
|
```bash
|
|
187
|
-
ecdk dev # http://localhost:4170: student, tutoring, instructor, content edit; desktop and mobile widths
|
|
242
|
+
ecdk dev # http://localhost:4170: student, tutoring, instructor, content edit, completion policy (when on); desktop and mobile widths
|
|
188
243
|
```
|
|
189
244
|
|
|
190
|
-
- 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 →
|
|
245
|
+
- 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, changing the policy in the completion policy view (when on), the mobile width, and the dark theme. Without one, ask the user to check in this order.
|
|
191
246
|
- Even after your own check, the person looks at the screens before uploading (see [0. What the person decides](#0-what-the-person-decides)).
|
|
192
247
|
- Fix the content console errors and 404s printed in the terminal.
|
|
193
248
|
- Opening files directly with `file://` is not a check.
|
|
@@ -198,10 +253,50 @@ ecdk dev # http://localhost:4170: student, tutoring, instructor, conten
|
|
|
198
253
|
ecdk build --json
|
|
199
254
|
```
|
|
200
255
|
|
|
201
|
-
- With `ok: true` the zip is `dist/content.zip`. To make it smaller, set `"minify": true` in `
|
|
202
|
-
- Report to the user: what the material is (what the student does, which screens are on, how it completes), the zip path and size, **
|
|
256
|
+
- 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).
|
|
257
|
+
- Report to the user: what the material is (what the student does, which screens are on, how it completes), the zip path and size, **how it completes and what to pick in the settings tab** (the completion policy and 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](#0-what-the-person-decides)).
|
|
203
258
|
|
|
204
259
|
## 11. More
|
|
205
260
|
|
|
206
261
|
- CLI usage: the `@eliceio/cdk-cli` README
|
|
207
262
|
- Command help: `ecdk <command> --help`
|
|
263
|
+
|
|
264
|
+
## 12. Upload with the material MCP
|
|
265
|
+
|
|
266
|
+
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 mcp setup --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`.
|
|
267
|
+
|
|
268
|
+
**Order**
|
|
269
|
+
|
|
270
|
+
| Step | Tool or command | Notes |
|
|
271
|
+
| ------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
272
|
+
| Build | `ecdk build --json` | `ok: true` required. Use `zip` and `zipBytes` |
|
|
273
|
+
| 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 |
|
|
274
|
+
| New page (optional) | `create_custom_page` (`org`, `lecture_id`) | Ask first. 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 |
|
|
275
|
+
| Current version | `get_material` | Keep `current_version.id` (null for a page never saved) |
|
|
276
|
+
| Upload URL | `create_package_upload` (`size_bytes`) | At most 20 MB. Returns `key` and `curl_command` |
|
|
277
|
+
| Upload | the `curl_command`, `package.zip` replaced by the zip path | From a desktop app, run it through a login shell (see Always) |
|
|
278
|
+
| Draft | `submit_package` (`key`) → `get_draft` every 2–3 s | `ready`: shows `preview_urls`, `warnings`, the package metadata. `failed`: report `failure` with `ecdk check dist/content.zip` and stop |
|
|
279
|
+
| Approve | — | Show page, title, completion policy, answers saved or not, `preview_urls`. Saving is visible to learners at once when the page is open |
|
|
280
|
+
| Save | `save_draft` (`material_draft_id`, `expected_current_version_id`, `completion_policy`) | See below (no content or `grading` from the project). `MATERIAL_CHANGED`: someone saved after your `get_material`; do not retry blindly, tell the person |
|
|
281
|
+
| 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 |
|
|
282
|
+
|
|
283
|
+
After a successful save, write `.ecdk/link.json` in the project (it is not put in the zip; add `.ecdk/` to `.gitignore`):
|
|
284
|
+
|
|
285
|
+
```json
|
|
286
|
+
{ "org": "trial-cdk-qa5", "lecture_page_id": 129, "version_id": "…" }
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Next time, read it, confirm the page with the person, and compare `version_id` with `get_material`'s `current_version.id`: if they differ, someone saved in LXP since — tell the person before uploading.
|
|
290
|
+
|
|
291
|
+
**Completion policy and answers**
|
|
292
|
+
|
|
293
|
+
- `completion_policy`: `on_access` (complete on open), `on_submit` (complete on any submission) or `on_graded` (complete when the grading passes). Pass the first value of `completionPolicies` on the first `save_draft` (the server will also read it from `metadata.json`, G132; until then a first version without it gets `on_access`), and later versions keep the current policy unless you pass one. Pass it on `save_draft`, not afterwards, so learners never complete the page under the wrong policy.
|
|
294
|
+
- 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 and enter the content and answers (`settings`, with `settings.grading` for `on_graded`). Answers never go into the zip.
|
|
295
|
+
- A quiz (`on_graded`) has no answers at its first upload. Whether the server accepts `on_graded` without grading is undecided (G132): if `save_draft` returns `MATERIAL_GRADING_REQUIRED`, stop and tell the person. Either way, the person sets the answers on the edit screen right after the upload.
|
|
296
|
+
- The quiz template is `on_graded` with a pattern; other materials follow the design (②).
|
|
297
|
+
|
|
298
|
+
**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.
|
|
299
|
+
|
|
300
|
+
**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.
|
|
301
|
+
|
|
302
|
+
**After saving**: report the LXP URL of the page and that 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.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eliceio/cdk-cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.4",
|
|
4
4
|
"description": "교육자용 Custom HTML 콘텐츠 CLI",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"rollup": "^4.0.0",
|
|
42
42
|
"tslib": "^2.6.1",
|
|
43
43
|
"typescript": "~5.9.3",
|
|
44
|
-
"@eliceio/cdk": "^1.0.0-alpha.
|
|
44
|
+
"@eliceio/cdk": "^1.0.0-alpha.3"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
|
-
"prebuild": "del-cli \"buildcache/*\" \"es/*\"
|
|
47
|
+
"prebuild": "del-cli \"buildcache/*\" \"es/*\"",
|
|
48
48
|
"build": "cross-env NODE_ENV=production rollup -c ./rollup.config.ts --configPlugin typescript -f es",
|
|
49
49
|
"lint": "eslint src --max-warnings=0",
|
|
50
50
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
package/rules.json
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.7.0",
|
|
3
3
|
"manifest": {
|
|
4
4
|
"file": "metadata.json",
|
|
5
5
|
"kinds": ["material", "description"],
|
|
6
6
|
"defaultKind": "material",
|
|
7
|
-
"modes": ["learn", "instructor", "edit"],
|
|
7
|
+
"modes": ["learn", "instructor", "edit", "completionPolicy"],
|
|
8
8
|
"required": ["learn"],
|
|
9
9
|
"kindModes": {
|
|
10
|
-
"material": ["learn", "instructor", "edit"],
|
|
10
|
+
"material": ["learn", "instructor", "edit", "completionPolicy"],
|
|
11
11
|
"description": ["learn"]
|
|
12
12
|
},
|
|
13
|
-
"
|
|
13
|
+
"completionPolicies": ["on_access", "on_submit", "on_graded"],
|
|
14
|
+
"graderTypes": ["pattern", "rubric"],
|
|
14
15
|
"commentaryFile": "commentary.txt",
|
|
15
16
|
"defaultEntry": "index.html"
|
|
16
17
|
},
|
|
18
|
+
"minVersions": {
|
|
19
|
+
"sdk": "1.0.0-alpha.3"
|
|
20
|
+
},
|
|
17
21
|
"limits": {
|
|
18
22
|
"maxZipBytes": 20971520,
|
|
19
23
|
"maxUnpackedBytes": 209715200,
|
|
@@ -70,7 +74,7 @@
|
|
|
70
74
|
"dev": {
|
|
71
75
|
"level": "error",
|
|
72
76
|
"files": [],
|
|
73
|
-
"dirs": [".git", "node_modules"]
|
|
77
|
+
"dirs": [".git", "node_modules", ".ecdk"]
|
|
74
78
|
},
|
|
75
79
|
"junk": {
|
|
76
80
|
"level": "warn",
|
|
@@ -358,6 +362,18 @@
|
|
|
358
362
|
"scope": "server",
|
|
359
363
|
"title": "학습 참고 내용 파일(commentary.txt) 없음 (LXP 업로드가 거절함)"
|
|
360
364
|
},
|
|
365
|
+
{
|
|
366
|
+
"id": "manifest.grading-types",
|
|
367
|
+
"level": "warn",
|
|
368
|
+
"scope": "server",
|
|
369
|
+
"title": "쓰지 않는 gradingTypes (완료 정책은 completionPolicies · 완료 정책 화면, 채점 방식은 편집 화면)"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"id": "manifest.completion-policies-missing",
|
|
373
|
+
"level": "error",
|
|
374
|
+
"scope": "server",
|
|
375
|
+
"title": "자료 본문인데 completionPolicies(지원하는 완료 정책)가 없거나 비어 있음"
|
|
376
|
+
},
|
|
361
377
|
{
|
|
362
378
|
"id": "entry.missing",
|
|
363
379
|
"level": "error",
|
|
@@ -467,10 +483,10 @@
|
|
|
467
483
|
"title": "학생에게 내려가는 JSON에 정답처럼 보이는 키"
|
|
468
484
|
},
|
|
469
485
|
{
|
|
470
|
-
"id": "
|
|
486
|
+
"id": "completion.no-submit",
|
|
471
487
|
"level": "warn",
|
|
472
488
|
"scope": "client",
|
|
473
|
-
"title": "
|
|
489
|
+
"title": "제출 · 채점으로 완료하는데 화면 코드에 제출이 없음"
|
|
474
490
|
},
|
|
475
491
|
{
|
|
476
492
|
"id": "edit.no-save",
|
|
@@ -478,6 +494,48 @@
|
|
|
478
494
|
"scope": "client",
|
|
479
495
|
"title": "편집 화면인데 저장이 없음"
|
|
480
496
|
},
|
|
497
|
+
{
|
|
498
|
+
"id": "completion.no-save",
|
|
499
|
+
"level": "warn",
|
|
500
|
+
"scope": "client",
|
|
501
|
+
"title": "완료 정책 화면인데 저장(useCompletion · saveCompletionPolicy)이 없음"
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
"id": "completion.no-screen",
|
|
505
|
+
"level": "warn",
|
|
506
|
+
"scope": "client",
|
|
507
|
+
"title": "완료 정책이 여럿인데 완료 정책 화면(completionPolicy)이 없어 첫 값만 쓰임"
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
"id": "completion.screen-unused",
|
|
511
|
+
"level": "warn",
|
|
512
|
+
"scope": "client",
|
|
513
|
+
"title": "완료 정책이 하나(고정)인데 완료 정책 화면(completionPolicy)이 켜져 있음"
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
"id": "completion.no-edit",
|
|
517
|
+
"level": "error",
|
|
518
|
+
"scope": "server",
|
|
519
|
+
"title": "채점(on_graded)으로 완료하는데 채점 방식 · 답을 정할 편집 화면이 없음"
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
"id": "completion.no-grading",
|
|
523
|
+
"level": "warn",
|
|
524
|
+
"scope": "client",
|
|
525
|
+
"title": "채점(on_graded)으로 완료하는데 편집 화면 코드가 채점 설정(getGrading · useGradingBlock)을 저장하지 않음"
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
"id": "project.legacy-file",
|
|
529
|
+
"level": "warn",
|
|
530
|
+
"scope": "client",
|
|
531
|
+
"title": "더 쓰지 않는 프로젝트 파일(elice.config.json · content.json · grading.json)이 남아 있음 (프로젝트 검사만, ADR 0011)"
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"id": "build.template-unknown",
|
|
535
|
+
"level": "warn",
|
|
536
|
+
"scope": "client",
|
|
537
|
+
"title": "metadata.json build.template이 이 ecdk가 모르는 템플릿이거나 더 새 템플릿 버전"
|
|
538
|
+
},
|
|
481
539
|
{
|
|
482
540
|
"id": "ref.missing",
|
|
483
541
|
"level": "error",
|
|
@@ -603,6 +661,18 @@
|
|
|
603
661
|
"level": "warn",
|
|
604
662
|
"scope": "client",
|
|
605
663
|
"title": "postMessage 대상 *"
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
"id": "sdk.outdated",
|
|
667
|
+
"level": "error",
|
|
668
|
+
"scope": "client",
|
|
669
|
+
"title": "SDK가 최소 버전보다 낮음 (metadata.json build.sdk < rules.json minVersions.sdk, npm update @eliceio/cdk)"
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
"id": "sdk.lib-copy",
|
|
673
|
+
"level": "warn",
|
|
674
|
+
"scope": "client",
|
|
675
|
+
"title": "옛 lib/cdk.js 복사본 (package.json에 @eliceio/cdk가 없음, 프로젝트 검사만. SDK를 package.json 의존성으로 옮기기)"
|
|
606
676
|
}
|
|
607
677
|
]
|
|
608
678
|
}
|
package/skills/_shared/always.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
## Always
|
|
2
2
|
|
|
3
|
-
- Never put correct answers in the content zip.
|
|
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 check` / `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`.
|
|
6
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, `ecdk guide 2`), never a look-alike bottom 이전 · 다음 bar.
|
|
7
9
|
- Answer the person in their language. The guide is in English.
|
|
@@ -16,7 +16,9 @@ The full guide ships with the CLI: `ecdk guide 8` (fix check errors), `ecdk guid
|
|
|
16
16
|
3. **Problems that show only in LXP.**
|
|
17
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 check dist/content.zip`. Ask the person for the browser console error.
|
|
18
18
|
- Upload rejected: check `ecdk check dist/content.zip`; a material needs `commentary.txt` and every file named in `metadata.json`.
|
|
19
|
-
-
|
|
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 `completionPolicies` (its first value is the default; the completion policy view writes `.ecdk/completion.json`) and that the submitted answer string matches the regex (`ecdk guide 2`, `ecdk guide 6`).
|
|
21
|
+
- `@eliceio/cdk 패키지를 찾지 못했습니다` or doctor `project.deps` fails: run `npm install` in the project. `sdk.outdated`: `npm update @eliceio/cdk` (on an old `lib/cdk.js` copy: `ecdk doctor --fix && npm install`), then build again.
|
|
20
22
|
4. **Confirm.** `ecdk check` has no errors, `ecdk dev` works, and `ecdk build --json` returns `ok: true`. Tell the person what caused it and what you changed.
|
|
21
23
|
|
|
22
24
|
{{version}}
|
|
@@ -11,11 +11,12 @@ The full guide ships with the CLI. Read only the topics you need: `ecdk guide` l
|
|
|
11
11
|
|
|
12
12
|
## Steps
|
|
13
13
|
|
|
14
|
-
1. **Design before code.** Read `ecdk guide 0` (what the person decides) and `ecdk guide 2`. Decide ① what the student does, ② completion and grading (`
|
|
15
|
-
2. **Environment and project.** `ecdk --version && ecdk doctor --json` (`ecdk guide 1`), then `ecdk create
|
|
16
|
-
3. **Write.**
|
|
14
|
+
1. **Design before code.** Read `ecdk guide 0` (what the person decides) and `ecdk guide 2`. Decide ① what the student does, ② the completion policies and the grading (`on_access` · `on_submit` · `on_graded` with grading `type` `pattern` or `rubric`), written as the required `completionPolicies` in the project's `metadata.json` with the default first; one policy fixes it, more than one needs a completion policy screen where the instructor picks; the quiz template fixes `["on_graded"]`, so do not ask for a quiz, ③ 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` (`ecdk guide 1`), then `ecdk create --list` to pick a template and `ecdk create <folder> --template <name>` (`ecdk guide 3`; 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 (`ecdk guide 5`; the quiz template: `ecdk guide 6`), 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).
|
|
17
18
|
4. **Check.** `ecdk check`, fix errors (`ecdk guide 8`), then `ecdk dev` and go through the screens (`ecdk guide 9`). The person looks at the screens too.
|
|
18
19
|
5. **Build and report.** `ecdk build --json` must return `ok: true`. Report as `ecdk guide 10` says.
|
|
19
|
-
6. **Upload** only after the person approves
|
|
20
|
+
6. **Upload** only after the person approves: the elice-content-publish skill (`ecdk guide 12`), or the person uploads `dist/content.zip` in LXP. Then the person enters the content and answers in the LXP edit screen.
|
|
20
21
|
|
|
21
22
|
{{version}}
|
|
@@ -13,8 +13,8 @@ The full guide ships with the CLI: `ecdk guide` lists the topics, `ecdk guide <t
|
|
|
13
13
|
|
|
14
14
|
1. **Read** `ecdk guide 7` (move existing HTML) and `ecdk guide 4` (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 `ecdk guide 7` says, keep the original files as they are where possible, and write `commentary.txt`.
|
|
17
|
-
4. **Completion and grading.** Decide
|
|
16
|
+
3. **Wrap it.** Make or reuse an ecdk project as `ecdk guide 7` 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. **Completion and grading.** Decide how it completes (`ecdk guide 2`) and write the required `completionPolicies` in `metadata.json`, default first (`["on_access"]` without a submission). When it grades, set the grader and the answers on the edit screen (`app.useGradingBlock()`); list more than one policy and add a completion policy screen only when the instructor should pick the policy. 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
18
|
5. **Check.** `ecdk check`, fix errors (`ecdk guide 8`), `ecdk dev`, compare with the original.
|
|
19
19
|
6. **Build and report.** `ecdk build --json` returns `ok: true`; report what changed from the original (`ecdk guide 10`).
|
|
20
20
|
|