@eliceio/cdk-cli 0.1.0-alpha.2 → 0.1.0-alpha.3
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 +158 -138
- package/es/cli.js +88 -33
- package/es/commands/build/index.d.ts +1 -1
- package/es/commands/build/index.js +16 -6
- package/es/commands/check/index.d.ts +8 -2
- package/es/commands/check/index.js +45 -5
- package/es/commands/create/index.d.ts +2 -0
- package/es/commands/create/index.js +28 -3
- package/es/commands/create/scaffold.d.ts +2 -0
- package/es/commands/create/scaffold.js +10 -6
- package/es/commands/dev/index.d.ts +1 -1
- package/es/commands/dev/index.js +6 -2
- package/es/commands/doctor/index.d.ts +11 -0
- package/es/commands/doctor/index.js +155 -26
- 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/config.d.ts +63 -19
- package/es/core/config.js +108 -32
- package/es/core/prepare.js +3 -5
- package/es/core/project-check.d.ts +15 -0
- package/es/core/project-check.js +26 -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 +33 -33
- package/es/dev/mock-api.d.ts +20 -4
- package/es/dev/mock-api.js +70 -9
- package/es/dev/server.d.ts +7 -0
- package/es/dev/server.js +84 -23
- package/es/rules/check.js +56 -7
- 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 +27 -6
- package/es/rules.json.js +1 -1
- package/guides/content-development.md +136 -49
- package/package.json +2 -2
- package/rules.json +62 -7
- package/skills/_shared/always.md +3 -1
- package/skills/elice-content-check/SKILL.md +1 -1
- package/skills/elice-content-create/SKILL.md +4 -4
- package/skills/elice-content-migrate/SKILL.md +1 -1
- package/skills/elice-content-publish/SKILL.md +22 -0
- package/templates/_shared/lib/cdk-mock.d.ts +21 -3
- package/templates/_shared/lib/cdk-mock.js +239 -80
- package/templates/_shared/lib/cdk.js +2 -2
- package/templates/_shared/lib/elice-content.css +196 -0
- package/templates/_shared/lib/elice-content.d.ts +110 -5
- package/templates/_shared/lib/elice-content.js +643 -38
- package/templates/blank/README.md +12 -3
- package/templates/blank/completion.html +15 -0
- package/templates/blank/elice.config.json +3 -5
- package/templates/blank/gitignore +1 -0
- package/templates/blank/screens/completion.js +7 -0
- package/templates/blank/screens/edit.js +3 -0
- package/templates/blank/template.json +6 -0
- package/templates/quiz/README.md +35 -28
- package/templates/quiz/content.json +17 -63
- package/templates/quiz/core/behaviors.d.ts +5 -0
- package/templates/quiz/core/behaviors.js +12 -0
- package/templates/quiz/core/model.d.ts +27 -1
- package/templates/quiz/core/model.js +199 -4
- package/templates/quiz/elice.config.json +1 -6
- package/templates/quiz/gitignore +1 -0
- package/templates/quiz/grading.json +1 -10
- package/templates/quiz/screens/edit.js +105 -31
- package/templates/quiz/screens/learn.js +7 -8
- package/templates/quiz/template.json +6 -0
- package/templates/quiz/ui/templates/edit.d.ts +2 -0
- package/templates/quiz/ui/templates/edit.js +16 -9
- package/templates/quiz/ui/texts.js +52 -27
|
@@ -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,16 +44,20 @@ 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 `elice.config.json` (copied into `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` · `content.json` · code). The old `gradingTypes` field is gone (2026-11-10): `ecdk build` warns when it is still in `elice.config.json`. A `grading.json` 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
|
|
|
@@ -59,30 +65,39 @@ Custom HTML does not use manual grading (`manual`) or no grading (`none`); setti
|
|
|
59
65
|
|
|
60
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), collect them in `content.json` and let the edit screen change them. Turn it off when there is nothing to edit.
|
|
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.0.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 `elice.config.json` (`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 multi-question quiz | `ecdk create <folder>` (quiz template: starts with one single-choice question; the edit screen adds any of the five question types; 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 `elice.config.json` to `{ "kind": "description", "screens": { "learn": "index.html" } }`, delete the instructor and edit files |
|
|
87
|
+
| An existing HTML page | [7. Move existing HTML](#7-move-existing-html) |
|
|
73
88
|
|
|
74
89
|
`create` refuses a folder that is not empty. Use a new subfolder.
|
|
75
90
|
|
|
76
91
|
Then:
|
|
77
92
|
|
|
78
|
-
1. Set `screens` in `elice.config.json` to the design (only the screens you keep: `{ "learn": "index.html", "edit": "edit.html" }`)
|
|
93
|
+
1. Set `screens` in `elice.config.json` to the design (only the screens you keep: `{ "learn": "index.html", "edit": "edit.html", "completionPolicy": "completion.html" }`). Set `completionPolicies` too. Local grading reads `grading.json` (`{ "type": "pattern", "answer_key": "^…$" }`) and the local completion policy `.ecdk/completion.json`; saving in the content edit and completion policy views of `ecdk dev` writes them for you.
|
|
79
94
|
2. Shape `content.json` as the data in ④.
|
|
80
95
|
3. Write the screen code ([5](#5-screen-code)). Delete the HTML and JS of screens you do not use.
|
|
81
96
|
4. Check ([9](#9-check)) → build ([10](#10-build)).
|
|
82
97
|
|
|
83
98
|
## 4. Rules
|
|
84
99
|
|
|
85
|
-
1. **Never put correct answers in the content**: not in `content.json`, the screen code, or comments. They reach the student's browser. Answers go in the
|
|
100
|
+
1. **Never put correct answers in the content**: not in `content.json`, the screen code, or comments. They reach the student's browser. Answers go in `settings.grading` through the edit screen (the server never sends it to students), and in `grading.json` only for local checks (it is left out of the zip).
|
|
86
101
|
2. **Screen code calls only `lib/elice-content.js` (the kit).** Do not edit `lib/`. Do not call the SDK (`lib/cdk.js`) directly.
|
|
87
102
|
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
103
|
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.
|
|
@@ -122,24 +137,50 @@ app.useSave({
|
|
|
122
137
|
});
|
|
123
138
|
```
|
|
124
139
|
|
|
125
|
-
|
|
140
|
+
```js
|
|
141
|
+
// Edit screen with the grader block: the kit draws LXP's grader radios, the "기준 답안 (정규표현식)" field
|
|
142
|
+
// with "작성 예시 보기", and the "평가 기준" field. useSave saves the content and the grader in one save.
|
|
143
|
+
const grading = app.useGradingBlock();
|
|
144
|
+
app.useSave({ getContent: () => app.content, getGrading: () => grading.getGrading() });
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
```js
|
|
148
|
+
// Completion policy screen (screens.completionPolicy): radios for the policies in completionPolicies and the save button.
|
|
149
|
+
// It saves through app.completion.set() → SDK saveCompletionPolicy (PATCH completion_policy), not settings.
|
|
150
|
+
const app = await start({ screen: 'completionPolicy' });
|
|
151
|
+
app.useCompletion();
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
- `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`).
|
|
155
|
+
- With `on_graded` in `completionPolicies`, the edit screen must save the grading (`completion.no-grading` warns when its code never uses `useGradingBlock` · `getGrading` · `grading:`).
|
|
156
|
+
- 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
157
|
- Materials without a submission (`on_access`) do not call `useSubmit`.
|
|
127
158
|
- 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.
|
|
159
|
+
- 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.
|
|
160
|
+
|
|
161
|
+
```js
|
|
162
|
+
app.usePaging({
|
|
163
|
+
count: steps.length,
|
|
164
|
+
// also called once at start. Draw only into `content` (#app by default); the kit keeps its buttons outside it
|
|
165
|
+
onChange: (i, { content }) => content.replaceChildren(renderStep(steps[i])),
|
|
166
|
+
});
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
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.
|
|
170
|
+
|
|
128
171
|
- Run simulations and animations with `requestAnimationFrame` and stop them while the view is hidden. Split heavy computation into small pieces.
|
|
129
172
|
|
|
130
173
|
## 6. Using the quiz template
|
|
131
174
|
|
|
175
|
+
- The template starts with **one single-choice question** (`content.json`) and its answer in `grading.json` (`^q1=b$`). Replace it with the requested questions; any of the five types can be added from the edit screen ("문항 추가"). Write the questions into `content.json` and set the answers on the edit screen or in `grading.json` with the same regex rules.
|
|
132
176
|
- 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
|
|
177
|
+
- 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.
|
|
178
|
+
- Answers: the instructor picks the answer in each question card of the edit screen (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 (`grading.json` holds the same for local checks). 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
179
|
|
|
136
180
|
```json
|
|
137
181
|
{
|
|
138
182
|
"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
|
-
}
|
|
183
|
+
"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
184
|
}
|
|
144
185
|
```
|
|
145
186
|
|
|
@@ -159,35 +200,42 @@ To mix a visualization or simulation into a quiz, edit the quiz template, or wri
|
|
|
159
200
|
3. Download external CDN scripts and fonts into the zip.
|
|
160
201
|
4. Replace blocked code (storage, `alert`, external sends) as in [4](#4-rules).
|
|
161
202
|
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. Remove the instructor and
|
|
203
|
+
6. Decide completion and grading as in [2 ②](#2-design-the-material). Without grading, pick `on_access` or `on_submit` and write it in `elice.config.json` (`"completionPolicies": ["on_access"]` when there is no submission).
|
|
204
|
+
7. Remove the instructor, edit and completion policy screens from `screens` and delete their files when they are not needed.
|
|
164
205
|
|
|
165
206
|
## 8. Fix check errors
|
|
166
207
|
|
|
167
208
|
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
209
|
|
|
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
|
-
| `
|
|
210
|
+
| id | Fix |
|
|
211
|
+
| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
212
|
+
| `ref.missing` · `ref.case-mismatch` | Match the path and case to the real file |
|
|
213
|
+
| `ref.root-absolute` | Change `/…` to a relative path |
|
|
214
|
+
| `ref.external-script` · `ref.external-request` | Put the library or font in the zip and use a relative path |
|
|
215
|
+
| `api.storage` · `api.cookie` | Do not use storage. Submit results; save content from the edit screen |
|
|
216
|
+
| `api.dialog` · `api.window-open` · `html.form` | An in-page message · the same view · a button click + `useSubmit` |
|
|
217
|
+
| `api.external-send` | Remove the external send |
|
|
218
|
+
| `sec.html-injection` | Use `textContent`. If justified: escape + `ecdk-ignore` + the reason |
|
|
219
|
+
| `sec.secret` · `file.secret` | Remove the secret or the answer file (if it was already uploaded, tell the user to **revoke the key**) |
|
|
220
|
+
| `manifest.completion-policies-missing` (error) | Add `"completionPolicies": ["on_submit"]` (or the policies you chose, default first) to `elice.config.json` |
|
|
221
|
+
| `completion.no-screen` (warn) | Turn on the completion policy screen (`screens.completionPolicy`), or keep only one policy |
|
|
222
|
+
| `completion.screen-unused` (warn) | One policy is fixed: remove the completion policy screen, or list more policies |
|
|
223
|
+
| `completion.no-edit` (error) | `on_graded` needs an edit screen to set the answers: turn on `screens.edit`, or pick `on_submit` · `on_access` |
|
|
224
|
+
| `completion.no-grading` (warn) | Add `app.useGradingBlock()` to the edit screen and pass `getGrading` to `useSave` |
|
|
225
|
+
| `grading.missing` (warn, project only) | Save the answers in the `ecdk dev` content edit view (writes `grading.json`) |
|
|
226
|
+
| `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 `elice.config.json` |
|
|
227
|
+
| `manifest.*` · `entry.*` | Check `screens` and `kind` in `elice.config.json` |
|
|
228
|
+
| `limit.*` · `file.large-image` | Shrink images and video, drop unused files (build output: "files not referenced anywhere") |
|
|
181
229
|
|
|
182
230
|
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
231
|
|
|
184
232
|
## 9. Check
|
|
185
233
|
|
|
186
234
|
```bash
|
|
187
|
-
ecdk dev # http://localhost:4170: student, tutoring, instructor, content edit; desktop and mobile widths
|
|
235
|
+
ecdk dev # http://localhost:4170: student, tutoring, instructor, content edit, completion policy (when on); desktop and mobile widths
|
|
188
236
|
```
|
|
189
237
|
|
|
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 →
|
|
238
|
+
- 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
239
|
- 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
240
|
- Fix the content console errors and 404s printed in the terminal.
|
|
193
241
|
- Opening files directly with `file://` is not a check.
|
|
@@ -199,9 +247,48 @@ ecdk build --json
|
|
|
199
247
|
```
|
|
200
248
|
|
|
201
249
|
- With `ok: true` the zip is `dist/content.zip`. To make it smaller, set `"minify": true` in `elice.config.json` (quiz template about 122 KB → 87 KB).
|
|
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, **
|
|
250
|
+
- 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
251
|
|
|
204
252
|
## 11. More
|
|
205
253
|
|
|
206
254
|
- CLI usage: the `@eliceio/cdk-cli` README
|
|
207
255
|
- Command help: `ecdk <command> --help`
|
|
256
|
+
|
|
257
|
+
## 12. Upload with the material MCP
|
|
258
|
+
|
|
259
|
+
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`.
|
|
260
|
+
|
|
261
|
+
**Order**
|
|
262
|
+
|
|
263
|
+
| Step | Tool or command | Notes |
|
|
264
|
+
| ------------------- | ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
265
|
+
| Build | `ecdk build --json` | `ok: true` required. Use `zip` and `zipBytes` |
|
|
266
|
+
| 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 |
|
|
267
|
+
| 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 |
|
|
268
|
+
| Current version | `get_material` | Keep `current_version.id` (null for a page never saved) |
|
|
269
|
+
| Upload URL | `create_package_upload` (`size_bytes`) | At most 20 MB. Returns `key` and `curl_command` |
|
|
270
|
+
| Upload | the `curl_command`, `package.zip` replaced by the zip path | From a desktop app, run it through a login shell (see Always) |
|
|
271
|
+
| 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 |
|
|
272
|
+
| Approve | — | Show page, title, completion policy, answers saved or not, `preview_urls`. Saving is visible to learners at once when the page is open |
|
|
273
|
+
| Save | `save_draft` (`material_draft_id`, `expected_current_version_id`, `completion_policy`, `grading`) | See below. `MATERIAL_CHANGED`: someone saved after your `get_material`; do not retry blindly, tell the person |
|
|
274
|
+
| 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 |
|
|
275
|
+
|
|
276
|
+
After a successful save, write `.ecdk/link.json` in the project (it is not put in the zip; add `.ecdk/` to `.gitignore`):
|
|
277
|
+
|
|
278
|
+
```json
|
|
279
|
+
{ "org": "trial-cdk-qa5", "lecture_page_id": 129, "version_id": "…" }
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
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.
|
|
283
|
+
|
|
284
|
+
**Completion policy and answers**
|
|
285
|
+
|
|
286
|
+
- `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. `on_graded` needs `grading`.
|
|
287
|
+
- `on_graded` needs `grading`: `{ "type": "pattern", "answer_key": "^…$" }` or `{ "type": "rubric", "rubric": "…" }`. Take it from `grading.json` only after the person confirms the answers. The server merges it into `settings.grading` and does not send it to learners. Answers never go into the zip.
|
|
288
|
+
- The quiz template is `on_graded` with a pattern; other materials follow the design (②).
|
|
289
|
+
|
|
290
|
+
**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.
|
|
291
|
+
|
|
292
|
+
**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.
|
|
293
|
+
|
|
294
|
+
**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.3",
|
|
4
4
|
"description": "교육자용 Custom HTML 콘텐츠 CLI",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -41,7 +41,7 @@
|
|
|
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
47
|
"prebuild": "del-cli \"buildcache/*\" \"es/*\" && node ../../scripts/copy-cdk.mjs",
|
package/rules.json
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.5.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
|
},
|
|
@@ -70,7 +71,7 @@
|
|
|
70
71
|
"dev": {
|
|
71
72
|
"level": "error",
|
|
72
73
|
"files": [],
|
|
73
|
-
"dirs": [".git", "node_modules"]
|
|
74
|
+
"dirs": [".git", "node_modules", ".ecdk"]
|
|
74
75
|
},
|
|
75
76
|
"junk": {
|
|
76
77
|
"level": "warn",
|
|
@@ -358,6 +359,18 @@
|
|
|
358
359
|
"scope": "server",
|
|
359
360
|
"title": "학습 참고 내용 파일(commentary.txt) 없음 (LXP 업로드가 거절함)"
|
|
360
361
|
},
|
|
362
|
+
{
|
|
363
|
+
"id": "manifest.grading-types",
|
|
364
|
+
"level": "warn",
|
|
365
|
+
"scope": "server",
|
|
366
|
+
"title": "쓰지 않는 gradingTypes (완료 정책은 completionPolicies · 완료 정책 화면, 채점 방식은 편집 화면)"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"id": "manifest.completion-policies-missing",
|
|
370
|
+
"level": "error",
|
|
371
|
+
"scope": "server",
|
|
372
|
+
"title": "자료 본문인데 completionPolicies(지원하는 완료 정책)가 없거나 비어 있음"
|
|
373
|
+
},
|
|
361
374
|
{
|
|
362
375
|
"id": "entry.missing",
|
|
363
376
|
"level": "error",
|
|
@@ -467,10 +480,10 @@
|
|
|
467
480
|
"title": "학생에게 내려가는 JSON에 정답처럼 보이는 키"
|
|
468
481
|
},
|
|
469
482
|
{
|
|
470
|
-
"id": "
|
|
483
|
+
"id": "completion.no-submit",
|
|
471
484
|
"level": "warn",
|
|
472
485
|
"scope": "client",
|
|
473
|
-
"title": "
|
|
486
|
+
"title": "제출 · 채점으로 완료하는데 화면 코드에 제출이 없음"
|
|
474
487
|
},
|
|
475
488
|
{
|
|
476
489
|
"id": "edit.no-save",
|
|
@@ -478,6 +491,48 @@
|
|
|
478
491
|
"scope": "client",
|
|
479
492
|
"title": "편집 화면인데 저장이 없음"
|
|
480
493
|
},
|
|
494
|
+
{
|
|
495
|
+
"id": "completion.no-save",
|
|
496
|
+
"level": "warn",
|
|
497
|
+
"scope": "client",
|
|
498
|
+
"title": "완료 정책 화면인데 저장(useCompletion · saveCompletionPolicy)이 없음"
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
"id": "completion.no-screen",
|
|
502
|
+
"level": "warn",
|
|
503
|
+
"scope": "client",
|
|
504
|
+
"title": "완료 정책이 여럿인데 완료 정책 화면(completionPolicy)이 없어 첫 값만 쓰임"
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"id": "completion.screen-unused",
|
|
508
|
+
"level": "warn",
|
|
509
|
+
"scope": "client",
|
|
510
|
+
"title": "완료 정책이 하나(고정)인데 완료 정책 화면(completionPolicy)이 켜져 있음"
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
"id": "completion.no-edit",
|
|
514
|
+
"level": "error",
|
|
515
|
+
"scope": "server",
|
|
516
|
+
"title": "채점(on_graded)으로 완료하는데 채점 방식 · 답을 정할 편집 화면이 없음"
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
"id": "completion.no-grading",
|
|
520
|
+
"level": "warn",
|
|
521
|
+
"scope": "client",
|
|
522
|
+
"title": "채점(on_graded)으로 완료하는데 편집 화면 코드가 채점 설정(getGrading · useGradingBlock)을 저장하지 않음"
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
"id": "grading.missing",
|
|
526
|
+
"level": "warn",
|
|
527
|
+
"scope": "client",
|
|
528
|
+
"title": "채점(on_graded)으로 완료하는데 프로젝트에 grading.json이 없음 (ecdk dev가 채점을 흉내 내지 못함, 프로젝트 검사만)"
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
"id": "build.template-unknown",
|
|
532
|
+
"level": "warn",
|
|
533
|
+
"scope": "client",
|
|
534
|
+
"title": "metadata.json build.template이 이 ecdk가 모르는 템플릿이거나 더 새 템플릿 버전"
|
|
535
|
+
},
|
|
481
536
|
{
|
|
482
537
|
"id": "ref.missing",
|
|
483
538
|
"level": "error",
|
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 `grading.json`).
|
|
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
|
+
- 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.
|
|
5
6
|
- Fix every `ecdk check` / `ecdk build` error before you report. Do not edit `lib/` (the SDK kit).
|
|
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,7 @@ 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
|
-
- Answers or grading wrong:
|
|
19
|
+
- Answers or grading wrong: check the answers on the edit screen (saving in the `ecdk dev` content edit view writes `grading.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`).
|
|
20
20
|
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
21
|
|
|
22
22
|
{{version}}
|
|
@@ -11,11 +11,11 @@ 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.** Screens and content (`ecdk guide 5`; the quiz template: `ecdk guide 6`). Write `commentary.txt` (key concepts and intent, no answers). Draft correct answers in `grading.json` and let the person confirm them.
|
|
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 `elice.config.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`).
|
|
16
|
+
3. **Write.** Screens and content (`ecdk guide 5`; the quiz template: `ecdk guide 6`). Write `commentary.txt` (key concepts and intent, no answers). Draft correct answers on the edit screen (the quiz: in each question card; saving in the content edit view of `ecdk dev` writes `grading.json`) and let the person confirm them.
|
|
17
17
|
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
18
|
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
|
|
19
|
+
6. **Upload** only after the person approves: the elice-content-publish skill (`ecdk guide 12`), or the person uploads `dist/content.zip` in LXP.
|
|
20
20
|
|
|
21
21
|
{{version}}
|
|
@@ -14,7 +14,7 @@ The full guide ships with the CLI: `ecdk guide` lists the topics, `ecdk guide <t
|
|
|
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
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
|
|
17
|
+
4. **Completion and grading.** Decide how it completes (`ecdk guide 2`) and write the required `completionPolicies` in `elice.config.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.
|
|
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
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: elice-content-publish
|
|
3
|
+
description: Upload an Elice Custom HTML learning material to LXP with the elice-material MCP - build the zip with ecdk, pick or create the lecture page, upload, check the draft and save it as a new version after the person approves. Use when the person asks to upload, publish, deploy or update an Elice or LXP material made with ecdk.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Upload an Elice learning material
|
|
7
|
+
|
|
8
|
+
Read `ecdk guide 12` (upload with the material MCP) first. It has the tool order, arguments and error handling.
|
|
9
|
+
|
|
10
|
+
{{always}}
|
|
11
|
+
|
|
12
|
+
## Steps
|
|
13
|
+
|
|
14
|
+
1. **MCP ready?** The `elice-material` tools must be available. If not, ask the person to run `ecdk setup` (QA: `ecdk mcp setup --env qa5`) and log in (Claude Code `/mcp` → elice-material → Authenticate, Helpy Code `⌘ ;`), then stop.
|
|
15
|
+
2. **Build.** `ecdk build --json` must return `ok: true`. Keep `zip` and `zipBytes`.
|
|
16
|
+
3. **Pick the page.** Use `.ecdk/link.json` if it exists, or the LXP edit URL the person gives (`https://{org}.…/lecturepages/{id}/edit`). Otherwise list with `list_my_organizations` → `list_courses` → `list_lectures` → `list_custom_pages` and let the person choose. Make a new page with `create_custom_page` only after the person approves.
|
|
17
|
+
4. **Upload.** `get_material` (keep `current_version.id`) → `create_package_upload` with `size_bytes = zipBytes` → run its `curl_command` with `package.zip` replaced by the zip path → `submit_package` → poll `get_draft` until ready or failed. On failure, report the server's reason with `ecdk check dist/content.zip` and stop.
|
|
18
|
+
5. **Approve.** Show what changes (page, title, completion policy, whether answers are saved) and the draft `preview_urls`. Saving is visible to learners at once if the page is open. Wait for an explicit yes.
|
|
19
|
+
6. **Save.** `save_draft` with `expected_current_version_id`, `completion_policy` and, for `on_graded`, the `grading` the person confirmed. On `MATERIAL_CHANGED`, stop: someone saved in between.
|
|
20
|
+
7. **Finish.** Set the title and icon with `update_material` if the page has none (`ecdk guide 12`). Write `.ecdk/link.json` as `{ "org": …, "lecture_page_id": …, "version_id": … }` so the next upload goes to the same page. Report the LXP URL. New pages stay closed until the person opens them in LXP.
|
|
21
|
+
|
|
22
|
+
{{version}}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// lib/cdk-mock.js 타입 (편집기 자동완성용)
|
|
2
2
|
export type Scope = 'learn' | 'edit';
|
|
3
3
|
export type Viewer = 'student' | 'instructor' | 'tutor';
|
|
4
|
-
export type Screen = 'learn' | 'instructor' | 'edit';
|
|
4
|
+
export type Screen = 'learn' | 'instructor' | 'edit' | 'completionPolicy';
|
|
5
|
+
export type CompletionPolicy = 'on_access' | 'on_submit' | 'on_graded';
|
|
5
6
|
|
|
6
7
|
export declare const ErrorCode: Readonly<{
|
|
7
8
|
Init: 'init';
|
|
@@ -19,6 +20,7 @@ export declare const ErrorCode: Readonly<{
|
|
|
19
20
|
ExternalServiceError: 'external_service_error';
|
|
20
21
|
NavigationTimeout: 'navigation_timeout';
|
|
21
22
|
RequestFailed: 'request_failed';
|
|
23
|
+
DraftNotSaved: 'draft_not_saved';
|
|
22
24
|
}>;
|
|
23
25
|
export declare class EliceCDKError extends Error {
|
|
24
26
|
static code: typeof ErrorCode;
|
|
@@ -40,7 +42,16 @@ export interface Submission extends SubmitResult {
|
|
|
40
42
|
answer: unknown;
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
|
|
45
|
+
/** 채점 설정을 서버 모양으로 ({ type: pattern | rubric }). camelCase answerKey도 받는다. 채점 방식이 아니면 null */
|
|
46
|
+
export declare function normalizeGradingSettings(
|
|
47
|
+
grading: unknown
|
|
48
|
+
): { type: 'pattern'; answer_key?: string } | { type: 'rubric'; rubric?: string } | null;
|
|
49
|
+
/** 완료 정책(없으면 채점 설정이 있으면 on_graded, 없으면 on_submit)과 채점 설정으로 로컬 채점 */
|
|
50
|
+
export declare function gradeLocally(
|
|
51
|
+
grading: unknown,
|
|
52
|
+
answer: unknown,
|
|
53
|
+
policy?: 'on_access' | 'on_submit' | 'on_graded'
|
|
54
|
+
): SubmitResult;
|
|
44
55
|
|
|
45
56
|
export interface Navigation {
|
|
46
57
|
previous(): void;
|
|
@@ -55,6 +66,8 @@ export declare class MockEliceCDK {
|
|
|
55
66
|
onSessionExpired?: () => void;
|
|
56
67
|
scenario?: string;
|
|
57
68
|
grading?: unknown;
|
|
69
|
+
completionPolicy?: CompletionPolicy;
|
|
70
|
+
completionPolicies?: CompletionPolicy[];
|
|
58
71
|
settings?: Record<string, unknown>;
|
|
59
72
|
loadJson?: (url: string) => Promise<unknown>;
|
|
60
73
|
delayMs?: number;
|
|
@@ -78,6 +91,8 @@ export declare class MockEliceCDK {
|
|
|
78
91
|
description: unknown;
|
|
79
92
|
entries: Partial<Record<Screen, string>>;
|
|
80
93
|
settings: Record<string, unknown>;
|
|
94
|
+
completionPolicy: CompletionPolicy;
|
|
95
|
+
completionPolicies: CompletionPolicy[] | null;
|
|
81
96
|
} | null;
|
|
82
97
|
readonly result: {
|
|
83
98
|
score: number | null;
|
|
@@ -88,7 +103,10 @@ export declare class MockEliceCDK {
|
|
|
88
103
|
init(options?: { hash?: string; pathname?: string }): Promise<this>;
|
|
89
104
|
submit(answer: unknown): Promise<SubmitResult>;
|
|
90
105
|
history(options?: { offset?: number; limit?: number }): Promise<Submission[]>;
|
|
91
|
-
|
|
106
|
+
/** 저장하고 부모 창에 settings-saved로 알린다. 토큰 없는 draft(#edit=1)는 draft_not_saved로 거절 */
|
|
107
|
+
saveSettings(settings: Record<string, unknown>): Promise<void>;
|
|
108
|
+
/** 완료 정책 화면에서만. 이 브라우저에 남기고 settings-saved로 알린다. draft는 draft_not_saved, 채점 설정 없는 on_graded는 거절 */
|
|
109
|
+
saveCompletionPolicy(policy: CompletionPolicy): Promise<void>;
|
|
92
110
|
dispose(): void;
|
|
93
111
|
reset(): void;
|
|
94
112
|
}
|