@eliceio/cdk-cli 1.3.0-contenttypes.2 → 1.3.0

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.
Files changed (46) hide show
  1. package/README.md +97 -91
  2. package/es/commands/dev/index.d.ts +1 -1
  3. package/es/commands/dev/index.js +2 -1
  4. package/es/commands/doctor/index.d.ts +1 -1
  5. package/es/commands/doctor/index.js +38 -3
  6. package/es/commands/setup/index.d.ts +1 -1
  7. package/es/commands/setup/index.js +1 -1
  8. package/es/commands/uninstall/index.d.ts +1 -1
  9. package/es/commands/uninstall/index.js +1 -1
  10. package/es/core/collect.js +3 -1
  11. package/es/core/quiz-check.d.ts +21 -0
  12. package/es/core/quiz-check.js +364 -0
  13. package/es/dev/host-page.js +8 -5
  14. package/es/dev/mock-api.d.ts +3 -1
  15. package/es/rules/check.js +6 -0
  16. package/es/rules/privacy.d.ts +20 -0
  17. package/es/rules/privacy.js +177 -0
  18. package/es/rules.json.js +1 -1
  19. package/package.json +2 -2
  20. package/rules.json +7 -1
  21. package/skills/_shared/always.md +6 -3
  22. package/skills/_shared/references/00-what-the-person-decides.md +3 -2
  23. package/skills/_shared/references/02-design-the-material.md +12 -6
  24. package/skills/_shared/references/03-create-the-project.md +9 -9
  25. package/skills/_shared/references/04-rules.md +2 -0
  26. package/skills/_shared/references/05-screen-code.md +2 -0
  27. package/skills/_shared/references/06-using-the-quiz-template.md +10 -2
  28. package/skills/_shared/references/07-move-existing-html.md +1 -1
  29. package/skills/_shared/references/08-fix-check-errors.md +26 -23
  30. package/skills/_shared/references/09-check.md +1 -1
  31. package/skills/_shared/references/12-upload-with-the-material-mcp.md +3 -2
  32. package/skills/_shared/references/15-edit-settings-by-hand.md +184 -0
  33. package/skills/elice-content-check/SKILL.md +1 -1
  34. package/skills/elice-content-create/SKILL.md +3 -3
  35. package/skills/elice-content-edit/SKILL.md +26 -0
  36. package/skills/elice-content-migrate/SKILL.md +2 -1
  37. package/skills/elice-content-publish/SKILL.md +1 -1
  38. package/templates/_shared/AGENTS.md +10 -0
  39. package/templates/_shared/CLAUDE.md +1 -0
  40. package/templates/_shared/lib/cdk-mock.js +28 -7
  41. package/templates/blank/package.json +1 -1
  42. package/templates/blank/template.json +1 -1
  43. package/templates/quiz/package.json +1 -1
  44. package/templates/quiz/template.json +1 -1
  45. package/templates/steps/package.json +1 -1
  46. package/templates/steps/template.json +1 -1
