@eliceio/cdk-cli 1.3.0-contenttypes.2 → 1.3.1
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 +97 -91
- package/es/commands/dev/index.d.ts +1 -1
- package/es/commands/dev/index.js +2 -1
- package/es/commands/doctor/index.d.ts +1 -1
- package/es/commands/doctor/index.js +38 -3
- package/es/commands/setup/index.d.ts +1 -1
- package/es/commands/setup/index.js +1 -1
- package/es/commands/uninstall/index.d.ts +1 -1
- package/es/commands/uninstall/index.js +1 -1
- package/es/core/collect.js +3 -1
- package/es/core/quiz-check.d.ts +21 -0
- package/es/core/quiz-check.js +364 -0
- package/es/core/sandbox.d.ts +5 -0
- package/es/core/sandbox.js +18 -0
- package/es/dev/host-page.js +8 -5
- package/es/dev/mock-api.d.ts +3 -1
- package/es/engines/vite/plugin.js +7 -1
- package/es/rules/check.js +6 -0
- package/es/rules/privacy.d.ts +20 -0
- package/es/rules/privacy.js +177 -0
- package/es/rules.json.js +1 -1
- package/package.json +2 -2
- package/rules.json +7 -1
- package/skills/_shared/always.md +6 -3
- package/skills/_shared/references/00-what-the-person-decides.md +3 -2
- package/skills/_shared/references/02-design-the-material.md +12 -6
- package/skills/_shared/references/03-create-the-project.md +9 -9
- package/skills/_shared/references/04-rules.md +2 -0
- package/skills/_shared/references/05-screen-code.md +2 -0
- package/skills/_shared/references/06-using-the-quiz-template.md +13 -2
- package/skills/_shared/references/07-move-existing-html.md +1 -1
- package/skills/_shared/references/08-fix-check-errors.md +26 -23
- package/skills/_shared/references/09-check.md +1 -1
- package/skills/_shared/references/12-upload-with-the-material-mcp.md +18 -2
- package/skills/_shared/references/15-edit-settings-by-hand.md +184 -0
- package/skills/elice-content-check/SKILL.md +1 -1
- package/skills/elice-content-create/SKILL.md +3 -3
- package/skills/elice-content-edit/SKILL.md +26 -0
- package/skills/elice-content-migrate/SKILL.md +2 -1
- package/skills/elice-content-publish/SKILL.md +2 -2
- package/templates/_shared/AGENTS.md +10 -0
- package/templates/_shared/CLAUDE.md +1 -0
- package/templates/_shared/lib/cdk-mock.js +28 -7
- package/templates/blank/package.json +1 -1
- package/templates/blank/template.json +1 -1
- package/templates/document/core/load.d.ts +1 -0
- package/templates/document/core/load.js +29 -2
- package/templates/document/core/pdf.d.ts +1 -0
- package/templates/document/core/pdf.js +5 -0
- package/templates/document/screens/edit.js +6 -3
- package/templates/document/screens/learn.js +3 -1
- package/templates/document/template.json +1 -1
- package/templates/quiz/package.json +1 -1
- package/templates/quiz/template.json +1 -1
- package/templates/steps/package.json +1 -1
- package/templates/steps/template.json +1 -1
|
@@ -2,28 +2,31 @@
|
|
|
2
2
|
|
|
3
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
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` · `ref.insecure` | Put the library, image, font or video in the zip and use a relative path (fonts: files or data URIs)
|
|
10
|
-
| `html.iframe` | Remove the `<iframe src>`/`<object>`/`<embed>` (an `<iframe>` with `srcdoc` for a code preview passes): upload video as an Elice video material, put other content in this HTML
|
|
11
|
-
| `ref.external-font` (warn) | A font from a host in `rules.json` `externalAllow` (empty for now): closed-network schools cannot reach it, so put a font that matters in the zip
|
|
12
|
-
| `ref.vendor-external-url` (warn) | A library file holds outside addresses: run `ecdk dev`, look for "막힌 외부 요청", put what it loads in the zip and set the library to a relative path
|
|
13
|
-
| `api.storage` · `api.cookie` (warn) | Browser storage and cookies stay only in that browser and device and are not the learner's record. Submit results; save content from the edit screen
|
|
14
|
-
| `api.dialog` · `api.window-open` · `html.form` | An in-page message · the same view · a button click + `useSubmit`
|
|
15
|
-
| `api.external-send` | Remove the external send. An AI call to mlapi goes through `sdk.mlapi.fetch` (the check allows it, also with the absolute `https://mlapi.run/…` address)
|
|
16
|
-
| `sec.answer-in-bundle` | A correct answer saved on the edit screen (`.ecdk/settings.json` grading) appears as is in screen code, a data JSON or `commentary.txt`, which students can read from the zip. Remove it there; answers live only in the grading settings
|
|
17
|
-
| `
|
|
18
|
-
| `sec.
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
21
|
-
| `
|
|
22
|
-
| `
|
|
23
|
-
| `
|
|
24
|
-
| `
|
|
25
|
-
| `
|
|
26
|
-
| `
|
|
27
|
-
| `
|
|
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` · `ref.insecure` | Put the library, image, font or video in the zip and use a relative path (fonts: files or data URIs) |
|
|
10
|
+
| `html.iframe` | Remove the `<iframe src>`/`<object>`/`<embed>` (an `<iframe>` with `srcdoc` for a code preview passes): upload video as an Elice video material, put other content in this HTML |
|
|
11
|
+
| `ref.external-font` (warn) | A font from a host in `rules.json` `externalAllow` (empty for now): closed-network schools cannot reach it, so put a font that matters in the zip |
|
|
12
|
+
| `ref.vendor-external-url` (warn) | A library file holds outside addresses: run `ecdk dev`, look for "막힌 외부 요청", put what it loads in the zip and set the library to a relative path |
|
|
13
|
+
| `api.storage` · `api.cookie` (warn) | Browser storage and cookies stay only in that browser and device and are not the learner's record. Submit results; save content from the edit screen |
|
|
14
|
+
| `api.dialog` · `api.window-open` · `html.form` | An in-page message · the same view · a button click + `useSubmit` |
|
|
15
|
+
| `api.external-send` | Remove the external send. An AI call to mlapi goes through `sdk.mlapi.fetch` (the check allows it, also with the absolute `https://mlapi.run/…` address) |
|
|
16
|
+
| `sec.answer-in-bundle` | A correct answer saved on the edit screen (`.ecdk/settings.json` grading) appears as is in screen code, a data JSON or `commentary.txt`, which students can read from the zip. Remove it there; answers live only in the grading settings |
|
|
17
|
+
| `privacy.personal-field` (warn) | Learner personal data: an input for it (`type="tel"` · `"email"`, a personal `autocomplete`, a name · id · placeholder · label saying phone · email · 학번 …), a personal key in `submit` · `kvstore.post`, or `account.fullname` in a submit · save · upload · `mlapi` call. Remove it: tell learners apart with `app.account.anonymousId`, only show `fullname`, make surveys anonymous ([2](02-design-the-material.md) "Personal data"). `ecdk-ignore` only for code that never stores or sends the value, with the reason |
|
|
18
|
+
| `sec.html-injection` | Use `textContent`. If justified: escape + `ecdk-ignore` + the reason |
|
|
19
|
+
| `sec.secret` · `file.secret` | Remove the secret or the answer file (if it was already uploaded, tell the user to **revoke the key**) |
|
|
20
|
+
| `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 '설정' panel at the top of the LXP edit page |
|
|
21
|
+
| `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 |
|
|
22
|
+
| `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 |
|
|
23
|
+
| `sdk.outdated` (error) | The installed SDK bundled into 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`, then build again |
|
|
24
|
+
| `project.deps` (doctor) · "@eliceio/cdk 패키지를 찾지 못했습니다" | The SDK package is not installed in the project: run `npm install` in the project, then build again |
|
|
25
|
+
| `project.grading` (doctor) | The saved `.ecdk/settings.json` `grading` breaks the server's save rules or does not match the public `gradingType`. Have the person open the edit view in `ecdk dev`, fix the marked field (points, answers) and save again; if you edited the file by hand, correct those values ([15](15-edit-settings-by-hand.md)). Never delete the file: the content goes with it |
|
|
26
|
+
| `project.quiz` (doctor, quiz template) | The saved questions, answers or points do not pass the quiz edit screen's own checks (run with the project's `core/model.js`): answers or scores left in the old question order, `points` ≠ `scores`, an answer pointing at a deleted option, a missing `gradingType`, a regex the edit screen cannot read (a text answer in the wrong shape for the project's template version), quiz 1.10.0+: a regex answer not in the stored shape or with a blocked syntax, an answer regex over 500 characters, `answerFormat` · `requires` · `answerMode` the project's template does not know, text answers that look as typed (or a regex question) but `answerFormat` is missing, `answerFormat` 2 with URL-encoded text answers (saved again by a 1.9.x edit screen) - for these two, students typing 한글, spaces or `%` are marked wrong: have the person press "초안으로 저장" once in the edit view and the answers are saved again in the right shape. A warning (`warn`): tags written in snake_case (`answer_format` · `answer_mode`). Fix as [15](15-edit-settings-by-hand.md) says, run `ecdk doctor` again, then have the person save once in the edit view ("초안으로 저장") |
|
|
27
|
+
| `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"` |
|
|
28
|
+
| `manifest.*` · `entry.*` | Check `screens` and `kind` in `metadata.json` |
|
|
29
|
+
| `limit.*` · `file.large-image` | Shrink images (longest side 2048px, WebP 85, [6](06-using-the-quiz-template.md) "Adding images") and video, drop unused files (build output: "files not referenced anywhere") |
|
|
30
|
+
| `sdk.lib-copy` (error, project only) | An SDK copy `lib/cdk.js` in the project (never put in the zip): `ecdk doctor --fix`, `npm install`, replace the kit `lib/elice-content.js` with a new `ecdk create` one, delete `lib/cdk.js` |
|
|
28
31
|
|
|
29
32
|
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.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# 9. Check
|
|
2
2
|
|
|
3
3
|
```bash
|
|
4
|
-
ecdk dev <folder> # in the background: http://localhost:4170 (student, tutoring, instructor, content edit; desktop and mobile widths)
|
|
4
|
+
ecdk dev <folder> # in the background: http://localhost:4170 (student, tutoring, instructor screen as in the editor preview, content edit; desktop and mobile widths)
|
|
5
5
|
ecdk dev <folder> --check # one-shot check of every enabled screen, headless
|
|
6
6
|
```
|
|
7
7
|
|
|
@@ -18,6 +18,7 @@ The `elice-material` MCP server (elice-material backend) uploads a built zip to
|
|
|
18
18
|
| Upload URL | `create_package_upload` (`size_bytes`) | At most 20 MB. Returns `key` and `curl_command` |
|
|
19
19
|
| Upload | the `curl_command`, `package.zip` replaced by the zip path | From a desktop app, run it through a login shell (see Always) |
|
|
20
20
|
| 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 |
|
|
21
|
+
| Files (optional) | `create_asset_upload` (`extension`, `size_bytes`) → its `curl_command`, per file | Images for quiz text, the PDF/PPTX of the document template. Only after the draft is `ready`. Put the returned `key` (never the URL) into the settings. See "Images and documents (`asset:` files)" below |
|
|
21
22
|
| Approve | — | Show page, title, whether content and answers go with it (the summary, no answer values), the completion policy to set (below), `preview_urls`. Saving is visible to learners at once when the page is open |
|
|
22
23
|
| Save | `save_draft` (`material_draft_id`, `expected_current_version_id`, `payload`) | One save carries everything, so no extra version is made. `payload` holds only the keys to set, each only when the tool's schema lists it: `settings` and `completion_policy` when the person said yes (below; `on_graded` only together with `settings` that include `grading`), and `title` · `icon` when the page has none (a new page). `MATERIAL_CHANGED`: someone saved after your `get_material`; do not retry blindly, tell the person |
|
|
23
24
|
| Check | `get_material` (or `get_draft` before saving) | When settings were sent: the saved settings have the same top-level keys and item count and `grading.type` as the summary. When a policy was sent: it shows that policy. Show any `warnings` in the result to the person. If not as sent, tell the person and use the fallback |
|
|
@@ -37,11 +38,25 @@ Next time, read it, confirm the page with the person as above (기관 · 과목
|
|
|
37
38
|
|
|
38
39
|
1. **Does the server take it?** Look at the input schema of `save_draft` (and `update_material`): use `settings` only when the schema lists it as a key of `payload` (or, on an older server, as a top-level parameter). The same holds for `completion_policy`, `title` and `icon`. If no tool has it, use the fallback below. Never guess another argument or tool name.
|
|
39
40
|
2. **Only this project's file.** Use `<project>/.ecdk/settings.json` of the project you just built, never a file from another project or copied for another material. If the person changed the target page or project since, ask again.
|
|
40
|
-
3. **Checked by the edit screen.** It must be what the edit screen saved, so its own validation ran (the quiz edit screen checks every answer and builds the regex): the person opens the edit view in `ecdk dev`, checks the content and saves with the edit screen's button (the quiz template: "초안으로 저장"); the dev log prints "내용을 .ecdk/settings.json에 저장했습니다". If you wrote or changed the file by hand (`references/09-check.md`), that save must happen before the upload. Then check the shape: a JSON object, content keys at the top level (not wrapped in `content`), `grading` only when graded. The quiz: `{ "title": …, "questions": [ … ] }` with `grading` `{ "type": "pattern", "answer_key": "^…$" }`, or for partial scores `{ "title": …, "questions": [ … ], "gradingType": "partial_pattern" }` with `grading` `{ "type": "partial_pattern", "answer_key": ["^q1=…$", …], "scores": [ … ] }` (one regex and one score per question, same length as `questions`, integer scores summing to at least 100; `gradingType` must be there too or students submit the wrong shape and get 422). Then run `ecdk doctor` in the project: its `project.grading` check tests the saved `grading` against the server's save rules (`partial_pattern` scores summing to at least 100, integers 0–100, one score per regex, 1–50 questions, valid regexes; `rubric` up to 10,000 characters) and that `gradingType` matches `grading.type
|
|
41
|
+
3. **Checked by the edit screen.** It must be what the edit screen saved, so its own validation ran (the quiz edit screen checks every answer and builds the regex): the person opens the edit view in `ecdk dev`, checks the content and saves with the edit screen's button (the quiz template: "초안으로 저장"); the dev log prints "내용을 .ecdk/settings.json에 저장했습니다". If you wrote or changed the file by hand (`references/09-check.md`), that save must happen before the upload. Then check the shape: a JSON object, content keys at the top level (not wrapped in `content`), `grading` only when graded. The quiz: `{ "title": …, "questions": [ … ] }` with `grading` `{ "type": "pattern", "answer_key": "^…$" }`, or for partial scores `{ "title": …, "questions": [ … ], "gradingType": "partial_pattern" }` with `grading` `{ "type": "partial_pattern", "answer_key": ["^q1=…$", …], "scores": [ … ] }` (one regex and one score per question, same length as `questions`, integer scores summing to at least 100; `gradingType` must be there too or students submit the wrong shape and get 422). Then run `ecdk doctor` in the project: its `project.grading` check tests the saved `grading` against the server's save rules (`partial_pattern` scores summing to at least 100, integers 0–100, one score per regex, 1–50 questions, valid regexes; `rubric` up to 10,000 characters) and that `gradingType` matches `grading.type`; for the quiz template its `project.quiz` check also runs the edit screen's own checks with the project's `core/model.js` (answers and scores in question order, `points` equal to `scores`, answers pointing at existing options, regexes the edit screen can read back). If either fails, do not upload `settings`: tell the person what doctor said (never the answer values) and have them fix it in the edit view and save again. `ecdk build` does not check `.ecdk/settings.json` (it is not in the zip), so a passing build is not enough.
|
|
41
42
|
4. **Whole replace: compare first.** `settings` replaces the page's settings as a whole (the content keys and `grading`); nothing is merged. On a page that already has a version, read its settings with `get_material` and compare them with the local file. If keys would disappear, or the content saved in LXP differs from the file (an instructor edited it in LXP after the last upload), show a short summary of the difference (which keys or items, the title, the number of questions; never answer values) and ask before overwriting. The person may prefer to keep LXP's content: then send no `settings`. A first upload to a new page needs no comparison.
|
|
42
|
-
5. **Summary and an explicit yes.** Before the upload, show what goes with it: the title, the number of questions or items, and whether answers are included (`grading.type`, `pattern`, `partial_pattern` or `rubric`; for `partial_pattern` also the number of questions and the scores), but never the answer values (`answer_key`, `rubric`). The answers must be ones the person confirmed (Always: ask before you settle correct answers). Send it only after an explicit yes; a no means the fallback.
|
|
43
|
+
5. **Summary and an explicit yes.** Before the upload, show what goes with it: the title, the number of questions or items, and whether answers are included (`grading.type`, `pattern`, `partial_pattern` or `rubric`; for `partial_pattern` also the number of questions and the scores), but never the answer values (`answer_key`, `rubric`). **Settings reach every viewer, students included: never send settings that hold a learner's personal data** (names, contact details, student numbers …; 2 "Personal data"). The answers must be ones the person confirmed (Always: ask before you settle correct answers). Send it only after an explicit yes; a no means the fallback.
|
|
43
44
|
6. **Send** it as `payload.settings` with the save (`save_draft` above), with the completion policy the person agreed to (below). Then check it with `get_material` (or `get_draft` when the draft shows it before saving) as in the table.
|
|
44
45
|
7. **No settings file?** Suggest filling the edit view in `ecdk dev` first and saving, so the upload carries it, or skip it (the person enters the content in the LXP edit screen later).
|
|
46
|
+
8. **Adding images to a page that already has a version.** Read the page's current settings first (`get_material`, or `get_draft` for a draft not saved yet) and merge them into the local `.ecdk/settings.json` before you change anything: `settings` replaces the whole object, so skipping this overwrites what was edited in the LXP editor, including `asset:` images people added there (keep those references exactly as they are). Then, when the MCP lists `create_asset_upload`, upload the image as an `asset:` file ("Images and documents" below; no new zip needed: `update_material` with the merged settings after the person's yes). Only when it does not: add a zip image (6 "Adding images"), `ecdk build`, and upload as usual: `create_package_upload` → the `curl_command` → `submit_package` → `get_draft` until ready → show the person → `save_draft` with the merged settings only after their yes (items 3–6 still apply).
|
|
47
|
+
|
|
48
|
+
**Images and documents (`asset:` files)**
|
|
49
|
+
|
|
50
|
+
`create_asset_upload` gives a signed upload URL for one file stored on the server for this page, the same place the LXP editor's image and file buttons use. The settings then point at the file by its `key`, so it stays editable in the LXP editor and does not grow the zip.
|
|
51
|
+
|
|
52
|
+
- **When.** Images in quiz text (a question's `description`, `explanation.text`: ``, never `title`, which is plain text; 6 "Adding images"), and the PDF or PPTX of the document template (`settings.document`). Files the screen code loads itself still go in the zip.
|
|
53
|
+
- **Is the tool there?** Use it only when the MCP lists `create_asset_upload`. If not (an older server), tell the person and fall back: a quiz image goes in the zip as `img/` (6 "Adding images"); a document is uploaded by the person on the LXP edit screen (the file button, then '수업 자료에 반영').
|
|
54
|
+
- **Types and limits.** `extension`: `png` · `jpg` · `jpeg` · `webp` · `gif` (at most 10 MB) or `pdf` · `pptx` (at most 95 MB); no SVG, no `.ppt` (save as `.pptx` or `.pdf` first). `size_bytes` is the exact file size (`wc -c < file`). Above the limit the tool answers `MATERIAL_PACKAGE_TOO_LARGE` with the limit. **Shrink an image first** (6 "Adding images": longest side 2048px or less, WebP about 85, EXIF · GPS stripped): this path does not run the editor's in-browser `optimizeImage`.
|
|
55
|
+
- **Order.** Confirm the target page first (above). With a new zip: build → `create_package_upload` → the `curl_command` → `submit_package` → `get_draft` until `ready` → then, per file, `create_asset_upload` → its `curl_command` (replace `asset.<extension>` with the file's path; from a desktop app through a login shell) → put the key into the settings → show the person → `save_draft` with the merged settings after their yes. Never call it before the new draft is ready: the file's folder follows the ready draft's package (a copied page uses its source's folder until then), so an earlier key can point where the new version does not read. Without a new zip (the page already has a version): `get_material` → `create_asset_upload` → the `curl_command` → `update_material` with the merged settings after the person's yes.
|
|
56
|
+
- **The key, not the URL.** Put the returned `key` (`assets/{material id}/{id}.{ext}`) into the settings exactly as returned; never the upload URL or any signed address (it expires and carries a signature). Quiz: `` in the Markdown, with alt text that says what the picture shows. Document template: `settings.document = { "asset_key": <key>, "name": <file name>, "size": <bytes>, "type": "pdf" | "pptx", "pages": <page count, or 0 if unknown> }` (`templates/document/core/settings.js`).
|
|
57
|
+
- **Files uploaded in `ecdk dev` are local.** A key under `assets/00000000-0000-4000-8000-0000000000e1/` in `.ecdk/settings.json` (quiz `asset:` images, `settings.document.asset_key`) points to `.ecdk/assets/<same file name>` on this PC and does not exist on LXP. Before sending such settings, upload each of those files with `create_asset_upload` (after the draft is `ready`) and replace the local key with the returned one everywhere it appears. Never send a local key; if the tool is missing, tell the person the files must be added again in the LXP edit screen.
|
|
58
|
+
- **Merge, then show.** `settings` replaces the whole object: start from the page's current settings (`get_material`, or `get_draft` before the first save), keep every `asset:` reference already there exactly as it is, add the new keys, and write the result to `.ecdk/settings.json` as well. Before saving, show the person which file goes where (question number or the document, file name, size after shrinking, alt text) and wait for a yes. The draft preview does not show these settings before the save, and `ecdk dev` cannot show a server file: check on the LXP page after saving.
|
|
59
|
+
- **Nothing changes until a save.** An uploaded file that no saved settings point at is unused; there is no MCP tool to delete it. If the person says no, do not save.
|
|
45
60
|
|
|
46
61
|
**Fallback (the server has no `settings`, the person said no, or there is no file)**: upload the zip only, without content or `grading`, and without `on_graded` (see "Completion policy"). After saving, tell the person to open the LXP edit page, enter the content and answers on the edit screen (`settings`, with `settings.grading` for `on_graded`) and save with the edit screen's own button (the quiz template: "초안으로 저장"). That saves to the draft; learners see it only after '수업 자료에 반영' at the top of the LXP edit page.
|
|
47
62
|
|
|
@@ -76,6 +91,7 @@ The completion policy is not in the project or the zip (ADR 0012): it is a setti
|
|
|
76
91
|
| `MATERIAL_CHANGED` | Someone saved after your `get_material`. Do not retry blindly; tell the person |
|
|
77
92
|
| `MATERIAL_GRADING_REQUIRED` | `on_graded` without `grading`. Stop and tell the person |
|
|
78
93
|
| `MATERIAL_DRAFT_PENDING` (`update_material`) | Someone uploaded a package to this page and did not save it: a ready draft holds a package different from the current version. Nothing changed. Stop, explain it, and ask whether to save that draft (`save_draft`, which publishes their upload) or discard it (`discard_draft`). Never pick for the person |
|
|
94
|
+
| `MATERIAL_PACKAGE_TOO_LARGE` (`create_asset_upload`) | The file is above its limit (images 10 MB, PDF · PPTX 95 MB). Shrink the image (6 "Adding images") or ask the person for a smaller document |
|
|
79
95
|
| `PACKAGE_TOO_LARGE` | Over 20 MB |
|
|
80
96
|
| An error about `settings` (for example `INVALID_INPUT`, a bad `settings.grading` pattern or rubric, `partial_pattern` scores summing to less than 100) | Nothing was saved: report it, and save without settings (the fallback) only after the person agrees |
|
|
81
97
|
| `warnings` in a tool result | Show them to the person close to word for word (for example `settings.grading` sent while the policy is not `on_graded`). No `warnings` key means none |
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# 15. Edit settings by hand
|
|
2
|
+
|
|
3
|
+
`.ecdk/settings.json` is what the edit screen saved: the content at the top level and the answers in `grading`. The edit screen checks everything before it saves; a change you write into the file skips those checks. So when you change it by hand, follow this page, run `ecdk doctor` (`project.grading` and `project.quiz` must not fail) and then have the person open the edit view in `ecdk dev` and press "초안으로 저장" once.
|
|
4
|
+
|
|
5
|
+
Never delete `.ecdk/settings.json` to fix it: the content goes with it.
|
|
6
|
+
|
|
7
|
+
## The quiz keys
|
|
8
|
+
|
|
9
|
+
Everything outside `grading` is **public**: the student screen receives it. Never put a correct answer outside `grading`.
|
|
10
|
+
|
|
11
|
+
| Key | Public or answer | Meaning |
|
|
12
|
+
| ------------------------------------------------------------ | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
+
| `questions[]` | public | The questions in display order (up to 20) |
|
|
14
|
+
| `questions[].id` | public | `q1`, `q2`, …: lower-case letters and digits. The answer regexes and the student's answers use it, so never change or reuse an id; a new question gets an unused id |
|
|
15
|
+
| `questions[].type` | public | `select_one` · `select_multiple` · `order` · `text` · `group` |
|
|
16
|
+
| `questions[].title` · `description` | public | The question and an optional note under it (`description` exists only when the author wrote one) |
|
|
17
|
+
| `questions[].options[]` | public | `{ id, text }` choices (`a`, `b`, …; not for `text`). Keep the ids when you edit the text |
|
|
18
|
+
| `questions[].groups[]` · `slots` · `shuffle` · `placeholder` | public | Group sorting `{ id, name }` (`g1`, …), the number of order slots, shuffling the choices for students, the hint in a text field |
|
|
19
|
+
| `questions[].explanation` | public | `{ enabled, text }` shown after submitting (Markdown) |
|
|
20
|
+
| `questions[].answerMode` | public | Quiz 1.10.0+, on every `text` question: `"list"` (accepted answers) or `"regex"` (the author's regex). Changing it is the person's choice. See [Regex answers](#regex-answers-quiz-1100-and-later) |
|
|
21
|
+
| `answerFormat` | public | Quiz 1.10.0+: how the student screen sends a text answer. `2` = as typed (`%` → `%25`, `;` → `%3B`). Missing = the old format (URL-encoded). The edit screen writes it; never set it by hand alone |
|
|
22
|
+
| `requires` | public | Quiz 1.10.0+: the template version these settings need, `{ "quiz": "1.10.0" }`. Written with `answerFormat` |
|
|
23
|
+
| `questions[].points` | public | Partial scores only: the question's points as shown on the edit screen and next to the title. Must equal the same position in `grading.scores` |
|
|
24
|
+
| `gradingType` | public | Partial scores only: `"partial_pattern"`. The student screen cannot see `grading`, so this tells it to submit one answer per question. Missing → students submit the wrong shape and the server rejects it |
|
|
25
|
+
| `pointsMode` | public | Partial scores only: `"equal"` (automatic: every question `ceil(100 / questions)`, `core/model.js` `equalPoints`) or `"custom"` (the author set the points) |
|
|
26
|
+
| `images` | public | Old pictures (before quiz 1.9.0, `` in the text, `data:` addresses here). Leave them as they are; new images: [6](06-using-the-quiz-template.md) "Adding images" |
|
|
27
|
+
| `title` · `description` | public | Saved by an older quiz; kept as they are, not shown |
|
|
28
|
+
| `grading.type` | answer | `"pattern"` (everything right for 100) or `"partial_pattern"` (a score per question) |
|
|
29
|
+
| `grading.answer_key` | answer | `pattern`: one regex for the whole quiz, `^q1=b;q2=a,c$`. `partial_pattern`: one regex per question **in question order**, `["^q1=b$", "^q2=a,c$"]` |
|
|
30
|
+
| `grading.scores` | answer | `partial_pattern` only: integer points 0–100 per question in question order, summing to **at least 100** (more is allowed, the server caps the student's score at 100) |
|
|
31
|
+
|
|
32
|
+
## Build the answer regexes with `core/model.js`
|
|
33
|
+
|
|
34
|
+
Never write an answer regex by hand: a text answer must have the exact shape the student screen sends, inside `(?:…|…)`, and the edit screen cannot read anything else. That shape depends on the template version:
|
|
35
|
+
|
|
36
|
+
- **Quiz 1.9.x and older** (no `answerFormat` in the settings): URL-encoded, `서울` is `%EC%84%9C%EC%9A%B8`.
|
|
37
|
+
- **Quiz 1.10.0 and later** (`"answerFormat": 2`): as typed, only `%` → `%25` and `;` → `%3B`, `서울` stays `서울`.
|
|
38
|
+
|
|
39
|
+
These rules apply from quiz 1.10.0. Until a project's `package.json` `"ecdk"."template"` is `quiz@1.10.0` or later (its `core/model.js` exports `ANSWER_FORMAT`), only the first shape applies and `answerFormat` · `requires` · `answerMode` must not appear in its settings: `ecdk doctor` fails `project.quiz` (the older student screen would mark 한글, spaces and `%` answers wrong). The project's own `core/model.js` knows its shape, so the script below works for both. A hand-written `^q3=(서울|서울특별시)$` passes `ecdk build` but marks a student who types 서울 wrong. Answers are given per question id in the edit screen's own shape:
|
|
40
|
+
|
|
41
|
+
| Type | Answer value | Example |
|
|
42
|
+
| ----------------- | ---------------------------------------------------------------- | ---------------------------------------- |
|
|
43
|
+
| `select_one` | one option id | `"b"` |
|
|
44
|
+
| `select_multiple` | option ids | `["a", "c"]` |
|
|
45
|
+
| `order` | option ids in the right order | `["a", "c", "b", "d"]` |
|
|
46
|
+
| `text` | accepted answers as typed (not encoded) | `["서울", "서울특별시"]` |
|
|
47
|
+
| `text` (regex) | quiz 1.10.0+, `answerMode: "regex"`: the author's regex as typed | `"[Ss]eoul\|서울"` |
|
|
48
|
+
| `group` | option ids per group id | `{ "g1": ["a", "c"], "g2": ["b", "d"] }` |
|
|
49
|
+
|
|
50
|
+
Run this in the project folder. It reads the answers that are saved now by question id, so it still works after you reorder or delete questions; change step 2 only:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
node --input-type=module <<'EOF'
|
|
54
|
+
import { readFileSync, writeFileSync } from 'node:fs';
|
|
55
|
+
import * as M from './core/model.js';
|
|
56
|
+
|
|
57
|
+
const path = '.ecdk/settings.json';
|
|
58
|
+
const before = JSON.parse(readFileSync(path, 'utf8'));
|
|
59
|
+
const s = structuredClone(before);
|
|
60
|
+
// 1. The saved answers by question id
|
|
61
|
+
const read = before.grading.type === M.PARTIAL ? M.parseAnswerKeys : M.parseAnswerKey;
|
|
62
|
+
const key = read(before.questions, before.grading.answer_key);
|
|
63
|
+
if (!key) throw new Error('answer_key is not in the edit screen shape: ask the person to pick the answers on the edit screen');
|
|
64
|
+
|
|
65
|
+
// 2. The change: edit s.questions (keep ids) and key, for example
|
|
66
|
+
key.q2 = 'c';
|
|
67
|
+
// (switch to partial scores, only after the person picked it: s.grading.type = M.PARTIAL; s.pointsMode = 'equal';)
|
|
68
|
+
|
|
69
|
+
// 3. Rebuild grading in the new question order. Quiz 1.10.0+ writes the answer format tag like the edit screen
|
|
70
|
+
// (old settings are rewritten in the new shape); older templates have no M.ANSWER_FORMAT and keep the old shape
|
|
71
|
+
const format = M.ANSWER_FORMAT ?? 1;
|
|
72
|
+
if (M.ANSWER_FORMAT) {
|
|
73
|
+
s.answerFormat = M.ANSWER_FORMAT;
|
|
74
|
+
s.requires = { ...(s.requires ?? {}), ...M.REQUIRES };
|
|
75
|
+
}
|
|
76
|
+
if (s.grading.type === M.PARTIAL) {
|
|
77
|
+
if (s.pointsMode === 'equal') M.equalPoints(s.questions.length).forEach((p, i) => (s.questions[i].points = p));
|
|
78
|
+
s.gradingType = M.PARTIAL;
|
|
79
|
+
s.grading.answer_key = M.buildAnswerKeys(s.questions, key, format);
|
|
80
|
+
s.grading.scores = s.questions.map(q => q.points);
|
|
81
|
+
} else {
|
|
82
|
+
delete s.gradingType;
|
|
83
|
+
delete s.pointsMode;
|
|
84
|
+
delete s.grading.scores;
|
|
85
|
+
for (const q of s.questions) delete q.points;
|
|
86
|
+
s.grading.answer_key = M.buildAnswerKey(s.questions, key, format);
|
|
87
|
+
}
|
|
88
|
+
writeFileSync(path, `${JSON.stringify(s, null, 2)}\n`);
|
|
89
|
+
EOF
|
|
90
|
+
ecdk doctor
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Regex answers (quiz 1.10.0 and later)
|
|
94
|
+
|
|
95
|
+
Only for a project made from quiz 1.10.0 or later. On an older project, do not add `answerMode` or a regex: offer accepted answers instead. The format rules themselves are in [06](06-using-the-quiz-template.md) ("Writing `.ecdk/settings.json` by hand", from quiz 1.10.0); if this page and 06 differ, follow 06. This section adds only what to watch when you change an existing quiz.
|
|
96
|
+
|
|
97
|
+
- A text question with `"answerMode": "regex"` holds one regex as its answer (in `key` of the script, a string), not a list. Switching a question to regex or back is the person's choice.
|
|
98
|
+
- The student's answer is trimmed and must match the **whole** regex, so the edit screen removes a leading `^` and a trailing `$`, turns a leading `(?i)` (ignore upper case) into `(?i:…)`, turns `%` into `%25`, and stores the result as `^q3=(?:…)$`. `buildAnswerKey(s)` does the same (`compileTextRegex`); `ecdk doctor` fails a stored regex that is not in that shape.
|
|
99
|
+
- Not allowed (the grading server and the browser read them differently; the edit screen refuses to save, and `ecdk doctor` fails them in the file): `;`, back-references `\1` · `\k<…>`, named groups `(?<name>…)` · `(?P<name>…)`, `[]` · `[^]`, `\p{…}` · `\P{…}`, `\b` · `\B`, flags such as `(?i)` anywhere but the start, `^` · `$` in the middle, `{,n}`, and other `(?…` groups except `(?:` · `(?=` · `(?!` · `(?<=` · `(?<!` · `(?i:`.
|
|
100
|
+
- An answer regex is at most **500 characters** (the server's limit): for `pattern` the whole quiz's regex, for `partial_pattern` each question's.
|
|
101
|
+
- **A tag with old answers.** If a 1.10 quiz was saved again on a 1.9.x edit screen, the settings keep `"answerFormat": 2` but the text answers go back to the URL-encoded shape, and students typing 한글, spaces or `%` are marked wrong. `ecdk doctor` fails it (`project.quiz`), and also fails text answers in the as-typed shape (or a regex question) without `answerFormat`. Have the person press "초안으로 저장" once on this project's (1.10.0+) edit screen: the answers are saved again in the right shape (or rebuild with the script above).
|
|
102
|
+
- A regex answer is not checked for being too wide (the author may mean it): when you write one, test it on the edit screen's "채점 테스트" and tell the person which answers it accepts.
|
|
103
|
+
|
|
104
|
+
## Rules
|
|
105
|
+
|
|
106
|
+
- **Keep ids.** Edit a question's or option's text in place. A new question or option gets an id not used before in that quiz.
|
|
107
|
+
- **Delete or reorder → move the answers and scores too.** `grading.answer_key` (partial) and `grading.scores` follow the order of `questions`, and each question's `points` moves with it. The script above does this; never leave the old order.
|
|
108
|
+
- **Deleting an option that is a correct answer** changes the answer: ask the person for the new one.
|
|
109
|
+
- **Points are the person's.** With `"pointsMode": "equal"` adding or deleting a question recomputes every question's points (`equalPoints`). With `"custom"` points, ask the person before adding or deleting a question (what the new question is worth, where the deleted points go), and before any change to points the request does not spell out. Scores must be integers 0–100 summing to at least 100.
|
|
110
|
+
- **Answers are the person's.** When you translate a quiz, the accepted text answers change language too: propose them and ask. Do not change a question's title or wording beyond the request.
|
|
111
|
+
- **Switching between `pattern` and `partial_pattern`** is the person's choice ("모두 맞혀야 100점" or "문항별 부분 점수"); the edit screen's "부분 채점 허용" switch does the same. A single question is always `pattern`.
|
|
112
|
+
- **Grading the template does not do.** Do not edit `core/` (or `lib/`) to add it, for example a text answer that ignores upper case or spaces. Offer what the template does now (list each spelling the person wants to accept as an accepted answer: `["Seoul", "seoul", "SEOUL"]`; from quiz 1.10.0 also a regex answer such as `(?i)seoul`, if the person picks it); if that is not enough, tell the person it is a feature request for the quiz template.
|
|
113
|
+
- **Never set `answerFormat` or `requires` by hand alone.** They must match the shape of every text answer in `grading`; the script sets them together with the answers.
|
|
114
|
+
|
|
115
|
+
## Example diffs
|
|
116
|
+
|
|
117
|
+
Change an answer (question 2 → option `c`):
|
|
118
|
+
|
|
119
|
+
```diff
|
|
120
|
+
"grading": {
|
|
121
|
+
"answer_key": [
|
|
122
|
+
"^q1=a,c$",
|
|
123
|
+
- "^q2=b$",
|
|
124
|
+
+ "^q2=c$",
|
|
125
|
+
…
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
With `pattern` the same change is inside the one regex: `^q1=a,c;q2=b;…$` → `^q1=a,c;q2=c;…$`.
|
|
129
|
+
|
|
130
|
+
Add a question to a quiz with automatic points (`"pointsMode": "equal"`, 5 → 6 questions: every question 20 → 17, total 102). With `"custom"` points, ask the person first:
|
|
131
|
+
|
|
132
|
+
```diff
|
|
133
|
+
{
|
|
134
|
+
"id": "q5",
|
|
135
|
+
…
|
|
136
|
+
- "points": 20
|
|
137
|
+
+ "points": 17
|
|
138
|
+
+ },
|
|
139
|
+
+ {
|
|
140
|
+
+ "id": "q6",
|
|
141
|
+
+ "type": "select_multiple",
|
|
142
|
+
+ "title": "광합성에 필요한 것을 모두 고르세요.",
|
|
143
|
+
+ "options": [{ "id": "a", "text": "빛" }, { "id": "b", "text": "산소" }, { "id": "c", "text": "물" }],
|
|
144
|
+
+ "shuffle": false,
|
|
145
|
+
+ "explanation": { "enabled": false, "text": "" },
|
|
146
|
+
+ "points": 17
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
…
|
|
150
|
+
"answer_key": [
|
|
151
|
+
…
|
|
152
|
+
- "^q5=g1:a,c\\|g2:b,d$"
|
|
153
|
+
+ "^q5=g1:a,c\\|g2:b,d$",
|
|
154
|
+
+ "^q6=a,c$"
|
|
155
|
+
],
|
|
156
|
+
- "scores": [20, 20, 20, 20, 20]
|
|
157
|
+
+ "scores": [17, 17, 17, 17, 17, 17]
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
(every question's `points` becomes 17, not only `q5`'s.)
|
|
161
|
+
|
|
162
|
+
`pattern` → `partial_pattern` (two questions, automatic points), only after the person picked it:
|
|
163
|
+
|
|
164
|
+
```diff
|
|
165
|
+
{
|
|
166
|
+
"questions": [
|
|
167
|
+
- { "id": "q1", "type": "select_one", … },
|
|
168
|
+
- { "id": "q2", "type": "text", … }
|
|
169
|
+
+ { "id": "q1", "type": "select_one", …, "points": 50 },
|
|
170
|
+
+ { "id": "q2", "type": "text", …, "points": 50 }
|
|
171
|
+
],
|
|
172
|
+
+ "gradingType": "partial_pattern",
|
|
173
|
+
+ "pointsMode": "equal",
|
|
174
|
+
"grading": {
|
|
175
|
+
- "type": "pattern",
|
|
176
|
+
- "answer_key": "^q1=b;q2=(?:%EC%84%9C%EC%9A%B8)$"
|
|
177
|
+
+ "type": "partial_pattern",
|
|
178
|
+
+ "answer_key": ["^q1=b$", "^q2=(?:%EC%84%9C%EC%9A%B8)$"],
|
|
179
|
+
+ "scores": [50, 50]
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Back to `pattern`: set `s.grading.type = 'pattern'` in step 2 of the script; it removes `gradingType`, `pointsMode`, every `points` and `scores` and joins the answers into one regex.
|
|
@@ -12,7 +12,7 @@ Reference files are in `references/` in this skill's folder (see Always). For th
|
|
|
12
12
|
## Steps
|
|
13
13
|
|
|
14
14
|
1. **Reproduce with the CLI.** In the project, `ecdk doctor --json` and `ecdk validate --json`. For a zip someone made, `ecdk validate <file>.zip --json`. Each issue has an id, a file and a line. A screen problem: `ecdk dev --check` (screenshots, console errors, blocked requests).
|
|
15
|
-
2. **Fix by the reference.** Look the id up in `references/08-fix-check-errors.md` (it also covers old projects: `project.legacy-file`, `sdk.lib-copy`, `sdk.outdated`, a missing `@eliceio/cdk`). Fix the cause in the source, not in `dist
|
|
15
|
+
2. **Fix by the reference.** Look the id up in `references/08-fix-check-errors.md` (it also covers old projects: `project.legacy-file`, `sdk.lib-copy`, `sdk.outdated`, a missing `@eliceio/cdk`). Fix the cause in the ecdk project source, not in `dist/` or an unzipped zip, and make the zip again with `ecdk build` (Always). Do not silence a rule with an `ecdk-ignore` comment unless the reference says so. doctor `cli.latest`: `references/01-check-the-environment.md`.
|
|
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 validate dist/content.zip`. Ask the person for the browser console error.
|
|
18
18
|
- Upload rejected: check `ecdk validate dist/content.zip`; a material needs `commentary.txt` and every file named in `metadata.json`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: elice-content-create
|
|
3
|
-
description: Create a new Elice Custom HTML learning material (LXP material type 17) with the ecdk CLI - a quiz, simulation, interactive explanation, guided exercise, flashcards or survey - and answer how-to questions about making one (design, screens, the screen kit and SDK, templates, the content editor, checking in ecdk dev, building the zip). Use when the person asks to make Elice or LXP learning content, a Custom HTML material or an ecdk project, or asks how to build something in one.
|
|
3
|
+
description: Create a new Elice Custom HTML learning material (LXP material type 17) with the ecdk CLI - a quiz, simulation, interactive explanation, guided exercise, flashcards or survey - and answer how-to questions about making one (design, screens, the screen kit and SDK, templates, the content editor, checking in ecdk dev, building the zip). Use when the person asks to make Elice or LXP learning content, a Custom HTML material or an ecdk project, or asks how to build something in one. To change a material that already exists (its questions, answers or points), use elice-content-edit.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Create an Elice learning material
|
|
@@ -13,11 +13,11 @@ Reference files are in `references/` in this skill's folder (see Always). For a
|
|
|
13
13
|
|
|
14
14
|
Write the progress line `[n/N] …` before and after every step below (Always › Progress); the person sees nothing else while you work.
|
|
15
15
|
|
|
16
|
-
1. **Design before code.** Read `references/00-what-the-person-decides.md` and `references/02-design-the-material.md`. Decide ① what the student does, ② whether the student submits and the grading (`type` `pattern` or `rubric`, set on the edit screen; the quiz template uses `pattern`, so do not ask for a quiz) and which completion policy fits (the publish skill sets it after the person agrees; only `on_graded` grades, `on_submit` completes on any submission without grading), ③ 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. Then show the numbered plan.
|
|
16
|
+
1. **Design before code.** Read `references/00-what-the-person-decides.md` and `references/02-design-the-material.md`. Decide ① what the student does, ② whether the student submits and the grading (`type` `pattern` or `rubric`, set on the edit screen; the quiz template uses `pattern`, so do not ask for a quiz) and which completion policy fits (the publish skill sets it after the person agrees; only `on_graded` grades, `on_submit` completes on any submission without grading), ③ the instructor screen (seen only in the LXP editor preview; instructors on the learning page see the student 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. Then show the numbered plan.
|
|
17
17
|
2. **Environment and project.** `ecdk --version && ecdk doctor --json` (`references/01-check-the-environment.md`, also for `cli.latest`), then `ecdk create --list` to pick a template and `ecdk create <folder> --template <name>` (`references/03-create-the-project.md`; it runs `npm install` for the SDK, so when that fails run `npm install` in the project). Start `ecdk dev <folder>` in the background now and give the person the URL.
|
|
18
18
|
3. **Write the screens.** Start from the template's example code and the kit API table at the top of `references/05-screen-code.md`; do not open `lib/` to learn the API (the table is the API). Follow its UI patterns (kit icon buttons, list rows, drop zones; the quiz template: `references/06-using-the-quiz-template.md`); an edit screen you write by hand follows `references/13-edit-screen-design.md` (kit classes, layout, microcopy); when a student or instructor screen has nothing to show, always use `app.emptyState()`, never your own empty-state markup, illustration or text (`references/05-screen-code.md`, "Nothing to show"), and write `commentary.txt` (key concepts and intent, no answers). There is no default content file: the content and answers are what the edit screen saves (`ecdk dev` writes `.ecdk/settings.json`, local by default; the elice-content-publish skill can send it with the upload after the person agrees, otherwise the person enters it in the LXP edit screen).
|
|
19
19
|
- For a material that is not a quiz, start from the blank template and its content editor: design the content JSON shape and its schema first (`references/02-design-the-material.md` ④-1), put them in `screens/edit.js` (`useContentEditor(app, { initial, schema })`), then write the student screen against that shape. Replace the template's example everywhere it says `이 자료에 맞게 바꿀 곳`.
|
|
20
|
-
- If the person describes the content (for example "5 questions about perceptrons"), fill it in so the upload can carry it: write `.ecdk/settings.json` in the shape `references/09-check.md` describes (the edit screen's content object at the top level, `grading` when graded), then have the person open the edit view in `ecdk dev`, check it and save with the edit screen's button, so the edit screen's own validation runs. Draft the answers, but the person confirms them before any upload (Always).
|
|
20
|
+
- If the person describes the content (for example "5 questions about perceptrons"), fill it in so the upload can carry it: write `.ecdk/settings.json` in the shape `references/09-check.md` describes (the edit screen's content object at the top level, `grading` when graded), then have the person open the edit view in `ecdk dev`, check it and save with the edit screen's button, so the edit screen's own validation runs. Draft the answers, but the person confirms them before any upload (Always). One quiz material holds up to 20 questions (`references/06-using-the-quiz-template.md`): put them all in one material; only more than 20 means several quiz materials (pages). If the person prefers, give the content as draft text (the content editor: one JSON block for 코드 보기) to enter in the LXP edit screen instead.
|
|
21
21
|
4. **Check each screen** with `ecdk dev <folder> --check --screens <screen>` after you write it (`references/09-check.md`), fix what it reports (error ids: `references/08-fix-check-errors.md`). The person looks at the screens too.
|
|
22
22
|
5. **Build and report.** `ecdk validate` once, then `ecdk build --json` must return `ok: true`. Report as `references/10-build.md` says.
|
|
23
23
|
6. **Upload** only after the person approves: the elice-content-publish skill (it can send `.ecdk/settings.json` with the upload after the person agrees to the summary), or the person uploads `dist/content.zip` in LXP. Content not sent with the upload is entered in the LXP edit screen, then '수업 자료에 반영' at the top of the LXP edit page (`references/12-upload-with-the-material-mcp.md`, "Content and answers (settings)" and "Fallback").
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: elice-content-edit
|
|
3
|
+
description: Change an existing Elice Custom HTML learning material made with ecdk - edit, add, delete, reorder or translate quiz questions and options, change correct answers, accepted answers, points or the grading type, and fix the content saved in .ecdk/settings.json. Use when the person asks to change, fix, add to, translate or re-grade a material or quiz that already exists (an ecdk project folder, or a content zip made with ecdk: the person gives a content zip and asks to change it), not to make a new one.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Change an existing Elice learning material
|
|
7
|
+
|
|
8
|
+
Reference files are in `references/` in this skill's folder (see Always). For this skill: `references/15-edit-settings-by-hand.md` (what each settings key means, building answer regexes with `core/model.js`, example diffs), `references/00-what-the-person-decides.md`, and for a quiz `references/06-using-the-quiz-template.md`.
|
|
9
|
+
|
|
10
|
+
{{always}}
|
|
11
|
+
|
|
12
|
+
## Steps
|
|
13
|
+
|
|
14
|
+
0. **Only a zip, no project folder?** Never unzip it to edit the files and zip it again (Always), and do not offer that. Questions, answers and points are not in the zip but in the material's settings on the server: tell the person to change them in the LXP edit page (내용 편집), press "초안으로 저장" and then "수업 자료에 반영". Screen wording, look or behavior needs the original ecdk project folder: ask the person for it first. No folder: read `build.template` in the zip's `metadata.json` (for example `quiz@1.10.0`) and make a new project with `ecdk create <folder> --template <name>` (the name before `@`; say so if this ecdk has another version), and explain that the content stays in the LXP edit page, not in the zip. A zip without `build` in `metadata.json` was not made with ecdk: that is the elice-content-migrate skill.
|
|
15
|
+
1. **Look first.** In the project, `ecdk doctor --json` (note what already fails before you change anything), read `.ecdk/settings.json` (the content and answers the edit screen saved; the quiz: `questions`, `grading`, with partial scores `gradingType` · `pointsMode` · each question's `points`, and from quiz 1.10.0 `answerFormat` · `requires` · a text question's `answerMode`) and `package.json` `"ecdk"."template"` (the quiz template version) and the project `README.md` ("고치는 곳"). Start `ecdk dev <folder>` in the background and give the person the URL.
|
|
16
|
+
2. **Sort the request.**
|
|
17
|
+
- Content, answers, points or grading → `.ecdk/settings.json`, keeping every id.
|
|
18
|
+
- Wording or look of the screens → `ui/` (quiz: `ui/texts.js`, `ui/theme.css`, `ui/templates/`) and `screens/`.
|
|
19
|
+
- An image in a question or explanation → `references/06-using-the-quiz-template.md` "Adding images": for a quiz on LXP an `asset:` image you upload with the MCP `create_asset_upload` (or the person adds with the editor's image button), otherwise a zip image in `public/img/`; prepare it first, no size setting.
|
|
20
|
+
- Something the template does not do (for example a text answer that ignores upper case or spaces, a new question type, a new grading rule) → never edit `core/` or `lib/` to add it (Always). Offer what works now (for a text answer: list each spelling the person wants to accept as its own accepted answer; with quiz 1.10.0 or later also a regex answer, `answerMode: "regex"`, if the person picks it) and, if that is not enough, tell the person it is a feature request for the template.
|
|
21
|
+
3. **Ask first** about any value the person decides that the request does not spell out (Always): points or their split, correct or accepted answers (also when translating: the translated answers), a question's title or wording beyond what was asked. Say what you would set and wait for a yes; change only what the request names.
|
|
22
|
+
4. **Change it** as `references/15-edit-settings-by-hand.md` says: keep question, option and group ids; when you delete or reorder questions, `grading.answer_key` and `grading.scores` move with them; build answer regexes with the project's `core/model.js` (its script), never by hand. The text answer shape follows the project's quiz template version: from 1.10.0 the edit screen writes `answerFormat: 2` · `requires`, keeps text answers as typed and may have regex questions (`answerMode`) with their own rules (reference 15, "Regex answers"); older projects keep URL-encoded text answers and must not get `answerFormat`, `requires` or `answerMode`.
|
|
23
|
+
5. **Check.** `ecdk doctor`: `project.grading` and `project.quiz` must not fail (`references/08-fix-check-errors.md`). Fix and run it again. A screen you changed: `ecdk dev <folder> --check --screens <screen>` (`references/09-check.md`).
|
|
24
|
+
6. **Report** in the person's language. List what changed per question, what you did not change and why, and what is still for the person to decide. End with the next step (Always): open the content edit view in `ecdk dev` (the URL) and press "초안으로 저장" once, so the edit screen checks the change. Uploading to LXP is the elice-content-publish skill, only after the person approves.
|
|
25
|
+
|
|
26
|
+
{{version}}
|
|
@@ -1,6 +1,6 @@
|
|
|
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 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.
|
|
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 (not a zip made with ecdk, whose metadata.json has build: changing one is elice-content-edit).
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Move existing HTML into an Elice learning material
|
|
@@ -13,6 +13,7 @@ Reference files are in `references/` in this skill's folder (see Always).
|
|
|
13
13
|
|
|
14
14
|
Write the progress line `[n/N] …` before and after every step below (Always › Progress); the person sees nothing else while you work.
|
|
15
15
|
|
|
16
|
+
0. **A zip made with ecdk** (`metadata.json` has `build`, e.g. `build.template`) is not moved: changing it is the elice-content-edit skill. Never unzip a built zip to edit it and zip it again (Always).
|
|
16
17
|
1. **Read** `references/07-move-existing-html.md` (move existing HTML) and `references/04-rules.md` (rules).
|
|
17
18
|
2. **Look at the original first.** List its entry HTML, the files it loads, and storage or cookies used to keep learner data, anything the sandbox blocks (dialogs, `window.open`, the parent window, external requests, absolute `/` paths). Tell the person what will change, then show the numbered plan.
|
|
18
19
|
3. **Wrap it.** Make or reuse an ecdk project as `references/07-move-existing-html.md` says, keep the original files as they are where possible, and write `commentary.txt`. An old ecdk project: `references/08-fix-check-errors.md` (`project.legacy-file`, `sdk.lib-copy`). Start `ecdk dev <folder>` in the background and give the person the URL.
|
|
@@ -13,10 +13,10 @@ Reference files are in `references/` in this skill's folder (see Always). Read `
|
|
|
13
13
|
|
|
14
14
|
1. **MCP ready?** The `elice-material` tools must be available. If not, ask the person to run `ecdk setup --only mcp` 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. **Content and answers.** Check whether the input schema of `save_draft` (or `update_material`) lists `settings` as a key of `payload` (on an older server, a top-level parameter). If it does and this project has `.ecdk/settings.json`: make sure the edit screen saved it (the person saves the edit view in `ecdk dev`; a file you wrote by hand must go through that save), run `ecdk doctor` and send no `settings` while its `project.grading` check fails (tell the person why, never the answer values; they fix it in the edit view), show a short summary (title, number of questions or items, answers included or not and `grading.type`, never the answer values) and ask for an explicit yes to send it with the upload. `settings` replaces the page's settings as a whole: on a page that already has a version, compare `get_material`'s settings with the file first, and if keys would disappear or the LXP content differs (an instructor edited it in LXP), show the difference briefly and ask before overwriting (a new page needs no comparison). No file: suggest filling the edit view in `ecdk dev` first, or skip it. No `settings` key, or the person says no: zip only (the fallback). Details: `references/12-upload-with-the-material-mcp.md` "Content and answers (settings)".
|
|
16
|
+
3. **Content and answers.** Check whether the input schema of `save_draft` (or `update_material`) lists `settings` as a key of `payload` (on an older server, a top-level parameter). If it does and this project has `.ecdk/settings.json`: make sure the edit screen saved it (the person saves the edit view in `ecdk dev`; a file you wrote by hand must go through that save), run `ecdk doctor` and send no `settings` while its `project.grading` or `project.quiz` check fails (tell the person why, never the answer values; they fix it in the edit view), show a short summary (title, number of questions or items, answers included or not and `grading.type`, never the answer values) and ask for an explicit yes to send it with the upload. `settings` replaces the page's settings as a whole: on a page that already has a version, compare `get_material`'s settings with the file first, and if keys would disappear or the LXP content differs (an instructor edited it in LXP), show the difference briefly and ask before overwriting (a new page needs no comparison). Adding images to a page that already has a version: merge its current settings (`get_material` or `get_draft`) into `.ecdk/settings.json` first, keeping `asset:` images as they are (`references/12-upload-with-the-material-mcp.md` item 8). No file: suggest filling the edit view in `ecdk dev` first, or skip it. No `settings` key, or the person says no: zip only (the fallback). Details: `references/12-upload-with-the-material-mcp.md` "Content and answers (settings)".
|
|
17
17
|
4. **Completion policy.** If `save_draft` (or `update_material`) lists `completion_policy` in its input schema (in `payload`), propose one (`references/12-upload-with-the-material-mcp.md` "Completion policy"): graded (the quiz template, or settings with `grading`) → `on_graded`, submits without grading → `on_submit`, no submission → `on_access`. `on_graded` only when the same save carries `settings` with `grading` (or the page already has grading); otherwise no policy at the first save, or `on_submit` if the person wants it (ask). Tell the person that only `on_graded` grades: `on_submit` completes on any submission without grading ("제출했어요."), `on_access` completes on open. The policy is a page setting and applies at once.
|
|
18
18
|
5. **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, its LXP edit URL, whether content and answers go with it and the completion policy to set (the page's current one too), 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. If the page already has content or answers saved in LXP, say that sending settings replaces them and ask again.
|
|
19
|
-
6. **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.
|
|
19
|
+
6. **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. Images or a PDF/PPTX for the settings: only now (draft ready), `create_asset_upload` per file → its `curl_command`, and put the returned `key`, never the URL, into the merged settings (`references/12-upload-with-the-material-mcp.md` "Images and documents"); no such tool: zip images, and tell the person.
|
|
20
20
|
7. **Approve.** Show what changes (page, title, whether the content and answers go with it or are entered on the LXP edit screen after saving, the completion policy) and the draft `preview_urls`. Saving is visible to learners at once if the page is open. Wait for an explicit yes.
|
|
21
21
|
8. **Save.** One `save_draft` with `material_draft_id`, `expected_current_version_id` and `payload` holding only keys its schema lists: `settings` (the content of `.ecdk/settings.json`) only when step 3 got a yes, `completion_policy` only when step 4 got a yes, and `title` · `icon` when the page has none (a new page; icon: `references/12-upload-with-the-material-mcp.md` "Icon"), all in this one save so no extra version is made. On `MATERIAL_CHANGED` or `MATERIAL_GRADING_REQUIRED`, stop and tell the person (`references/12-upload-with-the-material-mcp.md` "Errors and warnings").
|
|
22
22
|
9. **Check.** Show any `warnings` in the result to the person close to word for word. `get_material` must show what was sent: the settings (same keys, item count and `grading.type` as the summary), the completion policy, the title. If not, tell the person and use the fallback. Without settings: tell the person to enter the content and answers in the LXP edit screen, save with its own button, then press '수업 자료에 반영' at the top of the LXP edit page (`references/12-upload-with-the-material-mcp.md` "Fallback"); for a graded material, then pick 답안 확인 후 완료 in the '설정' panel at the top of the LXP edit page, or offer to set `on_graded` with `update_material` (when it takes `completion_policy`) once `get_material` shows the grading. No `completion_policy` key: tell the person which policy to pick in that '설정' panel. `update_material` stopping with `MATERIAL_DRAFT_PENDING`: someone's upload is not saved; explain and ask whether to save it (`save_draft`) or discard it (`discard_draft`), never pick for them.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# AI 작업 안내 (ecdk 프로젝트)
|
|
2
|
+
|
|
3
|
+
Elice Custom HTML 학습자료 프로젝트입니다. `ecdk create`가 만든 파일이고, 자료(zip)에는 들어가지 않습니다.
|
|
4
|
+
|
|
5
|
+
- 이 프로젝트 작업은 `elice-content-*` 스킬을 열고 그 단계를 따릅니다: 이미 있는 자료의 문항 · 정답 · 배점 고치기는 `elice-content-edit`, 새로 만들기 `elice-content-create`, 오류 · 질문 `elice-content-check`, LXP에 올리기 `elice-content-publish`. 스킬이 없으면 사람에게 `ecdk setup --only skills`를 안내합니다.
|
|
6
|
+
- `core/`(템플릿 동작 · 채점 약속)와 `lib/`(화면 키트)는 고치지 않습니다. 템플릿에 없는 기능(예: 주관식 대소문자 · 띄어쓰기 무시)을 부탁받으면 지금 되는 방법(허용 답을 여러 개 넣기, 퀴즈 1.10.0 이상이면 사람이 고를 때 주관식 정규식 입력 등)을 제안하고, 그걸로 안 되면 템플릿 기능 요청으로 사람에게 알립니다.
|
|
7
|
+
- 사람이 쓴 언어로 답합니다.
|
|
8
|
+
- `.ecdk/settings.json`(편집 화면이 저장한 내용 · 정답)을 고친 뒤에는 `ecdk doctor`를 실행해 `project.grading` · `project.quiz`가 실패하지 않는지 확인합니다. 문항 · 보기 id는 그대로 두고, 정답 정규식은 손으로 쓰지 않습니다.
|
|
9
|
+
- 정답 · 허용 답 · 배점(배점 나누기 포함) · 문제 제목은 사람이 정합니다. 이미 있는 자료에서 요청에 적히지 않은 값은 바꾸기 전에 묻고(번역할 때의 주관식 정답 포함), 요청한 것만 바꿉니다.
|
|
10
|
+
- 내용 · 정답을 고친 뒤 보고 끝에: `ecdk dev`의 내용 편집 화면(주소)을 열어 저장 버튼('초안으로 저장')을 한 번 누르라고 안내합니다. 편집 화면의 검사가 그때 돌고, 그 뒤에 올립니다.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@AGENTS.md
|