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