@@ -0,0 +1,177 @@
1
+ import { lineAt } from './refs.js';
2
+ import { lineSkipper } from './skip.js';
3
+
4
+ /**
5
+ * privacy.personal-field (warn): 학습자 개인정보를 받거나 저장 · 전송하는 것으로 보이는 화면 코드.
6
+ * 화면 HTML · JS(키트 lib/ · 라이브러리 제외)를 정규식으로 본다. 흐름은 따라가지 않으므로 경고만이고,
7
+ * 개인정보를 다루는 법을 가르치는 실습처럼 정당한 경우는 `ecdk-ignore-next-line privacy.personal-field`와 이유로 넘긴다.
8
+ *
9
+ * - (a) 개인정보를 받는 입력 칸: `<input type="tel|email">`, `autocomplete`가 이름 · 연락처 · 주소 · 생일 · 카드 값
10
+ * - (b) 입력 칸(input · textarea · select)의 name · id · placeholder · aria-label이나 `<label>` 글에 개인정보 단어
11
+ * (주소 · address는 IP 주소 · 메모리 주소와 헷갈려 빼고, birth는 출생률과 헷갈려 birthday · birthdate만)
12
+ * - (c) 제출 · kvstore 저장 인자의 key가 개인정보 이름 (phone · email · 학번 …)
13
+ * - (d) `account.fullname`(학습자 이름)을 제출 · 저장 · 업로드 · AI 호출 인자에 넣음
14
+ *
15
+ * HTML 파일과 JS 문자열(템플릿 문자열 · html`…`)의 태그를 같은 정규식으로 본다.
16
+ */
17
+ const PRIVACY_RULE = 'privacy.personal-field';
18
+ const FIX = '학습자 구분은 app.account.anonymousId(SDK account.anonymousId)로, 이름은 app.account.fullname을 화면에 보여 주기만 하고, 설문은 이름 · 연락처를 묻지 않는 익명 문항으로 바꿔 주세요. 개인정보를 받지 않는 정당한 코드면(예: 입력값을 저장 · 전송하지 않는 형식 검사 실습) 그 줄 위에 // ecdk-ignore-next-line privacy.personal-field와 이유를 남겨 주세요. 참고: 스킬 참고 문서 02-design-the-material.md "Personal data"';
19
+ const WHY = '제출 · 저장한 값은 서버에 남아 교육자 · 운영자가 보고, AI 호출 본문은 외부 모델로 갑니다.';
20
+ /** (a) 개인정보를 받는 autocomplete 값 (HTML autofill 토큰) */
21
+ const PERSONAL_AUTOCOMPLETE = /^(?:name|given-name|family-name|tel|email|street-address|postal-code|bday(?:-.+)?|cc-.+)$/;
22
+ /**
23
+ * (b) 입력 칸 이름 · 안내 글의 개인정보 단어. 주소 · address(IP 주소 · 메모리 주소), birth 하나(출생률),
24
+ * mobile(모바일 화면)은 오탐이 많아 뺀다
25
+ */
26
+ const PERSONAL_WORDS_KO = /전화|휴대폰|핸드폰|연락처|이메일|주민|생년월일|학번|계좌/;
27
+ const PERSONAL_WORD_TOKENS = new Set(['phone', 'telephone', 'cellphone', 'tel', 'email', 'ssn', 'rrn', 'birthday', 'birthdate', 'dob']);
28
+ function personalWord(text) {
29
+ const ko = text.match(PERSONAL_WORDS_KO);
30
+ if (ko) return ko[0];
31
+ const tokens = keyTokens(text);
32
+ const hit = tokens.find((t, i) => PERSONAL_WORD_TOKENS.has(t) || t === 'e' && tokens[i + 1] === 'mail');
33
+ return hit === undefined ? null : hit === 'e' ? 'e-mail' : hit;
34
+ }
35
+ /** (c) 개인정보 이름의 key (camelCase · snake_case를 나눈 조각) */
36
+ const PERSONAL_KEY_TOKENS = new Set(['phone', 'telephone', 'cellphone', 'tel', 'mobile', 'email', 'ssn', 'rrn', 'birth', 'birthday', 'birthdate', 'dob', 'fullname']);
37
+ const PERSONAL_KEY_KO = /주민|연락처|전화|휴대폰|핸드폰|이메일|학번|생년월일|계좌/;
38
+ function keyTokens(key) {
39
+ return key.replace(/([a-z0-9])([A-Z])/g, '$1 $2').split(/[^A-Za-z0-9]+/).filter(Boolean).map(t => t.toLowerCase());
40
+ }
41
+ function isPersonalKey(key) {
42
+ if (PERSONAL_KEY_KO.test(key)) return true;
43
+ const tokens = keyTokens(key);
44
+ if (tokens.some(t => PERSONAL_KEY_TOKENS.has(t))) return true;
45
+ // studentId · student_no · e_mail
46
+ return tokens.some((t, i) => t === 'student' && ['id', 'no', 'num', 'number'].includes(tokens[i + 1] ?? '') || t === 'e' && tokens[i + 1] === 'mail');
47
+ }
48
+ /** 저장 · 전송 호출. (c)는 제출 · kvstore만, (d)는 모두 */
49
+ const SEND_CALL = /\b(?:(submit|useSubmit|saveSettings|useSave|saveContent)|(kvstore)\??\.post|(mlapi)\??\.fetch|(assets)\??\.post)\s*\(/g;
50
+ const FULLNAME = /\baccount\??\.fullname\b/g;
51
+ const OBJECT_KEY = /[{,]\s*(?:(["'])([^"'\n]+)\1|([A-Za-z_$가-힣][\w$가-힣]*))\s*:(?!:)/g;
52
+ const KV_KEY = /\bkey\s*:\s*(["'`])([^"'`\n]*)\1/g;
53
+ /** `(` 다음부터 짝이 맞는 `)`까지 (한 줄 문자열 '…' · "…" 안 괄호는 셈하지 않음, 너무 길면 자름) */
54
+ function callArgs(text, open, max = 4000) {
55
+ let depth = 0;
56
+ let quote = null;
57
+ const end = Math.min(text.length, open + max);
58
+ for (let i = open; i < end; i++) {
59
+ const c = text[i];
60
+ if (quote) {
61
+ if (c === '\\') i++;else if (c === quote || c === '\n') quote = null;
62
+ continue;
63
+ }
64
+ if (c === '"' || c === "'") quote = c;else if (c === '(') depth++;else if (c === ')' && --depth === 0) return text.slice(open + 1, i);
65
+ }
66
+ return text.slice(open + 1, end);
67
+ }
68
+ /** 태그 하나의 속성 (refs.ts parseTags와 같은 문법, 줄 번호용 위치 포함) */
69
+ const TAG = /<(input|textarea|select|label)\b((?:[^>"']|"[^"]*"|'[^']*')*)>/gi;
70
+ const ATTR = /([^\s"'=<>/]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;
71
+ function attrsOf(raw) {
72
+ const attrs = new Map();
73
+ for (const a of raw.matchAll(ATTR)) attrs.set((a[1] ?? '').toLowerCase(), (a[2] ?? a[3] ?? a[4] ?? '').trim());
74
+ return attrs;
75
+ }
76
+ /** 템플릿 문자열의 ${…} 자리 (값이 아니라 코드라 단어 검사에서 뺀다) */
77
+ const stripInterp = s => s.replace(/\$\{[^}]*\}/g, ' ');
78
+ function fieldFindings(text) {
79
+ const out = [];
80
+ for (const m of text.matchAll(TAG)) {
81
+ const tag = (m[1] ?? '').toLowerCase();
82
+ const attrs = attrsOf(m[2] ?? '');
83
+ if (tag === 'label') {
84
+ const after = text.slice(m.index + m[0].length, m.index + m[0].length + 200);
85
+ const words = stripInterp(after.split(/<\/label\s*>|</i)[0] ?? '');
86
+ const hit = personalWord(words);
87
+ if (hit) out.push({
88
+ index: m.index,
89
+ message: `개인정보를 묻는 입력 칸 같습니다 (<label> "${hit}"). ${WHY} ${FIX}`
90
+ });
91
+ continue;
92
+ }
93
+ const type = attrs.get('type')?.toLowerCase();
94
+ if (tag === 'input' && (type === 'tel' || type === 'email')) {
95
+ out.push({
96
+ index: m.index,
97
+ message: `개인정보를 받는 입력 칸입니다 (<input type="${type}">). ${WHY} ${FIX}`
98
+ });
99
+ continue;
100
+ }
101
+ const auto = (attrs.get('autocomplete') ?? '').toLowerCase().split(/\s+/).find(t => PERSONAL_AUTOCOMPLETE.test(t));
102
+ if (auto) {
103
+ out.push({
104
+ index: m.index,
105
+ message: `개인정보를 받는 입력 칸입니다 (autocomplete="${auto}"). ${WHY} ${FIX}`
106
+ });
107
+ continue;
108
+ }
109
+ for (const name of ['name', 'id', 'placeholder', 'aria-label']) {
110
+ const value = stripInterp(attrs.get(name) ?? '');
111
+ if (!personalWord(value)) continue;
112
+ out.push({
113
+ index: m.index,
114
+ message: `개인정보를 묻는 입력 칸 같습니다 (<${tag} ${name}="${attrs.get(name)}">). ${WHY} ${FIX}`
115
+ });
116
+ break;
117
+ }
118
+ }
119
+ return out;
120
+ }
121
+ function sendFindings(text) {
122
+ const out = [];
123
+ for (const m of text.matchAll(SEND_CALL)) {
124
+ const call = m[1] ?? (m[2] ? 'kvstore.post' : m[3] ? 'mlapi.fetch' : 'assets.post');
125
+ const open = m.index + m[0].length - 1;
126
+ const args = callArgs(text, open);
127
+ const argsAt = open + 1;
128
+ // (d) 이름: 호출 인자 안, 또는 호출과 같은 줄
129
+ const lineStart = text.lastIndexOf('\n', m.index) + 1;
130
+ const lineEnd = text.indexOf('\n', m.index);
131
+ const sameLine = text.slice(lineStart, lineEnd < 0 ? text.length : lineEnd);
132
+ const inArgs = [...args.matchAll(FULLNAME)][0];
133
+ const onLine = [...sameLine.matchAll(FULLNAME)][0];
134
+ if (inArgs || onLine) out.push({
135
+ index: inArgs ? argsAt + inArgs.index : lineStart + (onLine?.index ?? 0),
136
+ message: `학습자 이름(account.fullname)을 ${call}로 저장 · 전송합니다. ${WHY} ${FIX}`
137
+ });
138
+ // (c) 개인정보 이름의 key: 제출 · kvstore 저장만
139
+ if (!(m[1] === 'submit' || m[1] === 'useSubmit' || m[2])) continue;
140
+ const keys = [];
141
+ for (const k of args.matchAll(OBJECT_KEY)) {
142
+ const key = k[2] ?? k[3] ?? '';
143
+ keys.push({
144
+ key,
145
+ index: argsAt + k.index + k[0].indexOf(key)
146
+ });
147
+ }
148
+ if (m[2]) for (const k of args.matchAll(KV_KEY)) for (const part of (k[2] ?? '').split('.')) keys.push({
149
+ key: part.replace(/\$\{[^}]*\}/g, ''),
150
+ index: argsAt + k.index
151
+ });
152
+ const hit = keys.find(k => isPersonalKey(k.key));
153
+ if (hit) out.push({
154
+ index: hit.index,
155
+ message: `개인정보 이름의 key(${hit.key})를 ${call}로 저장 · 전송합니다. ${WHY} ${FIX}`
156
+ });
157
+ }
158
+ return out;
159
+ }
160
+ /** 화면 HTML · JS 하나에서 찾은 곳 (주석뿐인 줄 · ecdk-ignore로 끈 줄 제외, 같은 줄은 하나만) */
161
+ function privacyFindings(text) {
162
+ const skip = lineSkipper(text);
163
+ const seen = new Set();
164
+ const out = [];
165
+ for (const f of [...fieldFindings(text), ...sendFindings(text)].sort((a, b) => a.index - b.index)) {
166
+ const line = lineAt(text, f.index);
167
+ if (seen.has(line) || skip.isSkipped(line, PRIVACY_RULE)) continue;
168
+ seen.add(line);
169
+ out.push({
170
+ line,
171
+ message: f.message
172
+ });
173
+ }
174
+ return out;
175
+ }
176
+
177
+ export { PRIVACY_RULE, privacyFindings };
package/es/rules.json.js CHANGED
@@ -1,3 +1,3 @@
1
- const version="0.18.0";const manifest={file:"metadata.json",kinds:["material","description"],defaultKind:"material",modes:["learn","instructor","edit"],required:["learn"],kindModes:{material:["learn","instructor","edit"],description:["learn"]},graderTypes:["pattern","partial_pattern","rubric"],commentaryFile:"commentary.txt",defaultEntry:"index.html"};const externalAllow={"style-src":[],"font-src":[]};const minVersions={sdk:"1.0.0-alpha.4"};const layouts={content:["single","split","stage","media"],regions:["main","aside","stage","controls","readout","actions"]};const limits={maxZipBytes:20971520,maxUnpackedBytes:209715200,maxFiles:300,maxEntries:3000,warnRatio:0.8,maxImageBytes:1048576,maxScreenBytes:1572864};const allowedExtensions=["html","htm","css","js","mjs","json","map","txt","md","csv","xml","vtt","svg","png","jpg","jpeg","gif","webp","avif","ico","bmp","mp3","wav","ogg","m4a","mp4","webm","woff","woff2","ttf","otf","glb","gltf","bin","wasm","pdf"];const imageExtensions=["png","jpg","jpeg","gif","webp","avif","bmp","svg"];const excluded={secret:{level:"error",files:[".env",".env.*","elice.config.*","grading.json","answers.*","*.pem","*.key"],dirs:[]},dev:{level:"error",files:[],dirs:[".git","node_modules",".ecdk"]},junk:{level:"warn",files:[".DS_Store","Thumbs.db","desktop.ini"],dirs:["__MACOSX"]}};const forbiddenApis=[{id:"api.parent-access",pattern:"\\bwindow\\.(?:top|parent)\\b|\\b(?:top|parent)\\.(?:document|location)\\b",title:"부모 창 직접 접근 (다른 출처라 막힘, SDK 사용)"},{id:"api.cookie",pattern:"\\bdocument\\.cookie\\b",title:"쿠키 사용 (이 브라우저에만 남고 학습 기록이 아님, 남길 입력값은 SDK로 저장)"},{id:"api.storage",pattern:"\\b(?:localStorage|sessionStorage|indexedDB)\\b",title:"브라우저 저장소 사용 (이 브라우저 · 기기에만 남고 학습 기록이 아님, 남길 입력값은 SDK로 저장)"},{id:"api.eval",pattern:"\\beval\\s*\\(|\\bnew\\s+Function\\s*\\(|\\bset(?:Timeout|Interval)\\s*\\(\\s*[\"'`]",title:"eval · new Function · 문자열 setTimeout 사용"},{id:"api.dialog",pattern:"\\b(?:alert|confirm|prompt)\\s*\\(",title:"alert · confirm · prompt 사용 (sandbox에서 막힘, 화면 안 메시지로)"},{id:"api.window-open",pattern:"\\bwindow\\.open\\s*\\(",title:"새 창 열기 (sandbox에서 막힘)"},{id:"api.external-send",pattern:"(?<!\\bmlapi\\??\\.)\\b(?:fetch|sendBeacon|EventSource|WebSocket)\\s*\\(\\s*['\"`](?:https?|wss?):\\/\\/|\\.open\\(\\s*['\"`][A-Za-z]+['\"`]\\s*,\\s*['\"`]https?:\\/\\/",title:"외부 주소로 요청을 보냄 (학생 정보 유출 위험)"},{id:"sec.html-injection",pattern:"\\.(?:inner|outer)HTML\\s*\\+?=(?!=)(?!\\s*(?:'[^'\\n]*'|\"[^\"\\n]*\"|`[^`$\\n]*`)\\s*(?:[;,)}\\n]|$))|\\.insertAdjacentHTML\\s*\\(|\\bdocument\\.write(?:ln)?\\s*\\(|\\bdangerouslySetInnerHTML\\b",title:"HTML 문자열을 그대로 넣음 (XSS 위험, textContent나 이스케이프 사용)"},{id:"sec.redirect",pattern:"\\blocation(?:\\.href)?\\s*=(?!=)(?!\\s*[\"'`][^\"'`$]*[\"'`])|\\blocation\\.(?:replace|assign)\\s*\\((?!\\s*[\"'`][^\"'`$]*[\"'`]\\s*\\))",title:"주소를 값으로 바꿈 (열린 리디렉션 · javascript: XSS 위험)"},{id:"sec.postmessage-wildcard",pattern:"\\.postMessage\\s*\\([^;]*?,\\s*[\"'`]\\*[\"'`]",title:"postMessage 대상이 * (아무 창이나 받을 수 있음)"},{id:"sandbox.fetch-local",pattern:"(?<!\\bmlapi\\??\\.)\\bfetch\\(\\s*(['\"`])(?![a-z][a-z0-9+.-]*:|//)[^'\"`]*(?<!\\.json)\\1|\\bimport\\(\\s*(?!['\"`])[A-Za-z_$]|\\bnew\\s+(?:Shared)?Worker\\(\\s*['\"`](?![a-z][a-z0-9+.-]*:|//)",title:"zip 안 파일을 fetch · 변수 import() · Worker로 읽음 (콘텐츠 서버의 sandbox 헤더에 allow-same-origin이 없으면 CORS로 막힘)"}];const secretPatterns=[{source:"elice-hardcoded-private-key · detected-private-key · detected-pgp-private-key-block",title:"개인키",pattern:"-----BEGIN[ A-Z0-9_-]*PRIVATE KEY(?: BLOCK)?-----"},{source:"elice-hardcoded-secret",title:"하드코딩된 비밀 값",pattern:"(?:secret|token|api[_-]?key|access[_-]?key|password|passwd)\\s*[:=]\\s*[\"'][A-Za-z0-9_\\-/+]{16,}[\"']",flags:"i",not:"os\\.environ|getenv|process\\.env|dotenv|\\$\\{|<[a-z_]+>|example|dummy|placeholder|changeme|xxxx|your[_-]"},{source:"detected-aws-access-key-id-value",title:"AWS 액세스 키",pattern:"\\b(?:A3T[A-Z0-9]|AKIA|AGPA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}\\b",not:"example|sample|test|fake"},{source:"detected-aws-secret-access-key",title:"AWS 비밀 키",pattern:"[\"'`]?aws_?\\w*secret_?\\w*[\"'`]?\\s{0,50}(?::|=>|=)\\s{0,50}[\"'`]?[A-Za-z0-9/+=]{40}",flags:"i",not:"example|sample|test|fake|xxxxxx"},{source:"detected-aws-session-token",title:"AWS 세션 토큰",pattern:"AWS_SESSION_TOKEN\\s*(?::|=>|=)\\s*[A-Za-z0-9/+=]{16,}",flags:"i",not:"example|sample|test|fake"},{source:"detected-aws-appsync-graphql-key",title:"AWS AppSync 키",pattern:"da2-[a-z0-9]{26}"},{source:"detected-amazon-mws-auth-token",title:"Amazon MWS 토큰",pattern:"amzn\\.mws\\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"},{source:"detected-artifactory-token",title:"Artifactory 토큰",pattern:"\\bAKC[a-zA-Z0-9]{10,}\\n",not:"sha(?:128|256|512)"},{source:"detected-artifactory-password",title:"Artifactory 비밀번호",pattern:"[Aa][Rr][Tt][Ii][-_]?[Ff][Aa][Cc][Tt][Oo][Rr][Yy].*\\bAP[\\dA-F][a-zA-Z0-9]{8,}|\\bAP[\\dA-F][a-zA-Z0-9]{8,}.*[Aa][Rr][Tt][Ii][-_]?[Ff][Aa][Cc][Tt][Oo][Rr][Yy]",not:"sha(?:1|2|3|118|256|512)"},{source:"detected-bcrypt-hash",title:"bcrypt 해시",pattern:"\\$2[aby]?\\$\\d+\\$[./A-Za-z0-9]{53}"},{source:"detected-codeclimate",title:"Code Climate 토큰",pattern:"codeclima.{0,50}[\"'`]?[0-9a-f]{64}",flags:"i"},{source:"detected-etc-shadow",title:"/etc/shadow 내용",pattern:"^\\s*root:[x!*]*:\\d*:\\d*",flags:"m"},{source:"detected-facebook-access-token",title:"Facebook 액세스 토큰",pattern:"EAACEdEose0cBA[0-9A-Za-z]+|EAAAACZAVC6ygB[0-9A-Za-z]+|EAAAAZAw4[0-9A-Za-z]+"},{source:"detected-facebook-oauth",title:"Facebook OAuth 비밀",pattern:"[fF][aA][cC][eE][bB][oO][oO][kK].*[tT][oO][kK][eE][nN].*[\"'`]?[0-9a-f]{32}"},{source:"detected-google-gcm-service-account",title:"Google 서비스 계정 키",pattern:"[\"'`]?type[\"'`]?\\s{0,50}(?::|=>|=)\\s{0,50}[\"'`]?service_account"},{source:"detected-google-oauth-access-token",title:"Google OAuth 토큰",pattern:"ya29\\.[0-9A-Za-z_-]+"},{source:"detected-heroku-api-key",title:"Heroku API 키",pattern:"[hH][eE][rR][oO][kK][uU].*[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}"},{source:"detected-hockeyapp",title:"HockeyApp 토큰",pattern:"hockey.{0,50}[\"'`]?[0-9a-f]{32}",flags:"i"},{source:"detected-mailchimp-api-key",title:"Mailchimp API 키",pattern:"[0-9a-f]{32}-us\\d{1,2}"},{source:"detected-mailgun-api-key",title:"Mailgun API 키",pattern:"key-[0-9a-zA-Z]{32}"},{source:"detected-onfido-live-api-token",title:"Onfido API 토큰",pattern:"api_live(?:_[a-zA-Z]{2})?\\.[a-zA-Z0-9_-]{11}\\.[a-zA-Z0-9_-]{32}"},{source:"detected-outlook-team",title:"Outlook 웹훅",pattern:"https://outlook\\.office\\.com/webhook/[0-9a-f-]{36}"},{source:"detected-paypal-braintree-access-token",title:"PayPal Braintree 토큰",pattern:"access_token\\$production\\$[0-9a-z]{16}\\$[0-9a-z]{32}"},{source:"detected-picatic-api-key",title:"Picatic API 키",pattern:"sk_live_[0-9a-z]{32}"},{source:"detected-sauce-token",title:"Sauce Labs 토큰",pattern:"sauce.{0,50}[\"'`]?[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}",flags:"i"},{source:"detected-slack-token",title:"Slack 토큰",pattern:"xox[pboa]-\\d{12}-\\d{12}-\\d{12}-[a-z0-9]{32}|xox.-\\d{12}-\\d{12}-[0-9a-zA-Z]{24}"},{source:"detected-slack-webhook",title:"Slack 웹훅",pattern:"https://hooks\\.slack\\.com/services/T[a-zA-Z0-9_]{8,10}/B[a-zA-Z0-9_]{8,10}/[a-zA-Z0-9_]{24}",not:"T00000000/B00000000/X{24}"},{source:"detected-sonarqube-docs-api-key",title:"SonarQube 토큰",pattern:"sonar[a-z0-9_.-]{0,30}(?:token|key|login|password|pass|secret|auth)?\\s*[:=]\\s*\\\\?[\"'`]?[0-9a-f]{40}\\b",flags:"i"},{source:"detected-square-access-token",title:"Square 액세스 토큰",pattern:"sq0atp-[0-9A-Za-z_-]{22}"},{source:"detected-square-oauth-secret",title:"Square OAuth 비밀",pattern:"sq0csp-[0-9A-Za-z\\\\_-]{43}"},{source:"detected-ssh-password",title:"sshpass 비밀번호",pattern:"sshpass[ ]-p\\s*['\"]"},{source:"detected-stripe-api-key",title:"Stripe API 키",pattern:"sk_live_[0-9a-zA-Z]{24}"},{source:"detected-stripe-restricted-api-key",title:"Stripe 제한 키",pattern:"rk_live_[0-9a-zA-Z]{24}"},{source:"detected-telegram-bot-api-key",title:"Telegram 봇 토큰",pattern:"\\d+:AA[0-9A-Za-z_-]{33}",not:"go\\.mod|v\\d+\\.\\d+\\.\\d+"},{source:"detected-twilio-api-key",title:"Twilio API 키",pattern:"SK[0-9a-fA-F]{32}"},{source:"detected-username-and-password-in-uri",title:"주소에 들어 있는 아이디 · 비밀번호",pattern:"[A-Za-z0-9+.-]*(?:http|sql|ftp|smtp)[A-Za-z0-9+.-]*://\\{?[A-Za-z][A-Za-z0-9_-]{5,31}\\}?:(?=[^\\s@/]*\\d)(?=[^\\s@/]*[a-z])(?=[^\\s@/]*[A-Z])(?=[^\\s@/]*[!-.:-?\\[-`{-~])[^\\s@/]{6,32}@"}];const rules=[{id:"manifest.missing",level:"error",scope:"server",title:"metadata.json 없음"},{id:"manifest.invalid",level:"error",scope:"server",title:"metadata.json 형식 오류"},{id:"manifest.entry-missing",level:"error",scope:"server",title:"metadata.json에 적은 파일(진입 파일 · 학습 참고 내용)이 없음"},{id:"manifest.commentary-missing",level:"error",scope:"server",title:"학습 참고 내용 파일(commentary.txt) 없음 (LXP 업로드가 거절함)"},{id:"manifest.grading-types",level:"warn",scope:"server",title:"쓰지 않는 gradingTypes (완료 정책은 LXP 설정, 채점 방식은 편집 화면)"},{id:"manifest.completion-policies-ignored",level:"warn",scope:"client",title:"쓰지 않는 completionPolicies · 완료 정책 화면(screens.completionPolicy) (완료 정책은 LXP 설정, build가 zip에서 뺌)"},{id:"entry.missing",level:"error",scope:"server",title:"학생 화면 진입 파일 없음"},{id:"entry.nested",level:"error",scope:"server",title:"폴더째 묶은 zip (metadata.json이 최상위에 없음)"},{id:"input.not-zip",level:"error",scope:"server",title:"zip이 아닌 업로드 (HTML 파일 하나 등)"},{id:"limit.zip-size",level:"error",scope:"server",title:"zip 크기 한도 초과"},{id:"limit.file-count",level:"error",scope:"server",title:"파일 개수 한도 초과"},{id:"limit.unpacked-size",level:"error",scope:"server",title:"풀면 너무 큰 zip (압축 폭탄 의심)"},{id:"limit.near",level:"warn",scope:"client",title:"한도에 가까움"},{id:"limit.screen-size",level:"warn",scope:"client",title:"화면 하나를 열 때 받는 JS · CSS가 큼 (기준 limits.maxScreenBytes, 큰 라이브러리는 import()로)"},{id:"path.unsafe",level:"error",scope:"server",title:"안전하지 않은 경로 (절대경로, .., 역슬래시, 정규화 안 됨)"},{id:"path.case-collision",level:"error",scope:"server",title:"대소문자만 다른 경로"},{id:"path.non-ascii",level:"warn",scope:"client",title:"공백·한글 등 ASCII 밖 문자가 든 경로"},{id:"file.extension",level:"error",scope:"server",title:"허용하지 않는 확장자"},{id:"file.secret",level:"error",scope:"server",title:"정답·비밀 파일 포함"},{id:"file.dev",level:"error",scope:"server",title:"개발용 폴더 포함"},{id:"file.junk",level:"warn",scope:"server",title:"운영체제가 만든 불필요한 파일"},{id:"file.large-image",level:"warn",scope:"client",title:"1MB 넘는 이미지"},{id:"file.encoding",level:"error",scope:"client",title:"UTF-8이 아닌 텍스트 파일 (한글이 깨짐)"},{id:"file.bom",level:"warn",scope:"client",title:"학습 참고 내용 맨 앞의 BOM (보이지 않는 글자)"},{id:"content.answer-key",level:"warn",scope:"client",title:"학생에게 내려가는 JSON에 정답처럼 보이는 키"},{id:"grading.no-submit",level:"warn",scope:"client",title:"편집 화면이 채점 설정을 저장하는데 화면 코드에 제출이 없음"},{id:"edit.no-save",level:"warn",scope:"client",title:"편집 화면인데 저장이 없음"},{id:"project.legacy-file",level:"warn",scope:"client",title:"더 쓰지 않는 프로젝트 파일(elice.config.json · content.json · grading.json)이 남아 있음 (프로젝트 검사만, ADR 0011)"},{id:"build.template-unknown",level:"warn",scope:"client",title:"metadata.json build.template이 이 ecdk가 모르는 템플릿이거나 더 새 템플릿 버전"},{id:"layout.unknown",level:"warn",scope:"client",title:"data-ec-layout · data-ec-region에 키트가 모르는 값 (single · split · stage · media, main · aside · stage · controls · readout · actions)"},{id:"layout.own-step-nav",level:"warn",scope:"client",title:"화면 코드가 이전 · 다음 버튼을 직접 그림 (LXP 이전 · 다음 막대와 헷갈림, 키트 app.useStepper)"},{id:"ref.missing",level:"error",scope:"client",title:"참조한 파일이 없음"},{id:"ref.case-mismatch",level:"error",scope:"client",title:"참조 경로의 대소문자가 실제 파일과 다름"},{id:"ref.root-absolute",level:"error",scope:"client",title:"/로 시작하는 경로 · 자기 폴더가 아닌 <base href> (배포 주소 /s/{서명}/ 아래에서 깨짐)"},{id:"ref.external-script",level:"error",scope:"client",title:"외부 스크립트 (zip 안에 넣고 상대경로로)"},{id:"ref.external-request",level:"error",scope:"client",title:"외부 리소스 요청 (이미지 · 글꼴 · 영상 · CSS, 콘텐츠 CSP가 막음: zip 안에 넣기)"},{id:"ref.external-font",level:"warn",scope:"client",title:"허용 목록(externalAllow)의 외부 글꼴 (망분리 기관에서는 받지 못해 기본 글꼴로 보일 수 있음)"},{id:"ref.insecure",level:"error",scope:"client",title:"http:// 외부 리소스 (https 페이지 · 콘텐츠 CSP가 막음)"},{id:"ref.vendor-external-url",level:"warn",scope:"client",title:"라이브러리 파일 안의 외부 주소 (실행 중 외부를 부르면 콘텐츠 CSP가 막음, ecdk dev 로그 확인)"},{id:"ref.script-not-public",level:"error",scope:"client",title:"type=\"module\" 없는 <script src>가 public/ 밖 파일 (프로젝트 검사만. build가 묶지 않고 zip에도 넣지 않음, type=\"module\"을 붙이거나 public/으로)"},{id:"sandbox.module-src",level:"warn",scope:"client",title:"모듈 스크립트 파일(<script type=\"module\" src>): 콘텐츠 서버의 sandbox 헤더에 allow-same-origin이 없는 LXP에서는 CORS로 막혀 화면이 뜨지 않음 (ecdk build가 HTML 안에 묶음)"},{id:"sandbox.fetch-local",level:"warn",scope:"client",title:"zip 안 파일을 fetch · 변수 import() · Worker로 읽음: 콘텐츠 서버의 sandbox 헤더에 allow-same-origin이 없는 LXP에서는 CORS로 막힘 (JSON fetch · 문자열 import()는 ecdk build가 처리)"},{id:"html.img-alt",level:"warn",scope:"client",title:"대체 텍스트 없는 이미지"},{id:"html.iframe",level:"error",scope:"client",title:"src로 띄우는 iframe · frame, object · embed (콘텐츠 CSP가 막음, 영상은 Elice 비디오 자료로, srcdoc 미리보기는 통과)"},{id:"html.form",level:"warn",scope:"client",title:"form 제출 (sandbox · CSP form-action이 막음, 버튼 click으로 처리)"},{id:"api.external-send",level:"error",scope:"client",title:"외부 주소로 요청 보냄"},{id:"api.parent-access",level:"warn",scope:"client",title:"부모 창 직접 접근"},{id:"api.cookie",level:"warn",scope:"client",title:"쿠키 사용 (학습 기록이 아님)"},{id:"api.storage",level:"warn",scope:"client",title:"브라우저 저장소 사용 (학습 기록이 아님)"},{id:"api.eval",level:"warn",scope:"client",title:"eval · new Function 사용"},{id:"api.dialog",level:"error",scope:"client",title:"alert · confirm · prompt 사용"},{id:"api.window-open",level:"error",scope:"client",title:"새 창 열기"},{id:"sec.secret",level:"error",scope:"server",title:"비밀 값 (키 · 토큰 · 비밀번호)"},{id:"sec.answer-in-bundle",level:"warn",scope:"client",title:"편집 화면에 저장한 정답(.ecdk/settings.json 채점 설정)과 같은 글이 zip에 들어갈 파일에 있음 (프로젝트 검사만)"},{id:"sec.html-injection",level:"warn",scope:"client",title:"HTML 문자열 삽입"},{id:"sec.redirect",level:"warn",scope:"client",title:"주소를 값으로 바꿈"},{id:"sec.postmessage-wildcard",level:"warn",scope:"client",title:"postMessage 대상 *"},{id:"sdk.outdated",level:"error",scope:"client",title:"SDK가 최소 버전보다 낮음 (metadata.json build.sdk < rules.json minVersions.sdk. alpha.3 이하는 LXP 편집 화면 저장(초안) 실패, npm update @eliceio/cdk)"},{id:"sdk.lib-copy",level:"error",scope:"client",title:"SDK 복사본 lib/cdk.js (zip에 넣지 않음, 프로젝트 검사만. SDK는 package.json 의존성 @eliceio/cdk를 build가 번들로 묶음)"}];var rulesJson = {version:version,manifest:manifest,externalAllow:externalAllow,minVersions:minVersions,layouts:layouts,limits:limits,allowedExtensions:allowedExtensions,imageExtensions:imageExtensions,excluded:excluded,forbiddenApis:forbiddenApis,secretPatterns:secretPatterns,rules:rules};
1
+ const version="0.19.0";const manifest={file:"metadata.json",kinds:["material","description"],defaultKind:"material",modes:["learn","instructor","edit"],required:["learn"],kindModes:{material:["learn","instructor","edit"],description:["learn"]},graderTypes:["pattern","partial_pattern","rubric"],commentaryFile:"commentary.txt",defaultEntry:"index.html"};const externalAllow={"style-src":[],"font-src":[]};const minVersions={sdk:"1.0.0-alpha.4"};const layouts={content:["single","split","stage","media"],regions:["main","aside","stage","controls","readout","actions"]};const limits={maxZipBytes:20971520,maxUnpackedBytes:209715200,maxFiles:300,maxEntries:3000,warnRatio:0.8,maxImageBytes:1048576,maxScreenBytes:1572864};const allowedExtensions=["html","htm","css","js","mjs","json","map","txt","md","csv","xml","vtt","svg","png","jpg","jpeg","gif","webp","avif","ico","bmp","mp3","wav","ogg","m4a","mp4","webm","woff","woff2","ttf","otf","glb","gltf","bin","wasm","pdf"];const imageExtensions=["png","jpg","jpeg","gif","webp","avif","bmp","svg"];const excluded={secret:{level:"error",files:[".env",".env.*","elice.config.*","grading.json","answers.*","*.pem","*.key"],dirs:[]},dev:{level:"error",files:[],dirs:[".git","node_modules",".ecdk"]},junk:{level:"warn",files:[".DS_Store","Thumbs.db","desktop.ini"],dirs:["__MACOSX"]}};const forbiddenApis=[{id:"api.parent-access",pattern:"\\bwindow\\.(?:top|parent)\\b|\\b(?:top|parent)\\.(?:document|location)\\b",title:"부모 창 직접 접근 (다른 출처라 막힘, SDK 사용)"},{id:"api.cookie",pattern:"\\bdocument\\.cookie\\b",title:"쿠키 사용 (이 브라우저에만 남고 학습 기록이 아님, 남길 입력값은 SDK로 저장)"},{id:"api.storage",pattern:"\\b(?:localStorage|sessionStorage|indexedDB)\\b",title:"브라우저 저장소 사용 (이 브라우저 · 기기에만 남고 학습 기록이 아님, 남길 입력값은 SDK로 저장)"},{id:"api.eval",pattern:"\\beval\\s*\\(|\\bnew\\s+Function\\s*\\(|\\bset(?:Timeout|Interval)\\s*\\(\\s*[\"'`]",title:"eval · new Function · 문자열 setTimeout 사용"},{id:"api.dialog",pattern:"\\b(?:alert|confirm|prompt)\\s*\\(",title:"alert · confirm · prompt 사용 (sandbox에서 막힘, 화면 안 메시지로)"},{id:"api.window-open",pattern:"\\bwindow\\.open\\s*\\(",title:"새 창 열기 (sandbox에서 막힘)"},{id:"api.external-send",pattern:"(?<!\\bmlapi\\??\\.)\\b(?:fetch|sendBeacon|EventSource|WebSocket)\\s*\\(\\s*['\"`](?:https?|wss?):\\/\\/|\\.open\\(\\s*['\"`][A-Za-z]+['\"`]\\s*,\\s*['\"`]https?:\\/\\/",title:"외부 주소로 요청을 보냄 (학생 정보 유출 위험)"},{id:"sec.html-injection",pattern:"\\.(?:inner|outer)HTML\\s*\\+?=(?!=)(?!\\s*(?:'[^'\\n]*'|\"[^\"\\n]*\"|`[^`$\\n]*`)\\s*(?:[;,)}\\n]|$))|\\.insertAdjacentHTML\\s*\\(|\\bdocument\\.write(?:ln)?\\s*\\(|\\bdangerouslySetInnerHTML\\b",title:"HTML 문자열을 그대로 넣음 (XSS 위험, textContent나 이스케이프 사용)"},{id:"sec.redirect",pattern:"\\blocation(?:\\.href)?\\s*=(?!=)(?!\\s*[\"'`][^\"'`$]*[\"'`])|\\blocation\\.(?:replace|assign)\\s*\\((?!\\s*[\"'`][^\"'`$]*[\"'`]\\s*\\))",title:"주소를 값으로 바꿈 (열린 리디렉션 · javascript: XSS 위험)"},{id:"sec.postmessage-wildcard",pattern:"\\.postMessage\\s*\\([^;]*?,\\s*[\"'`]\\*[\"'`]",title:"postMessage 대상이 * (아무 창이나 받을 수 있음)"},{id:"sandbox.fetch-local",pattern:"(?<!\\bmlapi\\??\\.)\\bfetch\\(\\s*(['\"`])(?![a-z][a-z0-9+.-]*:|//)[^'\"`]*(?<!\\.json)\\1|\\bimport\\(\\s*(?!['\"`])[A-Za-z_$]|\\bnew\\s+(?:Shared)?Worker\\(\\s*['\"`](?![a-z][a-z0-9+.-]*:|//)",title:"zip 안 파일을 fetch · 변수 import() · Worker로 읽음 (콘텐츠 서버의 sandbox 헤더에 allow-same-origin이 없으면 CORS로 막힘)"}];const secretPatterns=[{source:"elice-hardcoded-private-key · detected-private-key · detected-pgp-private-key-block",title:"개인키",pattern:"-----BEGIN[ A-Z0-9_-]*PRIVATE KEY(?: BLOCK)?-----"},{source:"elice-hardcoded-secret",title:"하드코딩된 비밀 값",pattern:"(?:secret|token|api[_-]?key|access[_-]?key|password|passwd)\\s*[:=]\\s*[\"'][A-Za-z0-9_\\-/+]{16,}[\"']",flags:"i",not:"os\\.environ|getenv|process\\.env|dotenv|\\$\\{|<[a-z_]+>|example|dummy|placeholder|changeme|xxxx|your[_-]"},{source:"detected-aws-access-key-id-value",title:"AWS 액세스 키",pattern:"\\b(?:A3T[A-Z0-9]|AKIA|AGPA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}\\b",not:"example|sample|test|fake"},{source:"detected-aws-secret-access-key",title:"AWS 비밀 키",pattern:"[\"'`]?aws_?\\w*secret_?\\w*[\"'`]?\\s{0,50}(?::|=>|=)\\s{0,50}[\"'`]?[A-Za-z0-9/+=]{40}",flags:"i",not:"example|sample|test|fake|xxxxxx"},{source:"detected-aws-session-token",title:"AWS 세션 토큰",pattern:"AWS_SESSION_TOKEN\\s*(?::|=>|=)\\s*[A-Za-z0-9/+=]{16,}",flags:"i",not:"example|sample|test|fake"},{source:"detected-aws-appsync-graphql-key",title:"AWS AppSync 키",pattern:"da2-[a-z0-9]{26}"},{source:"detected-amazon-mws-auth-token",title:"Amazon MWS 토큰",pattern:"amzn\\.mws\\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"},{source:"detected-artifactory-token",title:"Artifactory 토큰",pattern:"\\bAKC[a-zA-Z0-9]{10,}\\n",not:"sha(?:128|256|512)"},{source:"detected-artifactory-password",title:"Artifactory 비밀번호",pattern:"[Aa][Rr][Tt][Ii][-_]?[Ff][Aa][Cc][Tt][Oo][Rr][Yy].*\\bAP[\\dA-F][a-zA-Z0-9]{8,}|\\bAP[\\dA-F][a-zA-Z0-9]{8,}.*[Aa][Rr][Tt][Ii][-_]?[Ff][Aa][Cc][Tt][Oo][Rr][Yy]",not:"sha(?:1|2|3|118|256|512)"},{source:"detected-bcrypt-hash",title:"bcrypt 해시",pattern:"\\$2[aby]?\\$\\d+\\$[./A-Za-z0-9]{53}"},{source:"detected-codeclimate",title:"Code Climate 토큰",pattern:"codeclima.{0,50}[\"'`]?[0-9a-f]{64}",flags:"i"},{source:"detected-etc-shadow",title:"/etc/shadow 내용",pattern:"^\\s*root:[x!*]*:\\d*:\\d*",flags:"m"},{source:"detected-facebook-access-token",title:"Facebook 액세스 토큰",pattern:"EAACEdEose0cBA[0-9A-Za-z]+|EAAAACZAVC6ygB[0-9A-Za-z]+|EAAAAZAw4[0-9A-Za-z]+"},{source:"detected-facebook-oauth",title:"Facebook OAuth 비밀",pattern:"[fF][aA][cC][eE][bB][oO][oO][kK].*[tT][oO][kK][eE][nN].*[\"'`]?[0-9a-f]{32}"},{source:"detected-google-gcm-service-account",title:"Google 서비스 계정 키",pattern:"[\"'`]?type[\"'`]?\\s{0,50}(?::|=>|=)\\s{0,50}[\"'`]?service_account"},{source:"detected-google-oauth-access-token",title:"Google OAuth 토큰",pattern:"ya29\\.[0-9A-Za-z_-]+"},{source:"detected-heroku-api-key",title:"Heroku API 키",pattern:"[hH][eE][rR][oO][kK][uU].*[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}"},{source:"detected-hockeyapp",title:"HockeyApp 토큰",pattern:"hockey.{0,50}[\"'`]?[0-9a-f]{32}",flags:"i"},{source:"detected-mailchimp-api-key",title:"Mailchimp API 키",pattern:"[0-9a-f]{32}-us\\d{1,2}"},{source:"detected-mailgun-api-key",title:"Mailgun API 키",pattern:"key-[0-9a-zA-Z]{32}"},{source:"detected-onfido-live-api-token",title:"Onfido API 토큰",pattern:"api_live(?:_[a-zA-Z]{2})?\\.[a-zA-Z0-9_-]{11}\\.[a-zA-Z0-9_-]{32}"},{source:"detected-outlook-team",title:"Outlook 웹훅",pattern:"https://outlook\\.office\\.com/webhook/[0-9a-f-]{36}"},{source:"detected-paypal-braintree-access-token",title:"PayPal Braintree 토큰",pattern:"access_token\\$production\\$[0-9a-z]{16}\\$[0-9a-z]{32}"},{source:"detected-picatic-api-key",title:"Picatic API 키",pattern:"sk_live_[0-9a-z]{32}"},{source:"detected-sauce-token",title:"Sauce Labs 토큰",pattern:"sauce.{0,50}[\"'`]?[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}",flags:"i"},{source:"detected-slack-token",title:"Slack 토큰",pattern:"xox[pboa]-\\d{12}-\\d{12}-\\d{12}-[a-z0-9]{32}|xox.-\\d{12}-\\d{12}-[0-9a-zA-Z]{24}"},{source:"detected-slack-webhook",title:"Slack 웹훅",pattern:"https://hooks\\.slack\\.com/services/T[a-zA-Z0-9_]{8,10}/B[a-zA-Z0-9_]{8,10}/[a-zA-Z0-9_]{24}",not:"T00000000/B00000000/X{24}"},{source:"detected-sonarqube-docs-api-key",title:"SonarQube 토큰",pattern:"sonar[a-z0-9_.-]{0,30}(?:token|key|login|password|pass|secret|auth)?\\s*[:=]\\s*\\\\?[\"'`]?[0-9a-f]{40}\\b",flags:"i"},{source:"detected-square-access-token",title:"Square 액세스 토큰",pattern:"sq0atp-[0-9A-Za-z_-]{22}"},{source:"detected-square-oauth-secret",title:"Square OAuth 비밀",pattern:"sq0csp-[0-9A-Za-z\\\\_-]{43}"},{source:"detected-ssh-password",title:"sshpass 비밀번호",pattern:"sshpass[ ]-p\\s*['\"]"},{source:"detected-stripe-api-key",title:"Stripe API 키",pattern:"sk_live_[0-9a-zA-Z]{24}"},{source:"detected-stripe-restricted-api-key",title:"Stripe 제한 키",pattern:"rk_live_[0-9a-zA-Z]{24}"},{source:"detected-telegram-bot-api-key",title:"Telegram 봇 토큰",pattern:"\\d+:AA[0-9A-Za-z_-]{33}",not:"go\\.mod|v\\d+\\.\\d+\\.\\d+"},{source:"detected-twilio-api-key",title:"Twilio API 키",pattern:"SK[0-9a-fA-F]{32}"},{source:"detected-username-and-password-in-uri",title:"주소에 들어 있는 아이디 · 비밀번호",pattern:"[A-Za-z0-9+.-]*(?:http|sql|ftp|smtp)[A-Za-z0-9+.-]*://\\{?[A-Za-z][A-Za-z0-9_-]{5,31}\\}?:(?=[^\\s@/]*\\d)(?=[^\\s@/]*[a-z])(?=[^\\s@/]*[A-Z])(?=[^\\s@/]*[!-.:-?\\[-`{-~])[^\\s@/]{6,32}@"}];const rules=[{id:"manifest.missing",level:"error",scope:"server",title:"metadata.json 없음"},{id:"manifest.invalid",level:"error",scope:"server",title:"metadata.json 형식 오류"},{id:"manifest.entry-missing",level:"error",scope:"server",title:"metadata.json에 적은 파일(진입 파일 · 학습 참고 내용)이 없음"},{id:"manifest.commentary-missing",level:"error",scope:"server",title:"학습 참고 내용 파일(commentary.txt) 없음 (LXP 업로드가 거절함)"},{id:"manifest.grading-types",level:"warn",scope:"server",title:"쓰지 않는 gradingTypes (완료 정책은 LXP 설정, 채점 방식은 편집 화면)"},{id:"manifest.completion-policies-ignored",level:"warn",scope:"client",title:"쓰지 않는 completionPolicies · 완료 정책 화면(screens.completionPolicy) (완료 정책은 LXP 설정, build가 zip에서 뺌)"},{id:"entry.missing",level:"error",scope:"server",title:"학생 화면 진입 파일 없음"},{id:"entry.nested",level:"error",scope:"server",title:"폴더째 묶은 zip (metadata.json이 최상위에 없음)"},{id:"input.not-zip",level:"error",scope:"server",title:"zip이 아닌 업로드 (HTML 파일 하나 등)"},{id:"limit.zip-size",level:"error",scope:"server",title:"zip 크기 한도 초과"},{id:"limit.file-count",level:"error",scope:"server",title:"파일 개수 한도 초과"},{id:"limit.unpacked-size",level:"error",scope:"server",title:"풀면 너무 큰 zip (압축 폭탄 의심)"},{id:"limit.near",level:"warn",scope:"client",title:"한도에 가까움"},{id:"limit.screen-size",level:"warn",scope:"client",title:"화면 하나를 열 때 받는 JS · CSS가 큼 (기준 limits.maxScreenBytes, 큰 라이브러리는 import()로)"},{id:"path.unsafe",level:"error",scope:"server",title:"안전하지 않은 경로 (절대경로, .., 역슬래시, 정규화 안 됨)"},{id:"path.case-collision",level:"error",scope:"server",title:"대소문자만 다른 경로"},{id:"path.non-ascii",level:"warn",scope:"client",title:"공백·한글 등 ASCII 밖 문자가 든 경로"},{id:"file.extension",level:"error",scope:"server",title:"허용하지 않는 확장자"},{id:"file.secret",level:"error",scope:"server",title:"정답·비밀 파일 포함"},{id:"file.dev",level:"error",scope:"server",title:"개발용 폴더 포함"},{id:"file.junk",level:"warn",scope:"server",title:"운영체제가 만든 불필요한 파일"},{id:"file.large-image",level:"warn",scope:"client",title:"1MB 넘는 이미지"},{id:"file.encoding",level:"error",scope:"client",title:"UTF-8이 아닌 텍스트 파일 (한글이 깨짐)"},{id:"file.bom",level:"warn",scope:"client",title:"학습 참고 내용 맨 앞의 BOM (보이지 않는 글자)"},{id:"content.answer-key",level:"warn",scope:"client",title:"학생에게 내려가는 JSON에 정답처럼 보이는 키"},{id:"grading.no-submit",level:"warn",scope:"client",title:"편집 화면이 채점 설정을 저장하는데 화면 코드에 제출이 없음"},{id:"edit.no-save",level:"warn",scope:"client",title:"편집 화면인데 저장이 없음"},{id:"project.legacy-file",level:"warn",scope:"client",title:"더 쓰지 않는 프로젝트 파일(elice.config.json · content.json · grading.json)이 남아 있음 (프로젝트 검사만, ADR 0011)"},{id:"build.template-unknown",level:"warn",scope:"client",title:"metadata.json build.template이 이 ecdk가 모르는 템플릿이거나 더 새 템플릿 버전"},{id:"layout.unknown",level:"warn",scope:"client",title:"data-ec-layout · data-ec-region에 키트가 모르는 값 (single · split · stage · media, main · aside · stage · controls · readout · actions)"},{id:"layout.own-step-nav",level:"warn",scope:"client",title:"화면 코드가 이전 · 다음 버튼을 직접 그림 (LXP 이전 · 다음 막대와 헷갈림, 키트 app.useStepper)"},{id:"ref.missing",level:"error",scope:"client",title:"참조한 파일이 없음"},{id:"ref.case-mismatch",level:"error",scope:"client",title:"참조 경로의 대소문자가 실제 파일과 다름"},{id:"ref.root-absolute",level:"error",scope:"client",title:"/로 시작하는 경로 · 자기 폴더가 아닌 <base href> (배포 주소 /s/{서명}/ 아래에서 깨짐)"},{id:"ref.external-script",level:"error",scope:"client",title:"외부 스크립트 (zip 안에 넣고 상대경로로)"},{id:"ref.external-request",level:"error",scope:"client",title:"외부 리소스 요청 (이미지 · 글꼴 · 영상 · CSS, 콘텐츠 CSP가 막음: zip 안에 넣기)"},{id:"ref.external-font",level:"warn",scope:"client",title:"허용 목록(externalAllow)의 외부 글꼴 (망분리 기관에서는 받지 못해 기본 글꼴로 보일 수 있음)"},{id:"ref.insecure",level:"error",scope:"client",title:"http:// 외부 리소스 (https 페이지 · 콘텐츠 CSP가 막음)"},{id:"ref.vendor-external-url",level:"warn",scope:"client",title:"라이브러리 파일 안의 외부 주소 (실행 중 외부를 부르면 콘텐츠 CSP가 막음, ecdk dev 로그 확인)"},{id:"ref.script-not-public",level:"error",scope:"client",title:"type=\"module\" 없는 <script src>가 public/ 밖 파일 (프로젝트 검사만. build가 묶지 않고 zip에도 넣지 않음, type=\"module\"을 붙이거나 public/으로)"},{id:"sandbox.module-src",level:"warn",scope:"client",title:"모듈 스크립트 파일(<script type=\"module\" src>): 콘텐츠 서버의 sandbox 헤더에 allow-same-origin이 없는 LXP에서는 CORS로 막혀 화면이 뜨지 않음 (ecdk build가 HTML 안에 묶음)"},{id:"sandbox.fetch-local",level:"warn",scope:"client",title:"zip 안 파일을 fetch · 변수 import() · Worker로 읽음: 콘텐츠 서버의 sandbox 헤더에 allow-same-origin이 없는 LXP에서는 CORS로 막힘 (JSON fetch · 문자열 import()는 ecdk build가 처리)"},{id:"html.img-alt",level:"warn",scope:"client",title:"대체 텍스트 없는 이미지"},{id:"html.iframe",level:"error",scope:"client",title:"src로 띄우는 iframe · frame, object · embed (콘텐츠 CSP가 막음, 영상은 Elice 비디오 자료로, srcdoc 미리보기는 통과)"},{id:"html.form",level:"warn",scope:"client",title:"form 제출 (sandbox · CSP form-action이 막음, 버튼 click으로 처리)"},{id:"api.external-send",level:"error",scope:"client",title:"외부 주소로 요청 보냄"},{id:"api.parent-access",level:"warn",scope:"client",title:"부모 창 직접 접근"},{id:"api.cookie",level:"warn",scope:"client",title:"쿠키 사용 (학습 기록이 아님)"},{id:"api.storage",level:"warn",scope:"client",title:"브라우저 저장소 사용 (학습 기록이 아님)"},{id:"api.eval",level:"warn",scope:"client",title:"eval · new Function 사용"},{id:"api.dialog",level:"error",scope:"client",title:"alert · confirm · prompt 사용"},{id:"api.window-open",level:"error",scope:"client",title:"새 창 열기"},{id:"sec.secret",level:"error",scope:"server",title:"비밀 값 (키 · 토큰 · 비밀번호)"},{id:"sec.answer-in-bundle",level:"warn",scope:"client",title:"편집 화면에 저장한 정답(.ecdk/settings.json 채점 설정)과 같은 글이 zip에 들어갈 파일에 있음 (프로젝트 검사만)"},{id:"sec.html-injection",level:"warn",scope:"client",title:"HTML 문자열 삽입"},{id:"sec.redirect",level:"warn",scope:"client",title:"주소를 값으로 바꿈"},{id:"sec.postmessage-wildcard",level:"warn",scope:"client",title:"postMessage 대상 *"},{id:"privacy.personal-field",level:"warn",scope:"client",title:"학습자 개인정보를 받는 입력 칸(전화 · 이메일 · 이름 autocomplete 등)이나 개인정보 · 학습자 이름(account.fullname)을 제출 · 저장 · AI 호출로 보냄 (익명 id account.anonymousId, 이름은 보여 주기만)"},{id:"sdk.outdated",level:"error",scope:"client",title:"SDK가 최소 버전보다 낮음 (metadata.json build.sdk < rules.json minVersions.sdk. alpha.3 이하는 LXP 편집 화면 저장(초안) 실패, npm update @eliceio/cdk)"},{id:"sdk.lib-copy",level:"error",scope:"client",title:"SDK 복사본 lib/cdk.js (zip에 넣지 않음, 프로젝트 검사만. SDK는 package.json 의존성 @eliceio/cdk를 build가 번들로 묶음)"}];var rulesJson = {version:version,manifest:manifest,externalAllow:externalAllow,minVersions:minVersions,layouts:layouts,limits:limits,allowedExtensions:allowedExtensions,imageExtensions:imageExtensions,excluded:excluded,forbiddenApis:forbiddenApis,secretPatterns:secretPatterns,rules:rules};
2
2
 
3
3
  export { allowedExtensions, rulesJson as default, excluded, externalAllow, forbiddenApis, imageExtensions, layouts, limits, manifest, minVersions, rules, secretPatterns, version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eliceio/cdk-cli",
3
- "version": "1.3.0-contenttypes.2",
3
+ "version": "1.3.0",
4
4
  "description": "교육자용 Custom HTML 콘텐츠 CLI",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -46,7 +46,7 @@
46
46
  "rollup": "^4.0.0",
47
47
  "tslib": "^2.6.1",
48
48
  "typescript": "~5.9.3",
49
- "@eliceio/cdk": "^1.3.0-contenttypes.2"
49
+ "@eliceio/cdk": "^1.3.0"
50
50
  },
51
51
  "scripts": {
52
52
  "prebuild": "del-cli \"buildcache/*\" \"es/*\"",
package/rules.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.18.0",
2
+ "version": "0.19.0",
3
3
  "manifest": {
4
4
  "file": "metadata.json",
5
5
  "kinds": ["material", "description"],
@@ -688,6 +688,12 @@
688
688
  "scope": "client",
689
689
  "title": "postMessage 대상 *"
690
690
  },
691
+ {
692
+ "id": "privacy.personal-field",
693
+ "level": "warn",
694
+ "scope": "client",
695
+ "title": "학습자 개인정보를 받는 입력 칸(전화 · 이메일 · 이름 autocomplete 등)이나 개인정보 · 학습자 이름(account.fullname)을 제출 · 저장 · AI 호출로 보냄 (익명 id account.anonymousId, 이름은 보여 주기만)"
696
+ },
691
697
  {
692
698
  "id": "sdk.outdated",
693
699
  "level": "error",
@@ -1,12 +1,15 @@
1
1
  ## Always
2
2
 
3
- - Answer the person in their language. The reference files are in English: `references/` next to this SKILL.md, read only the ones you need with the Read tool: 00 what the person decides · 01 environment · 02 design · 03 create the project · 04 sandbox rules · 05 screen code and kit API · 06 quiz template · 07 move existing HTML · 08 error ids · 09 check · 10 build and report · 11 more · 12 upload · 13 edit screen design · 14 layouts and stepper.
3
+ - **Never ask for, store or send a learner's personal data (name, phone number, email, address, date of birth, student number, resident registration number, bank account, face photo, location, or anything else that identifies a person): not in a submission (`submit` · `useSubmit`), `kvstore`, `saveSettings` (`useSave`), a file upload (`assets`) or an AI call (`mlapi`). If the request needs it, ask the person before you build.** Why and what to use instead: `references/02-design-the-material.md` "Personal data".
4
+ - Answer the person in their language. The reference files are in English: `references/` next to this SKILL.md, read only the ones you need with the Read tool: 00 what the person decides · 01 environment · 02 design · 03 create the project · 04 sandbox rules · 05 screen code and kit API · 06 quiz template · 07 move existing HTML · 08 error ids · 09 check · 10 build and report · 11 more · 12 upload · 13 edit screen design · 14 layouts and stepper · 15 edit settings by hand.
4
5
  - Never put correct answers in the content zip. The edit screen saves them to `settings.grading` (locally `.ecdk/settings.json` from `ecdk dev`, which stays local unless the person agrees to send it with the upload, `references/12-upload-with-the-material-mcp.md`).
5
6
  - The completion policy is not in the project or the zip: it is a setting of the LXP page. Say which one fits (`references/02-design-the-material.md` ②); the elice-content-publish skill sets it with the upload after the person agrees (`on_graded` only with grading saved), otherwise the instructor picks it in the '설정' panel at the top of the LXP edit page. Only `on_graded` grades: `on_submit` completes on any submission without grading (`is_correct: null`, the kit shows "제출했어요."), `on_access` completes on open.
6
7
  - The content runs in a sandboxed iframe on its own origin: use the SDK (`app.useSubmit`, `app.useSave`) for anything that must be kept (storage and cookies stay only in that browser), and in-page UI instead of `alert`/`confirm`, new windows, the parent window or external requests.
7
8
  - The content CSP blocks external images, fonts, video, CSS, `<iframe>` and external APIs: put everything in the zip (fonts as files or data URIs). If a library calls outside hosts while running, that is blocked too → check the `ecdk dev` log for "막힌 외부 요청".
8
- - Fix every `ecdk validate` / `ecdk build` error before you report. Do not edit `lib/` (the screen kit). The SDK comes from npm through `package.json` (`npm update @eliceio/cdk`); the kit imports it and `ecdk build` (Vite) bundles it into the screens. Never copy SDK code into the project.
9
- - Ask the person before you settle correct answers (they confirm them before answers go with an upload), install anything globally, or upload or save to LXP (a saved version is visible to learners at once). Before uploading, confirm the exact target page (기관 · 과목 · 수업 · 페이지) with the person.
9
+ - Fix every `ecdk validate` / `ecdk build` error before you report. Do not edit `lib/` (the screen kit) or a template's `core/` (its behavior and grading contract): for something the template does not do, offer what works now or tell the person it is a feature request for the template. The SDK comes from npm through `package.json` (`npm update @eliceio/cdk`); the kit imports it and `ecdk build` (Vite) bundles it into the screens. Never copy SDK code into the project.
10
+ - **Never unzip a built zip (`dist/content.zip` included) or a zip downloaded from LXP or SharePoint, edit the files inside and zip it again. Fix the cause in the ecdk project source and make the zip again with `ecdk build`.**
11
+ - Correct and accepted answers, points and how they are split, and question titles are the person's. In a new material you may draft them, and the person confirms the answers before they go with an upload. In an existing material, ask before you change one the request does not spell out (also the accepted answers of a translated question), and change only what the request names. Ask also before you install anything globally, or upload or save to LXP (a saved version is visible to learners at once). Before uploading, confirm the exact target page (기관 · 과목 · 수업 · 페이지) with the person.
12
+ - After you change the content or answers of a material (`.ecdk/settings.json`), run `ecdk doctor` (`project.grading` and `project.quiz` must not fail), and end your report by telling the person to open the content edit view in `ecdk dev` (give the URL) and press the edit screen's save button once ("초안으로 저장" in the quiz) so its own checks run before anything is uploaded.
10
13
  - Lay out screens with the kit, not your own frame: a content layout `data-ec-layout` (`single` · `split` · `stage` · `media`) with content in `data-ec-region` boxes, and for steps inside a material the kit stepper `app.useStepper()` with `<section data-ec-step>` (`references/14-layouts.md`). LXP draws its own 이전 · 다음 bar under the material, so never build your own Back/Next buttons, `n / N` or a bottom bar.
11
14
 
12
15
  ## Progress and live preview
@@ -3,9 +3,10 @@
3
3
  The person (the instructor or author) is responsible for the content and its answers. Do not settle the following on your own; ask, or get a confirmation.
4
4
 
5
5
  1. **The learning goal, when it is unclear.** Decide the rest of the design to fit the goal and tell the person briefly what you decided.
6
- 2. **Correct answers.** You may draft answers and rubrics, but the person confirms that they are right, before they go with an upload.
6
+ 2. **Correct answers and points.** You may draft answers, rubrics and points for a new material, but the person confirms that they are right, before they go with an upload. When you change an existing material, ask before you change an answer, an accepted answer (also when translating), points or their split, or a question's title that the request does not spell out ([15](15-edit-settings-by-hand.md)).
7
7
  3. **How it is graded**: whether the student submits, and the grader (`pattern`, `partial_pattern` for a score per question, or `rubric`) set on the edit screen. Propose what fits the material and get a confirmation. **The completion policy**: propose the one that fits (the table in 2 ②) and get a yes before the upload sets it (2026-11-12: the publish skill can set it with the save; otherwise the instructor picks it in the '설정' panel at the top of the LXP edit page). Only `on_graded` grades: `on_submit` completes on any submission without grading (`is_correct: null`, the kit shows "제출했어요."), `on_access` completes on open.
8
8
  4. **What the learning notes say** (`commentary.txt`). A material needs them (LXP rejects the upload without them); once they are filled in, AI Helpy answers only questions about this material, so let the person check the wording.
9
- 5. **Checking the screens.** The person looks at the student, tutoring, instructor, edit and mobile views in the preview. When they cannot, tell them what to check and in which order.
9
+ 5. **Checking the screens.** The person looks at the student, tutoring, instructor, edit and mobile views in the preview (the instructor screen shows only in the LXP editor preview; on the learning page instructors see the student screen). When they cannot, tell them what to check and in which order.
10
10
  6. **Uploading to LXP.** A saved version is **visible to learners at once** (when the page is open). Before uploading, show what changes and get approval. The same goes for changing a material that is already open, changing answers, and restoring an older version.
11
11
  7. **Global installs, accounts and permissions.** Leave them to the person.
12
+ 8. **Anything that would touch a learner's personal data.** **Never ask for, store or send it** (name, contact details, student number, photo …; the list, the reasons and the alternatives: 2 "Personal data"). When a request needs it, stop before you build, explain, and offer an anonymous alternative; the person decides.
@@ -2,11 +2,11 @@
2
2
 
3
3
  A Custom HTML learning material is **a small web app in one zip**: an explanation, an interactive simulation or visualization, a guided exercise, a game-like activity, flashcards, a self-check or survey, a quiz, or the description of a practice problem. Elice opens it in a **sandboxed (`allow-scripts allow-same-origin`) iframe on its own origin**; there is no server, only submission, saving and grading go to the Elice server. One zip has up to three screens:
4
4
 
5
- | Screen | Files | What it does |
6
- | ----------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
7
- | Student (required) | `index.html` + `screens/learn.js` | The learning activity (read, interact, solve, make). Submits a result when needed |
8
- | Instructor (optional) | `instructor.html` + `screens/instructor.js` | What only instructors see: activity summary, explanations, teaching tips |
9
- | Content edit (optional) | `edit.html` + `screens/edit.js` | Instructors edit text and data without code and save it → `app.content` of the other screens. Also sets the grader and the answers or rubric, saved to `settings.grading` (never sent to students) |
5
+ | Screen | Files | What it does |
6
+ | ----------------------- | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
7
+ | Student (required) | `index.html` + `screens/learn.js` | The learning activity (read, interact, solve, make). Submits a result when needed |
8
+ | Instructor (optional) | `instructor.html` + `screens/instructor.js` | Seen **only in the LXP editor preview** (its student/instructor switch set to instructor): explanations, a summary of the activity, teaching tips. On the learning page instructors see the student screen |
9
+ | Content edit (optional) | `edit.html` + `screens/edit.js` | Instructors edit text and data without code and save it → `app.content` of the other screens. Also sets the grader and the answers or rubric, saved to `settings.grading` (never sent to students) |
10
10
 
11
11
  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.
12
12
 
@@ -23,6 +23,12 @@ Read or watch / change values and observe (simulation, visualization) / follow s
23
23
  | Several questions with a score per question (partial score) | `on_graded` | `partial_pattern` | `useSubmit` with a string array |
24
24
  | Writing or assignments graded against a rubric (AI grading) | `on_graded` | `rubric` (the criteria) | `useSubmit`, the score comes back at once |
25
25
 
26
+ > **Personal data: never collect it.** A material never asks for, stores or sends a learner's personal data: name, phone number, email, address, date of birth, student number, resident registration number, bank account, face photo, location, or anything else that identifies a person. Not in a submission (`useSubmit` · `submit`), `kvstore`, the content the edit screen saves (`useSave` · `saveSettings`), a file upload (`assets`) or an AI call (`mlapi`).
27
+ >
28
+ > - **Why**: submissions and `kvstore` values stay on the server, and instructors and operators can read them (tutoring, submission lists). The body of an AI call (`mlapi`, also `rubric` grading of a submission) goes to an outside model. `settings` (the content) goes to every viewer, students included.
29
+ > - **Instead**: to tell learners apart (a per-person seed, a per-person variant), use `app.account.anonymousId` (SDK `account.anonymousId`). If a screen greets the learner by name, only show `app.account.fullname` (it may be `null`) and never put it in an answer, a `kvstore` value, the content or an AI prompt. Make surveys anonymous: ask about the topic, the level, the experience, never who the learner is. Next to a free-text box whose text is submitted or sent to AI, say on screen "개인정보(이름 · 연락처 등)는 적지 마세요.".
30
+ > - **When the request asks for it** (a survey with name and phone number, a self-introduction with contact details, a sign-up form, a photo of the learner), do not build that part. Tell the person why and offer the alternative before you build, for example: "이름 · 연락처 같은 학습자 개인정보는 자료에서 받거나 저장할 수 없어요. 제출한 답은 서버에 남아 교육자 · 운영자가 볼 수 있기 때문이에요. 대신 관심 분야 · 경험 수준 · 기대하는 점을 묻는 익명 설문으로 만들까요? 연락처가 꼭 필요하면 자료 밖의 기관 절차(수집 동의를 받는 곳)로 받아 주세요."
31
+
26
32
  - **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.
27
33
  - **`partial_pattern` (partial score per question)**: `{ "type": "partial_pattern", "answer_key": ["^…$", "^…$"], "scores": [50, 50] }`. The student submits a **string array** in question order and `answer[i]` is matched against `answer_key[i]` the same way as `pattern` (trimmed, full match). The score is the sum of `scores[i]` of the matched questions, capped at 100. Rules the server enforces on save (422 otherwise): both arrays 1–50 long and the same length, each score an integer 0–100, the sum at least 100 (a lower sum could never complete). Only 100 is `is_correct: true` and completes `on_graded`; a missing item scores 0, extra items are ignored, and an answer that is not an array of strings is rejected (422). The response also carries `answer_correctness` (per question, `answer_key` order; `[]` for `pattern` · `rubric`), in the submit response and the submission lists, so a screen can mark each question right or wrong (SDK `answerCorrectness`). Kit helpers: `validatePartialGrading` (the same rules, for `getGrading`) and `splitScores(n)` (equal integer split summing to 100, e.g. 3 → [33, 33, 34]). The quiz template supports both (6).
28
34
  - **Choosing between `pattern` and `partial_pattern` is the person's call.** For a material with several questions, ask: "모두 맞혀야 100점" (`pattern`) or "문항별 부분 점수" (`partial_pattern`). For partial scores, take the per-question scores from the person or from the planning material; if neither gives them, use an equal score and say so in the summary (the quiz template's automatic score is `ceil(100 / questions)` each, 3 → 34 · 34 · 34; the kit's `splitScores` sums to exactly 100, 3 → 33 · 33 · 34). In the quiz template the author can also change the grader and the scores on the edit screen. Scores are integers 0–100 summing to at least 100 (usually exactly 100). Students must answer every question before they submit (the quiz blocks an unanswered question), so a skipped question cannot score 0 by design.
@@ -34,7 +40,7 @@ Read or watch / change values and observe (simulation, visualization) / follow s
34
40
 
35
41
  **②-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.
36
42
 
37
- **③ 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.
43
+ **③ Does it need an instructor screen?** The instructor screen opens **only in the LXP editor preview**, when its student/instructor switch is set to instructor (edit token + `screen=instructor`). On the learning page everyone, instructors included, sees the student screen (`sdk.screen` is `learn` for every viewer; an instructor's submission is graded but not recorded). So the instructor screen is a page the author checks while editing: make one when there are explanations, a summary of the answer conditions, or teaching tips the author wants next to the material. Turn it off when it would equal the student screen. Do not plan instructor-only features on the learning page: they have no screen there (a button for instructors to open the instructor screen from the learning page may come later; it is not there now). In particular, do not put them in the student screen behind `app.viewer === 'instructor'`: the editor preview's student switch also runs with viewer `instructor`, so the author would never see the screen students see, and the code and `settings` of the student screen reach every student anyway, so hiding by viewer protects nothing.
38
44
 
39
45
  **④ 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()` (illustration + "학습 자료를 준비하고 있어요"). **Whenever a learning screen has nothing to show, always use `app.emptyState()`**; never design your own empty-state markup, illustration or text (5, "Nothing to show"). Turn the edit screen off only when the material needs no content at all (everything is in the code).
40
46
 
@@ -2,15 +2,15 @@
2
2
 
3
3
  Run `ecdk create --list` first: it prints each template with its own version (`quiz@1.5.0`), 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
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` (three screens with a small example to replace, "예측하고 확인하기", and the kit content editor on the edit screen: see 5) |
9
- | A material in several steps (intro → experiment → summary, slides) | `ecdk create <folder> --template steps` (kit stepper `app.useStepper` and a different content layout per step, example "진자의 주기", content editor on the edit screen: see [14](14-layouts.md)) |
10
- | One document to read (PDF or PPTX, completion on opening) | `ecdk create <folder> --template document` (the edit screen uploads a `.pdf` or `.pptx` and edits PPTX slide text in place; the student screen pages through it; `on_access` picked in LXP; `.ppt` · `.pps` · `.ppsx` must be saved as `.pptx` or `.pdf` first; uploads work in `ecdk dev` only until the server upload API ships) |
11
- | A dark screen | Add `--theme dark` to the above |
12
- | 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 |
13
- | An existing HTML page | [7. Move existing HTML](07-move-existing-html.md) |
5
+ | Case | Start with |
6
+ | ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
7
+ | A quiz (up to 20 questions per quiz material) | `ecdk create <folder>` (quiz template: starts with no question; the edit screen adds questions of any of the five types with "+ 문제 추가"; answers set on the edit screen; `pattern` or `partial_pattern` grading, `on_graded` picked in LXP) |
8
+ | Any other material | `ecdk create <folder> --template blank` (three screens with a small example to replace, "예측하고 확인하기", and the kit content editor on the edit screen: see 5) |
9
+ | A material in several steps (intro → experiment → summary, slides) | `ecdk create <folder> --template steps` (kit stepper `app.useStepper` and a different content layout per step, example "진자의 주기", content editor on the edit screen: see [14](14-layouts.md)) |
10
+ | One document to read (PDF or PPTX, completion on opening) | `ecdk create <folder> --template document` (the edit screen uploads a `.pdf` or `.pptx` and edits PPTX slide text in place; the student screen pages through it; `on_access` picked in LXP; `.ppt` · `.pps` · `.ppsx` must be saved as `.pptx` or `.pdf` first; uploads work in `ecdk dev` only until the server upload API ships) |
11
+ | A dark screen | Add `--theme dark` to the above |
12
+ | 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 |
13
+ | An existing HTML page | [7. Move existing HTML](07-move-existing-html.md) |
14
14
 
15
15
  `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).
16
16
 
@@ -3,6 +3,8 @@
3
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
4
  2. **Screen code calls only `lib/elice-content.js` (the kit).** Do not edit `lib/`. Do not call the SDK (`@eliceio/cdk`, imported by the kit and bundled by `ecdk build`) directly.
5
5
  3. **Do not use blocked features**: `alert`/`confirm`/`prompt` · `window.open` · `<form>` submission · access to `window.parent`/`top` · `fetch`/`WebSocket` to external addresses (an AI call to mlapi goes through `sdk.mlapi.fetch`, which the check allows) · external `<script src>`. `localStorage` · `sessionStorage` · `indexedDB` · `document.cookie` work, but they stay only in that browser and device and are not the learner's record: to keep progress, submit it (`useSubmit`); to keep content, save it from the edit screen.
6
+ - **Never collect a learner's personal data** (name, phone number, email, address, date of birth, student number, resident registration number, bank account, face photo, location …) through any of these: a submission, `kvstore`, the edit screen's content (`settings`, sent to every viewer), a file upload (`assets`) or an AI call (`mlapi`, sent to an outside model). Submissions and `kvstore` values stay on the server where instructors and operators read them. Use `app.account.anonymousId` to tell learners apart ([2](02-design-the-material.md) "Personal data").
7
+ - The check warns about it (`privacy.personal-field`): an input that takes personal data (`type="tel"` · `type="email"`, an `autocomplete` of name · tel · email · address · birthday · card, or an input whose `name` · `id` · `placeholder` · `<label>` says 전화 · 이메일 · 학번 · 주민 · phone · email …), a personal key (`phone` · `email` · `studentId` · `연락처` …) in `submit` · `useSubmit` · `kvstore.post`, or `account.fullname` inside `submit` · `useSubmit` · `kvstore.post` · `saveSettings` · `useSave` · `mlapi.fetch` · `assets.post`. Remove the field or the value; do not silence it. Only code that never stores or sends the value (a regex lab that checks an email format on screen) may use `ecdk-ignore-next-line privacy.personal-field` with the reason.
6
8
  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
9
  - The content CSP (same as LXP) blocks every external image, font, video, CSS file, `<iframe src>`/`<object>`/`<embed>` and `fetch` (errors `ref.external-request` · `html.iframe`; an `<iframe>` filled with `srcdoc` for a code preview is fine). Fonts go in the zip as files or data URIs: external fonts (Google Fonts too) are blocked for now; they open once the server allowlist is settled.
8
10
  - A library may call outside hosts while it runs (web fonts, wasm, map tiles, APIs) and the CSP blocks them. `ref.vendor-external-url` warns about outside addresses in library files; open `ecdk dev` and look for "막힌 외부 요청" in the log, then put those files in the zip and point the library at them by relative path.
@@ -87,7 +87,9 @@ app.useSave({ getContent: () => app.content, getGrading: () => grading.getGradin
87
87
  - 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(`).
88
88
  - 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 top 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, and for a server 422 `VALIDATION_ERROR` a message by the server's error type: "배점 합계는 100점 이상이어야 합니다." · "문항별 정답과 점수의 개수가 맞지 않아요." · "정답 형식이 올바르지 않아요.", otherwise "저장할 내용의 형식이 올바르지 않아요."), so the screen code does not announce "saved" itself. A submission the server rejects with 422 (the saved grading and the answer shape do not match, for example `partial_pattern` with a string answer) shows "이 자료의 채점 설정과 답 모양이 맞지 않아 제출하지 못했어요. 교육자에게 알려 주세요." in every template.
89
89
  - Materials without a submission do not call `useSubmit` (only `on_access` fits them in LXP).
90
+ - **No personal data in what you submit, save, upload or send to AI.** `getAnswer`, `useSave` content, `assets` uploads and `mlapi` bodies never hold a learner's name, phone number, email, address, date of birth, student number, resident registration number, bank account, face photo or location, and the screens have no input for them. Submissions stay on the server for instructors and operators, the content reaches every viewer, and AI calls go to an outside model. To tell learners apart use `app.account.anonymousId`; `app.account.fullname` may only be shown, never stored or sent ([2](02-design-the-material.md) "Personal data").
90
91
  - Use `app.viewer` (`student` · `instructor` · `tutor`), `app.readOnly` (tutoring) and `app.account.anonymousId` (for example a per-person fixed random seed) only when needed. The kit handles per-viewer behavior such as the tutoring lock, so the screen code does not branch on the viewer.
92
+ - **The instructor screen shows only in the LXP editor preview** (student/instructor switch → instructor; `app.screen` `instructor`). On the learning page an instructor gets the student screen (`app.screen` `learn`, `app.viewer` `instructor`, submissions graded but not recorded). Never add instructor-only parts to the student screen with `if (app.viewer === 'instructor')`: the editor preview's student switch also has viewer `instructor`, so the author would not see what students see, and everything in the student screen (code and `settings`) reaches students anyway. Put explanations and teaching tips on the instructor screen instead. In `ecdk dev` open it with the '교육자 화면 (미리보기)' view (`?view=instructor`): like the editor preview it runs with an edit token, so submissions there are rejected.
91
93
  - Steps inside one material: turn on the kit's stepper and give each step a layout ([14](14-layouts.md)). Never draw an LXP-like bottom 이전 · 다음 bar or your own `n / N`.
92
94
 
93
95
  ```html
@@ -1,11 +1,11 @@
1
1
  # 6. Using the quiz template
2
2
 
3
- - The quiz has **no instructor screen** (`metadata.json` `screens.instructor.enabled: false`): an instructor who opens it in LXP gets the student screen and can solve and submit it (graded, not recorded). Add `instructor.html` and turn it on only when the person asks for one.
3
+ - The quiz has **no instructor screen** (`metadata.json` `screens.instructor.enabled: false`): an instructor who opens it in LXP gets the student screen and can solve and submit it (graded, not recorded). Add `instructor.html` and turn it on only when the person asks for one; it shows only in the LXP editor preview (instructor switch), and instructors on the learning page still get the student screen.
4
4
  - The template starts with **no questions**: the student screen shows "학습 자료를 준비하고 있어요" until the edit screen saves. The questions and answers are added on the edit screen ("+ 문제 추가", any of the five types picked from the type button's list, the answer in the same card; up to 20 questions): in `ecdk dev`, so the upload can carry them (`.ecdk/settings.json`, sent after the person agrees), or on the LXP edit screen after upload. There is no quiz title or description field (the student screen starts with the questions); a `title` · `description` saved earlier is kept as is.
5
5
  - Question types: `select_one` · `select_multiple` · `order` · `text` · `group`. For `order` the student taps the choices in the right order and each gets a number 1 · 2 · 3 (tap again to remove, "답안 초기화" to clear); the answer string is the same as before. Question, choice and group ids (`q1`, `a`, `g1`) are lower-case letters and digits; once set, do not change them.
6
6
  - Student answer (`pattern`, the default): **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 sent **as typed with only `%` → `%25` and `;` → `%3B`** when the settings carry `"answerFormat": 2` (template 1.10.0 and later saves it), or `encodeURIComponent`-encoded when the tag is missing (quizzes saved by 1.9.x or earlier). Both decode with one `decodeURIComponent`.
7
7
  - 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 pick an answer mode ("정답 입력 방식"): "직접 입력" (one allowed answer per line, any one is correct) or "정규 표현식" (a regex such as `[Aa]pples?|사과`, with a "채점 테스트" box that grades a sample answer the way the server does). A leading `^` · trailing `$` are dropped and a leading `(?i)` becomes `(?i:…)`; syntax the server (Python `regex`) and the browser read differently is blocked on save (`;`, flags in the middle, back-references, named groups, `[^]`, `\p{…}`, `\b`, `\Z` and similar; the list is in ADR 0013). 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` or `partial_pattern` (no hand-written regex for the whole quiz, only per text question; the author picks the type on the edit screen with the "부분 채점 허용" switch shown from two questions, a new quiz is `pattern`); its completion policy is `on_graded` (set by the publish skill with the answers, or picked in the '설정' panel at the top of the LXP edit page); with `on_submit` the server does not grade (`is_correct: null`, the kit shows "제출했어요."). `pattern` compares the whole answer at once, so **everything must match for 100**.
8
- - **Partial score per question (`partial_pattern`, 2 ②)**: ask the person which one they want ("모두 맞혀야 100점" or "문항별 부분 점수"). For partial scores, write into `.ecdk/settings.json` both the public `"gradingType": "partial_pattern"` (the student screen cannot see `grading`, so this tells it to submit an array) and `grading` `{ "type": "partial_pattern", "answer_key": ["^q1=b$", "^q2=a,d$", …], "scores": [60, 40, …] }`, one regex per question in question order, each the same as one `id=answer` piece of the `pattern` regex wrapped in `^…$`. Scores come from the person or the planning material, otherwise the automatic score: every question gets `ceil(100 / questions)` (3 questions → 34 · 34 · 34, the server caps the student's score at 100). Also write `"pointsMode": "custom"` with each question's `"points"` (same values as `scores`), or `"pointsMode": "equal"` for the automatic score. Then have the person open the edit view and save once ("초안으로 저장") so the edit screen checks every answer. The author can change both on the edit screen: the "부분 채점 허용" switch picks `pattern` or `partial_pattern`, the row under it shows "자동 배점" or "직접 배점" with the total, and each question card has a score field (custom scores must be integers 0–100 summing to at least 100; "동일 점수로 적용하기" goes back to automatic). A quiz saved before keeps its type and scores unless the author changes them. The student answer is then an array `["q1=b", "q2=a,d", …]`, and the student screen marks each question ✓ · ✕ from `answer_correctness` (right after submitting and when reopened); below 100 it shows a box with the score, "아쉬워요!" and a mascot above the submit bar, and with custom scores each question title shows "N점". With `pattern` the score line is hidden: one question shows "오답입니다." in its card, and several questions with any wrong show "틀린 문제가 있습니다. 다시 한번 풀어보세요." above the submit bar. Every question must still be answered before submitting.
8
+ - **Partial score per question (`partial_pattern`, 2 ②)**: ask the person which one they want ("모두 맞혀야 100점" or "문항별 부분 점수"). For partial scores, write into `.ecdk/settings.json` both the public `"gradingType": "partial_pattern"` (the student screen cannot see `grading`, so this tells it to submit an array) and `grading` `{ "type": "partial_pattern", "answer_key": ["^q1=b$", "^q2=a,d$", …], "scores": [60, 40, …] }`, one regex per question in question order, each the same as one `id=answer` piece of the `pattern` regex wrapped in `^…$`. Scores come from the person or the planning material, otherwise the automatic score: every question gets `ceil(100 / questions)` (3 questions → 34 · 34 · 34, the server caps the student's score at 100). Also write `"pointsMode": "custom"` with each question's `"points"` (same values as `scores`), or `"pointsMode": "equal"` for the automatic score. Build the regexes with `core/model.js`, never by hand ([15](15-edit-settings-by-hand.md)), run `ecdk doctor`, then have the person open the edit view and save once ("초안으로 저장") so the edit screen checks every answer. The author can change both on the edit screen: the "부분 채점 허용" switch picks `pattern` or `partial_pattern`, the row under it shows "자동 배점" or "직접 배점" with the total, and each question card has a score field (custom scores must be integers 0–100 summing to at least 100; "동일 점수로 적용하기" goes back to automatic). A quiz saved before keeps its type and scores unless the author changes them. The student answer is then an array `["q1=b", "q2=a,d", …]`, and the student screen marks each question ✓ · ✕ from `answer_correctness` (right after submitting and when reopened); below 100 it shows a box with the score, "아쉬워요!" and a mascot above the submit bar, and with custom scores each question title shows "N점". With `pattern` the score line is hidden: one question shows "오답입니다." in its card, and several questions with any wrong show "틀린 문제가 있습니다. 다시 한번 풀어보세요." above the submit bar. Every question must still be answered before submitting.
9
9
 
10
10
  ```json
11
11
  {
@@ -16,6 +16,14 @@
16
16
 
17
17
  - **Writing `.ecdk/settings.json` by hand (answer format tags, ADR 0013)**: put `"answerFormat": 2` and `"requires": { "quiz": "1.10.0" }` at the top level and `"answerMode": "list"` (or `"regex"`) on every text question, and write text answers in the regex **as typed** (escape regex characters, `%` → `%25`, `;` → `%3B`), e.g. `q4=(?:weight|가중치|50%25)`. A regex-mode question stores the author's regex wrapped in `(?:…)`, e.g. `q4=(?:[Aa]pples?|사과)`. Without `answerFormat` the student screen sends `encodeURIComponent` answers, so the regex must use that form instead (`q4=(?:%EA%B0%80%EC%A4%91%EC%B9%98)`); never mix the two. Then save once in the edit view so the edit screen checks and rewrites everything. If a material goes back to a 1.9.x zip, the answers must be saved again on that edit screen (the old screen ignores the tag).
18
18
 
19
+ **Adding images** (a picture in a question's `description` or in `explanation.text`, both Markdown). There are two ways:
20
+
21
+ - **An image in the zip (you can do this).** Save the file as `public/img/<name>` (letters, digits, `-`, `_` and `.` only: the quiz reads only such `img/` paths) and write `![alt](img/<name>)` in the text, with alt text that says what the picture shows. `ecdk build` copies it into the zip **as is** (it does not shrink or convert it); `file.large-image` warns above 1MB (a warning only). Never put an image into the settings as a `data:` address (the old `![…](image:id)` + `images` form is only kept for old quizzes).
22
+ - **Prepare the file first, the way the editor's image button does**, so both kinds look the same: longest side 2048px or less, WebP quality about 85 (keep PNG when transparency matters, GIF as is), no EXIF · GPS, well under 1MB. Use the first tool that exists: `cwebp -q 85 -resize <w> 0 -metadata none in.png -o out.webp` (`-resize` only when a side is over 2048) → macOS `sips` (`sips -Z 2048`, then `-s format jpeg` or keep PNG) → ImageMagick `magick in.png -resize '2048x2048>' -strip -quality 85 out.webp` → none of them: ask the person to shrink it, do not add a large original.
23
+ - **An image added with the editor's image button (`asset:`).** On the LXP edit screen of a **saved** material only, the image button shrinks the picture in the browser (`app.assets.uploadImage` → `optimizeImage`: longest side 2048px, WebP 0.85, JPEG fallback, PNG kept when it may be transparent, EXIF · GPS dropped, GIF as is, up to 10MB) and stores `![alt](asset:assets/{material id}/{id}.webp)` in the settings. It is refused on the learn and instructor screens (`ScreenNotSupported`), on the edit screen of an upload that is not saved yet (`#edit=1`) and in previews or a `versionId` (`DraftNotSaved`). **You cannot do this**: there is no edit token and the `elice-material` MCP has no image upload tool. Keep every `asset:` reference you find exactly as it is. When the person wants an image added or replaced this way, tell them: open the page's editor → click the question or explanation box → the image button → '초안으로 저장' → '수업 자료에 반영'.
24
+ - **Display size**: there is no setting for it today. An image fills the card width (`.qz-image`, `max-width: 100%`). Say so; never add CSS for one file path in `styles.css` (it breaks when the image changes). The only way now is to crop or resize the source file.
25
+ - **A quiz that is already on LXP**: before adding a zip image, merge the page's current settings into `.ecdk/settings.json` ([12](12-upload-with-the-material-mcp.md) "Content and answers (settings)", item 8), so the upload does not wipe what was edited in LXP.
26
+
19
27
  - 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).
20
28
  - Colors, spacing, corners, choice cards: the `--qz-*` variables in `ui/theme.css` (they point at EDS tokens, so `--theme dark` also fits)
21
29
  - Text: `ui/texts.js` (tab title, loading, student, edit, and validation messages)
@@ -3,7 +3,7 @@
3
3
  1. Create a skeleton with `ecdk create <new folder> --template blank`.
4
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. The build only keeps what HTML, CSS and `import` reach: files the code loads by a string path at run time (`fetch('data.json')`, `new Worker('w.js')`, a `<script src>` without `type="module"`) go in `public/` (`public/data.json` becomes `data.json` in the zip). A `<script src>` without `type="module"` outside `public/` fails with `ref.script-not-public`: add `type="module"` or move the file to `public/`.
5
5
  3. Download external CDN scripts, fonts, images, CSS and videos into the zip (fonts as files or data URIs, long videos as Elice video materials, no `<iframe>`). After `ecdk dev`, check the log for "막힌 외部 요청".
6
- 4. Replace blocked code (storage, `alert`, external sends) as in [4](04-rules.md).
6
+ 4. Replace blocked code (storage, `alert`, external sends) as in [4](04-rules.md). **When the original asks for or keeps a learner's personal data** (a name, email or phone field, a sign-up or contact form, a photo, data sent to a form service), do not carry it over into a submission, `kvstore` or an AI call: tell the person and propose an anonymous version first ([2](02-design-the-material.md) "Personal data").
7
7
  5. Merge multiple HTML pages into one HTML that switches views.
8
8
  6. Decide submission and grading as in [2 ②](02-design-the-material.md). The completion policy is not written in the project: the publish skill sets it with the upload after the person agrees, or the instructor picks it in the '설정' panel at the top of the LXP edit page (suggest `on_access` when there is no submission).
9
9
  7. Turn off the instructor and edit screens in `metadata.json` `screens` (`{ "enabled": false }`) and delete their files when they are not needed.