@eliceio/cdk-cli 1.1.0-versionpreview.0 → 1.2.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.
- package/README.md +54 -27
- package/es/cli.js +35 -2
- package/es/commands/create/index.js +1 -1
- package/es/commands/dev/index.d.ts +8 -3
- package/es/commands/dev/index.js +72 -3
- package/es/commands/doctor/index.d.ts +1 -1
- package/es/commands/doctor/index.js +10 -13
- package/es/commands/setup/index.d.ts +1 -1
- package/es/commands/setup/index.js +4 -3
- package/es/commands/uninstall/index.d.ts +1 -1
- package/es/commands/uninstall/index.js +7 -30
- package/es/core/config.d.ts +2 -2
- package/es/core/config.js +2 -2
- package/es/core/skills.d.ts +22 -4
- package/es/core/skills.js +89 -17
- package/es/dev/browser.d.ts +22 -0
- package/es/dev/browser.js +105 -0
- package/es/dev/check.d.ts +84 -0
- package/es/dev/check.js +326 -0
- package/es/dev/host-page.js +10 -0
- package/es/dev/mock-api.js +1 -1
- package/es/dev/server.d.ts +2 -0
- package/es/dev/server.js +1 -0
- package/es/rules/check.js +1 -1
- package/es/rules/manifest.d.ts +1 -1
- package/es/rules/manifest.js +2 -2
- package/es/test-old-skill.d.ts +5 -0
- package/package.json +3 -2
- package/skills/_shared/always.md +13 -5
- package/skills/{elice-content-guide/topics → _shared/references}/00-what-the-person-decides.md +2 -2
- package/skills/{elice-content-guide/topics → _shared/references}/02-design-the-material.md +13 -4
- package/skills/{elice-content-guide/topics → _shared/references}/03-create-the-project.md +2 -2
- package/skills/_shared/references/05-screen-code.md +169 -0
- package/skills/{elice-content-guide/topics → _shared/references}/06-using-the-quiz-template.md +4 -3
- package/skills/{elice-content-guide/topics → _shared/references}/07-move-existing-html.md +1 -1
- package/skills/_shared/references/08-fix-check-errors.md +28 -0
- package/skills/_shared/references/09-check.md +29 -0
- package/skills/_shared/references/10-build.md +8 -0
- package/skills/_shared/references/12-upload-with-the-material-mcp.md +83 -0
- package/skills/elice-content-check/SKILL.md +7 -9
- package/skills/elice-content-create/SKILL.md +12 -10
- package/skills/elice-content-migrate/SKILL.md +10 -8
- package/skills/elice-content-publish/SKILL.md +10 -8
- package/templates/_shared/lib/cdk-mock.d.ts +1 -1
- package/templates/_shared/lib/cdk-mock.js +2 -2
- package/templates/_shared/lib/elice-content.css +1 -1
- package/templates/_shared/lib/elice-content.d.ts +1 -1
- package/templates/_shared/lib/elice-content.js +33 -16
- package/templates/blank/README.md +24 -21
- package/templates/blank/screens/edit.js +1 -1
- package/templates/blank/template.json +1 -1
- package/templates/quiz/README.md +6 -5
- package/templates/quiz/metadata.json +1 -1
- package/templates/quiz/screens/edit.js +1 -1
- package/templates/quiz/screens/learn.js +1 -1
- package/templates/quiz/styles.css +3 -33
- package/templates/quiz/template.json +2 -2
- package/templates/quiz/ui/templates/page.js +2 -17
- package/templates/quiz/ui/templates/question.js +1 -1
- package/templates/quiz/ui/texts.js +2 -11
- package/skills/elice-content-guide/SKILL.md +0 -42
- package/skills/elice-content-guide/topics/05-screen-code.md +0 -132
- package/skills/elice-content-guide/topics/08-fix-check-errors.md +0 -27
- package/skills/elice-content-guide/topics/09-check.md +0 -11
- package/skills/elice-content-guide/topics/10-build.md +0 -8
- package/skills/elice-content-guide/topics/12-upload-with-the-material-mcp.md +0 -41
- package/templates/quiz/instructor.html +0 -17
- package/templates/quiz/screens/instructor.js +0 -33
- /package/skills/{elice-content-guide/topics → _shared/references}/01-check-the-environment.md +0 -0
- /package/skills/{elice-content-guide/topics → _shared/references}/04-rules.md +0 -0
- /package/skills/{elice-content-guide/topics → _shared/references}/11-more.md +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: elice-content-publish
|
|
3
|
-
description: Upload an Elice Custom HTML learning material to LXP with the elice-material MCP - build the zip with ecdk, pick or create the lecture page, upload, check the draft and save it as a new version after the person approves. Use when the person asks to upload, publish, deploy or update an Elice or LXP material made with ecdk.
|
|
3
|
+
description: Upload an Elice Custom HTML learning material to LXP with the elice-material MCP - build the zip with ecdk, pick or create the lecture page, upload (with the content, answers and completion policy when the person agrees), check the draft and save it as a new version after the person approves. Use when the person asks to upload, publish, deploy or update an Elice or LXP material made with ecdk.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Upload an Elice learning material
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Reference files are in `references/` in this skill's folder (see Always). Read `references/12-upload-with-the-material-mcp.md` first. It has the tool order, arguments and error handling.
|
|
9
9
|
|
|
10
10
|
{{always}}
|
|
11
11
|
|
|
@@ -13,11 +13,13 @@ Read guide topics with the Read tool from the sibling `elice-content-guide` skil
|
|
|
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. **
|
|
17
|
-
4. **
|
|
18
|
-
5. **
|
|
19
|
-
6. **
|
|
20
|
-
7. **
|
|
21
|
-
8. **
|
|
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), 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)".
|
|
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
|
+
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.
|
|
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
|
+
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
|
+
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.
|
|
23
|
+
10. **Finish.** Write `.ecdk/link.json` as `{ "org": …, "lecture_page_id": …, "version_id": … }` so the next upload goes to the same page. Report 기관 · 과목 · 수업 · 페이지 (names and ids), the LXP URL, the saved version, whether content and answers were sent, the completion policy (only `on_graded` grades: a quiz with `on_submit` completes on any submission and shows "제출했어요.", not a score), any `warnings`, and whether the page is closed to learners (a new page stays closed until the person opens it in LXP). Later changes to the title, icon, settings or policy of this page without a new zip go through `update_material`.
|
|
22
24
|
|
|
23
25
|
{{version}}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export type Scope = 'learn' | 'edit';
|
|
3
3
|
export type Viewer = 'student' | 'instructor' | 'tutor';
|
|
4
4
|
export type Screen = 'learn' | 'instructor' | 'edit';
|
|
5
|
-
/** 완료 정책 (LXP 설정
|
|
5
|
+
/** 완료 정책 (LXP 자료 편집 화면의 '설정'에서 교육자가 고름, ADR 0012). mock은 흉내 내지 않아 늘 null */
|
|
6
6
|
export type CompletionPolicy = 'on_access' | 'on_submit' | 'on_graded';
|
|
7
7
|
|
|
8
8
|
export declare const ErrorCode: Readonly<{
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* 서버 없이 화면을 시험할 때 키트가 대신 씁니다. 실제 SDK와 다른 점:
|
|
5
5
|
* - 채점: 편집 화면이 저장한 채점 설정(settings.grading { type: pattern | rubric })이 있으면 로컬 채점, 없으면 제출만 받음.
|
|
6
6
|
* pattern 답은 정규식 하나, 답 문자열 전체 일치. 프로젝트 폴더를 그대로 열면 ecdk dev가 저장한 .ecdk/settings.json으로 시작
|
|
7
|
-
* - 완료 정책: 흉내 내지 않는다 (LXP에 올린 뒤 설정
|
|
7
|
+
* - 완료 정책: 흉내 내지 않는다 (LXP에 올린 뒤 자료 편집 화면의 '설정'에서 교육자가 고름, ADR 0012). material.completionPolicy는 null
|
|
8
8
|
* - 저장: 설정 화면이 저장한 내용과 제출 기록을 브라우저에 남겨 다른 화면에서도 보임
|
|
9
9
|
* (sandbox라 저장소가 막히면 이 페이지 안에서만)
|
|
10
10
|
* - 보는 사람: 주소에 #viewer=student | instructor | tutor (mock 전용, 기본 student)
|
|
@@ -455,7 +455,7 @@ export class MockEliceCDK {
|
|
|
455
455
|
const prev = this.#store.get('result', null);
|
|
456
456
|
const score = res.score ?? prev?.score ?? null;
|
|
457
457
|
// 기록의 완료 시각: 채점 설정이 있으면 통과(pattern 100점 · rubric 흉내 점수)해야, 없으면 제출만으로
|
|
458
|
-
// (운영에서 완료 여부는 LXP 설정
|
|
458
|
+
// (운영에서 완료 여부는 LXP '설정'의 완료 정책이 정한다)
|
|
459
459
|
const completed = res.isCorrect === true || !this.#effectiveGrading();
|
|
460
460
|
this.#store.set('result', {
|
|
461
461
|
score,
|
|
@@ -265,7 +265,7 @@ button:disabled {
|
|
|
265
265
|
max-width: 720px;
|
|
266
266
|
margin-inline: auto;
|
|
267
267
|
}
|
|
268
|
-
/* 편집 화면 채점 방식 블록 (useGradingBlock): LXP
|
|
268
|
+
/* 편집 화면 채점 방식 블록 (useGradingBlock): LXP 채점 설정과 같은 모양.
|
|
269
269
|
제목 h6 · 설명 body2 secondary, 방식마다 EDS 라디오 카드(테두리 1px, 고르면 primary 테두리 · primary-opacity02 바탕) */
|
|
270
270
|
.ec-grading {
|
|
271
271
|
display: flex;
|
|
@@ -81,7 +81,7 @@ export interface GradingBlockOptions {
|
|
|
81
81
|
root?: Element;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
/** 채점 방식 문구 (LXP 설정
|
|
84
|
+
/** 채점 방식 문구 (LXP 채점 설정 문구 그대로) */
|
|
85
85
|
export declare const GRADER_TYPES: Readonly<Record<GraderType, { label: string; description: string }>>;
|
|
86
86
|
/** '작성 예시 보기' 기본 예시 [정규식, 뜻] */
|
|
87
87
|
export declare const GRADING_EXAMPLES: ReadonlyArray<[string, string]>;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* real @eliceio/cdk 1.x (package.json) 플랫폼에서 열 때 (#token=, 편집기 #preview=1 · #edit=1)
|
|
15
15
|
* ecdk build가 이 화면 코드와 함께 번들로 묶음
|
|
16
16
|
* 편집 화면은 edit 토큰으로 열려 '저장'이 자료의 draft에 저장.
|
|
17
|
-
* 학생에게는 LXP 편집 페이지의 '
|
|
17
|
+
* 학생에게는 LXP 편집 페이지의 '수업 자료에 반영'(새 버전)부터 보임
|
|
18
18
|
* mock lib/cdk-mock.js (같은 인터페이스) 그 밖 (로컬): 로컬 채점, 화면 사이 저장 공유
|
|
19
19
|
*
|
|
20
20
|
* 바꾸기: 주소에 ?sdk=mock 또는 ?sdk=real, 또는 start({ screen, sdk: 'mock' })
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* 정답은 콘텐츠(zip)에 넣지 않습니다. 채점은 서버가 채점 설정(settings.grading)으로 합니다 (ADR 0009).
|
|
31
31
|
* 채점 설정 { type: pattern | rubric, answer_key | rubric }은 편집 화면이 edit 토큰으로 저장하고, 서버는 학생에게
|
|
32
32
|
* settings.grading을 내려주지 않습니다. 완료 정책(on_access · on_submit · on_graded)은 콘텐츠가 다루지 않습니다:
|
|
33
|
-
* LXP에 올린 뒤 설정
|
|
33
|
+
* LXP에 올린 뒤 자료 편집 화면의 '설정'에서 교육자가 고릅니다 (ADR 0012).
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
36
|
/**
|
|
@@ -405,7 +405,7 @@ export async function start(options) {
|
|
|
405
405
|
},
|
|
406
406
|
|
|
407
407
|
/**
|
|
408
|
-
* 편집 화면의 채점 방식 · 답 블록 (퀴즈가 아닌 자료, ADR 0009). LXP
|
|
408
|
+
* 편집 화면의 채점 방식 · 답 블록 (퀴즈가 아닌 자료, ADR 0009). LXP 채점 설정과 같은 문구로 채점 방식(기준 답안 정규식 ·
|
|
409
409
|
* 평가 기준)을 고르고 입력한다. 돌려준 getGrading을 useSave({ getGrading })에 넘기면 내용과 함께 저장된다.
|
|
410
410
|
* 퀴즈처럼 문항 구조가 있는 화면은 이 블록 대신 문항별로 답을 받아 정규식을 만든다
|
|
411
411
|
* @param {GradingBlockOptions} [opts]
|
|
@@ -487,6 +487,8 @@ function showStatus(app) {
|
|
|
487
487
|
function resultText(r) {
|
|
488
488
|
// 점수 없는 채점(manual · none): 교육자가 매긴 점수는 나중에 결과로 보인다
|
|
489
489
|
if (r.score === null || r.score === undefined) return '제출했어요.';
|
|
490
|
+
// 채점하지 않는 완료 정책(열람 · 제출 시 완료): 서버가 isCorrect null과 완료 점수를 준다. 맞고 틀림을 말하지 않는다
|
|
491
|
+
if (r.isCorrect === null) return '제출했어요.';
|
|
490
492
|
return r.isCorrect
|
|
491
493
|
? `모두 맞았어요. ${r.score}점`
|
|
492
494
|
: `${r.score}점이에요. 다시 풀어 볼 수 있어요.`;
|
|
@@ -501,8 +503,13 @@ function mountSubmit(app, { getAnswer, setAnswer, validate, onResult, root, labe
|
|
|
501
503
|
bar.append(error, button);
|
|
502
504
|
area.after(result, bar);
|
|
503
505
|
|
|
504
|
-
const show = (r,
|
|
505
|
-
|
|
506
|
+
const show = (r, past = false) => {
|
|
507
|
+
const ungraded = r.isCorrect === null || r.score === null || r.score === undefined;
|
|
508
|
+
result.textContent = past
|
|
509
|
+
? ungraded
|
|
510
|
+
? '이미 제출했어요.'
|
|
511
|
+
: `지난 점수: ${resultText(r)}`
|
|
512
|
+
: resultText(r);
|
|
506
513
|
result.className = `ec-result ${r.isCorrect ? 'ok' : r.isCorrect === false ? 'no' : ''}`;
|
|
507
514
|
result.hidden = false;
|
|
508
515
|
};
|
|
@@ -513,22 +520,31 @@ function mountSubmit(app, { getAnswer, setAnswer, validate, onResult, root, labe
|
|
|
513
520
|
button.hidden = true;
|
|
514
521
|
error.textContent = '보기 전용이라 제출할 수 없습니다.';
|
|
515
522
|
}
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
523
|
+
// 지난 점수: app.result에는 점수만 있어 채점했는지(isCorrect)는 마지막 제출에서 읽는다 (못 읽으면 점수로 짐작)
|
|
524
|
+
const past =
|
|
525
|
+
app.result && app.result.score !== null && app.result.score !== undefined
|
|
526
|
+
? { score: app.result.score, isCorrect: app.result.score === 100 }
|
|
527
|
+
: null;
|
|
528
|
+
if (past && !app.readOnly) button.textContent = `다시 ${label}`;
|
|
529
|
+
// 다시 열면 마지막 제출의 답을 채우고, 채점 결과({ isCorrect, score })도 화면에 알려 준다.
|
|
530
|
+
// 복원 응답보다 먼저 제출했으면 늦게 온 복원은 버린다 (방금 낸 답 · 결과를 덮지 않게)
|
|
531
|
+
let submitted = false;
|
|
521
532
|
const restored =
|
|
522
|
-
setAnswer || onResult
|
|
533
|
+
setAnswer || onResult || past
|
|
523
534
|
? app
|
|
524
535
|
.lastSubmission()
|
|
525
536
|
.then(last => {
|
|
537
|
+
if (submitted) return;
|
|
538
|
+
// 마지막 제출이 채점하지 않은 것(isCorrect null)이면 '이미 제출', 아니면 지난 점수
|
|
539
|
+
if (past) show(last && last.isCorrect === null ? { ...past, isCorrect: null } : past, true);
|
|
526
540
|
if (!last) return;
|
|
527
541
|
if (setAnswer && last.answer !== null && last.answer !== undefined)
|
|
528
542
|
setAnswer(last.answer);
|
|
529
543
|
onResult?.(last, { restored: true });
|
|
530
544
|
})
|
|
531
|
-
.catch(() =>
|
|
545
|
+
.catch(() => {
|
|
546
|
+
if (past && !submitted) show(past, true);
|
|
547
|
+
})
|
|
532
548
|
: Promise.resolve();
|
|
533
549
|
|
|
534
550
|
button.addEventListener('click', async () => {
|
|
@@ -539,6 +555,7 @@ function mountSubmit(app, { getAnswer, setAnswer, validate, onResult, root, labe
|
|
|
539
555
|
return;
|
|
540
556
|
}
|
|
541
557
|
error.textContent = '';
|
|
558
|
+
submitted = true;
|
|
542
559
|
button.disabled = true;
|
|
543
560
|
button.setAttribute('aria-busy', 'true');
|
|
544
561
|
try {
|
|
@@ -697,11 +714,11 @@ function mountSave(app, { getContent, getGrading, validate, root, label = '저
|
|
|
697
714
|
if (dirty) e.preventDefault();
|
|
698
715
|
});
|
|
699
716
|
|
|
700
|
-
// 실제 SDK의 saveSettings는 edit 토큰으로 자료의 draft에 저장한다. 학생에게는 LXP 편집 페이지의
|
|
717
|
+
// 실제 SDK의 saveSettings는 edit 토큰으로 자료의 draft에 저장한다. 학생에게는 LXP 편집 페이지의 '수업 자료에 반영'(새 버전)부터 보인다
|
|
701
718
|
const savedText = () =>
|
|
702
719
|
app.sdkKind === 'mock'
|
|
703
720
|
? '저장했어요 (mock · 이 브라우저에만).'
|
|
704
|
-
: "저장했어요. 학생에게는 편집
|
|
721
|
+
: "저장했어요. 학생에게는 편집 페이지 위쪽 '수업 자료에 반영'을 누르면 보입니다.";
|
|
705
722
|
|
|
706
723
|
button.addEventListener('click', async () => {
|
|
707
724
|
const next = getContent();
|
|
@@ -747,7 +764,7 @@ function mountSave(app, { getContent, getGrading, validate, root, label = '저
|
|
|
747
764
|
*/
|
|
748
765
|
|
|
749
766
|
|
|
750
|
-
/** 채점 방식 문구 (settings.grading.type, LXP 설정
|
|
767
|
+
/** 채점 방식 문구 (settings.grading.type, LXP 채점 설정 문구 그대로) */
|
|
751
768
|
export const GRADER_TYPES = Object.freeze({
|
|
752
769
|
pattern: {
|
|
753
770
|
label: '기준 답안과 비교해 채점',
|
|
@@ -822,7 +839,7 @@ export function validateAnswerRegex(regex, samples = []) {
|
|
|
822
839
|
return null;
|
|
823
840
|
}
|
|
824
841
|
|
|
825
|
-
/** 라디오 카드 하나 (LXP 설정
|
|
842
|
+
/** 라디오 카드 하나 (LXP 설정 모양) */
|
|
826
843
|
function radioCard(name, value, info, checked) {
|
|
827
844
|
const card = h('label', { className: 'ec-grading-type' });
|
|
828
845
|
const input = h('input', { type: 'radio', name, value, checked });
|
|
@@ -4,15 +4,15 @@ Elice Custom HTML 학습자료 프로젝트입니다.
|
|
|
4
4
|
|
|
5
5
|
## 고치는 곳
|
|
6
6
|
|
|
7
|
-
| 파일 | 화면
|
|
8
|
-
| ------------------------------------------- |
|
|
9
|
-
| `screens/learn.js` · `index.html` | 학생 화면
|
|
10
|
-
| `screens/instructor.js` · `instructor.html` | 교육자 화면
|
|
11
|
-
| `screens/edit.js` · `edit.html` | 내용 편집 화면 (CMS): 내용 JSON 모양(`schema`) · 견본(`sample`)
|
|
12
|
-
| `styles.css` | 이 콘텐츠의 스타일
|
|
7
|
+
| 파일 | 화면 |
|
|
8
|
+
| ------------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
9
|
+
| `screens/learn.js` · `index.html` | 학생 화면 |
|
|
10
|
+
| `screens/instructor.js` · `instructor.html` | 교육자 화면 |
|
|
11
|
+
| `screens/edit.js` · `edit.html` | 내용 편집 화면 (CMS): 내용 JSON 모양(`schema`) · 견본(`sample`) |
|
|
12
|
+
| `styles.css` | 이 콘텐츠의 스타일 |
|
|
13
13
|
| `metadata.json` | 화면 구성(`screens`) · 학습 참고 내용(`commentary`). `ecdk build`가 `build`만 채움 |
|
|
14
14
|
| `package.json` | SDK 버전(`@eliceio/cdk`) · 빌드 옵션 `"ecdk"` (`minify` 등). zip에 들어가지 않음 |
|
|
15
|
-
|
|
15
|
+
실제 내용과 정답은 편집 화면에서 입력합니다. `ecdk dev`의 내용 편집에서 저장한 것은 `.ecdk/settings.json`에 남습니다 (zip에는 들어가지 않음). 기본으로는 로컬에만 있고, publish 스킬로 올릴 때 동의하면 업로드와 함께 보냅니다. 보내지 않으면 LXP에 올린 뒤 편집 화면에서 입력합니다. 내용은 편집 화면이 저장한 것(`settings`)뿐입니다. 기본 내용 파일은 없어서, 편집 화면에서 저장하기 전에는 학생 · 교육자 화면이 "아직 내용이 없습니다" 안내를 보입니다 (`app.hasContent` · `app.emptyState()`).
|
|
16
16
|
|
|
17
17
|
`lib/`(화면 키트)는 플랫폼 연결 로직이라 고치지 않습니다. SDK는 `package.json` 의존성(`@eliceio/cdk`)이고 키트가 import하며, `ecdk build`(Vite)가 화면 코드와 함께 번들로 묶습니다 (처음 한 번 `npm install`, 올리기 `npm update @eliceio/cdk`). 화면은 **누가 보는지(학생 · 교육자 · 튜터)나 미리보기인지 몰라도 됩니다.**
|
|
18
18
|
|
|
@@ -33,13 +33,13 @@ renderForm(app.content);
|
|
|
33
33
|
app.useSave({ getContent, validate });
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
| 키트가 하는 일 |
|
|
37
|
-
| -------------- |
|
|
38
|
-
| 상태 표시 | 로컬 mock SDK일 때만 화면 맨 위에 한 줄 (미리보기 · 교육자 · 튜터링 안내는 LXP 화면이 맡음)
|
|
39
|
-
| 튜터링 | 화면을 읽기 전용으로 잠그고 학생 답을 채움, 제출 버튼 없음
|
|
40
|
-
| 제출 | 검증 문구, 중복 클릭 방지, 결과·오류 안내
|
|
41
|
-
| 다시 열기 | 마지막 답 복원, 지난 점수
|
|
42
|
-
| 저장 (편집) | 저장하지 않은 변경 표시, 검증, 저장 문구, 나가기 경고
|
|
36
|
+
| 키트가 하는 일 | |
|
|
37
|
+
| -------------- | ----------------------------------------------------------------------------------------------------- |
|
|
38
|
+
| 상태 표시 | 로컬 mock SDK일 때만 화면 맨 위에 한 줄 (미리보기 · 교육자 · 튜터링 안내는 LXP 화면이 맡음) |
|
|
39
|
+
| 튜터링 | 화면을 읽기 전용으로 잠그고 학생 답을 채움, 제출 버튼 없음 |
|
|
40
|
+
| 제출 | 검증 문구, 중복 클릭 방지, 결과·오류 안내 |
|
|
41
|
+
| 다시 열기 | 마지막 답 복원, 지난 점수 |
|
|
42
|
+
| 저장 (편집) | 저장하지 않은 변경 표시, 검증, 저장 문구, 나가기 경고 |
|
|
43
43
|
| 내용 편집기 | 내용 JSON을 폼 보기 · 코드 보기로 고침, 스키마 검사 (`lib/elice-content-editor.js`, 편집 화면만 부름) |
|
|
44
44
|
|
|
45
45
|
필요하면 `app.viewer` · `app.readOnly` · `app.records` · `app.navigation` · `app.submit()` · `app.saveContent()`를 직접 써도 됩니다.
|
|
@@ -48,11 +48,11 @@ app.useSave({ getContent, validate });
|
|
|
48
48
|
|
|
49
49
|
처음 화면은 바꿔 쓰라고 넣은 작은 예제입니다. 코드에서 `// 이 자료에 맞게 바꿀 곳`을 찾아 이 자료에 맞게 바꾸고, `commentary.txt`도 다시 씁니다.
|
|
50
50
|
|
|
51
|
-
| 화면 | 예제
|
|
52
|
-
| ------ |
|
|
53
|
-
| 편집 | 키트 내용 편집기(`lib/elice-content-editor.js`)가 `schema`로 칸을 그림. 폼 보기(항목 추가 · 삭제 · 되돌리기 · 끌어서 순서) · 코드 보기(JSON 붙여 넣기 · 정렬 · 오류 위치)
|
|
51
|
+
| 화면 | 예제 |
|
|
52
|
+
| ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
53
|
+
| 편집 | 키트 내용 편집기(`lib/elice-content-editor.js`)가 `schema`로 칸을 그림. 폼 보기(항목 추가 · 삭제 · 되돌리기 · 끌어서 순서) · 코드 보기(JSON 붙여 넣기 · 정렬 · 오류 위치) |
|
|
54
54
|
| 학생 | 항목마다 막대를 끌거나(← → 키) 숫자를 넣어 예측 → 합계 · 큰 순서가 바로 바뀜 → '정답 보기'로 실제 값 · 차이, '다시 예측'. 제출은 없음 (주석의 `useSubmit`을 풀면 예측을 제출) |
|
|
55
|
-
| 교육자 | 항목 표
|
|
55
|
+
| 교육자 | 항목 표 |
|
|
56
56
|
|
|
57
57
|
내용 모양을 먼저 정하고(`{ title, intro, unit, items: [{ name, value, note }] }`), 학생 화면은 그 모양만 읽습니다. 모양을 바꾸면 `screens/edit.js`의 `schema` · `sample`과 `screens/learn.js`를 같이 고칩니다. 예제의 값은 '정답 보기'로 보여 주는 공개 자료라 내용에 둡니다. 채점할 답은 내용에 넣지 않습니다(아래 "정답").
|
|
58
58
|
|
|
@@ -61,7 +61,10 @@ app.useSave({ getContent, validate });
|
|
|
61
61
|
import { useContentEditor } from '../lib/elice-content-editor.js';
|
|
62
62
|
const editor = useContentEditor(app, {
|
|
63
63
|
initial: sample, // 저장한 내용이 없을 때 시작할 견본 (기본 내용 파일은 없음)
|
|
64
|
-
schema: {
|
|
64
|
+
schema: {
|
|
65
|
+
title: { label: '제목', required: true },
|
|
66
|
+
items: { label: '항목', min: 2, item: { value: { type: 'number' } } },
|
|
67
|
+
},
|
|
65
68
|
});
|
|
66
69
|
app.useSave({ getContent: editor.getContent, validate: editor.validate });
|
|
67
70
|
```
|
|
@@ -84,10 +87,10 @@ app.useSave({ getContent: editor.getContent, validate: editor.validate });
|
|
|
84
87
|
|
|
85
88
|
## 정답
|
|
86
89
|
|
|
87
|
-
정답은 zip에 넣지 않습니다 (ADR 0009,
|
|
90
|
+
정답은 zip에 넣지 않습니다 (ADR 0009, ecdk 스킬의 `references/02-design-the-material.md` · `05-screen-code.md`).
|
|
88
91
|
|
|
89
92
|
- **채점 방식 · 답**: 답을 채점하는 자료면 편집 화면에 키트의 채점 블록을 붙입니다: `const grading = app.useGradingBlock();` 후 `app.useSave({ …, getGrading: () => grading.getGrading() })`. LXP와 같은 문구로 기준 답안(정규표현식) · 평가 기준을 받아 `settings.grading`에 저장합니다 (학생에게는 내려가지 않음).
|
|
90
|
-
- **완료 정책**:
|
|
93
|
+
- **완료 정책**: LXP 페이지 설정입니다 (열면 완료 · 제출하면 완료 · 채점해 통과하면 완료, ADR 0012). publish 스킬이 동의를 받아 업로드 때 정하거나 교육자가 LXP 편집 페이지 위쪽 '설정' 패널에서 고릅니다. 채점은 채점해 통과하면 완료(on_graded)일 때만 합니다. 제출하면 완료(on_submit)는 제출만으로 완료되고 채점하지 않으며(키트는 "제출했어요."), 열면 완료(on_access)는 열면 완료됩니다. 프로젝트에는 적지 않습니다. 교육자가 '제출하면 완료' · '채점해 완료'를 고를 수 있게 하려면 학생 화면에 제출(`app.useSubmit`)을, '채점해 완료'까지 고를 수 있게 하려면 편집 화면에 채점 블록(위)을 둡니다.
|
|
91
94
|
- `ecdk dev`의 내용 편집에서 저장한 내용 · 채점 설정(`{ "type": "pattern", "answer_key": "^…$" }` · `{ "type": "rubric", "rubric": "…" }`)은 `.ecdk/settings.json`에 남고 로컬 채점에 쓰입니다 (채점 설정이 없으면 제출만 받음). `ecdk build`가 zip에서 뺍니다. 정답 파일은 없습니다 (ADR 0011).
|
|
92
95
|
|
|
93
96
|
## 명령
|
|
@@ -39,7 +39,7 @@ const sample = {
|
|
|
39
39
|
|
|
40
40
|
const editor = useContentEditor(app, { initial: sample, schema });
|
|
41
41
|
|
|
42
|
-
// 답을 채점하는 자료면 채점 방식 · 답 블록을 붙이고 getGrading을 넘깁니다 (ADR 0009,
|
|
42
|
+
// 답을 채점하는 자료면 채점 방식 · 답 블록을 붙이고 getGrading을 넘깁니다 (ADR 0009, ecdk 스킬의 references/05-screen-code.md):
|
|
43
43
|
// const grading = app.useGradingBlock();
|
|
44
44
|
// app.useSave({ getContent: editor.getContent, validate: editor.validate, getGrading: () => grading.getGrading() });
|
|
45
45
|
app.useSave({ getContent: editor.getContent, validate: editor.validate });
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
"name": "blank",
|
|
3
3
|
"version": "1.2.0",
|
|
4
4
|
"title": "빈 자료",
|
|
5
|
-
"description": "퀴즈가 아닌 모든 자료(시뮬레이션 · 시각화 · 활동 · 설명 · 플래시카드 · 설문)를 직접 만들 때. 예제 \"예측하고 확인하기\"(막대 예측 · 정답 보기)와 내용 JSON 편집기(폼 보기 · 코드 보기)로 시작 (완료 정책은 LXP 설정
|
|
5
|
+
"description": "퀴즈가 아닌 모든 자료(시뮬레이션 · 시각화 · 활동 · 설명 · 플래시카드 · 설문)를 직접 만들 때. 예제 \"예측하고 확인하기\"(막대 예측 · 정답 보기)와 내용 JSON 편집기(폼 보기 · 코드 보기)로 시작 (완료 정책은 LXP 자료 편집 화면의 '설정'에서 교육자가 고름)"
|
|
6
6
|
}
|
package/templates/quiz/README.md
CHANGED
|
@@ -7,7 +7,6 @@ Elice Custom HTML 학습자료 프로젝트입니다.
|
|
|
7
7
|
| 파일 | 화면 |
|
|
8
8
|
| ------------------------------------------- | ------------------------------------------------------ |
|
|
9
9
|
| `screens/learn.js` · `index.html` | 학생 화면 (무엇을 어떤 순서로 놓을지) |
|
|
10
|
-
| `screens/instructor.js` · `instructor.html` | 교육자 화면 |
|
|
11
10
|
| `screens/edit.js` · `edit.html` | 내용 편집 화면 (CMS) |
|
|
12
11
|
| `ui/` | 퀴즈의 모양: 색 · 간격 · 문구 · 마크업 (아래 표) |
|
|
13
12
|
| `styles.css` | 이 콘텐츠의 스타일 (값은 `ui/theme.css`의 변수) |
|
|
@@ -18,7 +17,7 @@ Elice Custom HTML 학습자료 프로젝트입니다.
|
|
|
18
17
|
```
|
|
19
18
|
ui/ 모양 — 마음대로 고칩니다
|
|
20
19
|
├─ theme.css 색 · 간격 · 모서리 · 보기 카드 (EDS 토큰 위의 --qz-* 변수)
|
|
21
|
-
├─ texts.js 화면에 보이는 문구 전부 (탭 제목 · 불러오는 중 · 학생 ·
|
|
20
|
+
├─ texts.js 화면에 보이는 문구 전부 (탭 제목 · 불러오는 중 · 학생 · 편집 · 검증 문구)
|
|
22
21
|
└─ templates/ HTML 조각 (question · choice · text · order · group · page · edit)
|
|
23
22
|
screens/ 배치 — 어떤 블록을 어떤 순서로 보일지
|
|
24
23
|
core/ 동작 — 고치지 않습니다 (답 문자열 · 채점 약속, 고르기 · 끌어 놓기 · 순서 바꾸기). ui/를 부르지 않고, 템플릿 · 문구는 screens/가 넘깁니다
|
|
@@ -48,7 +47,9 @@ core/ 동작 — 고치지 않습니다 (답 문자열 · 채점 약속,
|
|
|
48
47
|
|
|
49
48
|
보기 · 칸 · 그룹 · 문항 요소의 `data-role` · `data-option` · `data-slot` · `data-group` · `data-id`, 상태 표시 `data-result`(`correct` · `wrong`) · `data-dragging` · `data-ghost`는 동작이 붙입니다. CSS에서 이 속성으로 상태를 꾸밀 수 있습니다.
|
|
50
49
|
|
|
51
|
-
|
|
50
|
+
실제 내용과 정답은 편집 화면에서 입력합니다. `ecdk dev`의 내용 편집에서 저장한 것은 `.ecdk/settings.json`에 남습니다 (zip에는 들어가지 않음). 기본으로는 로컬에만 있고, publish 스킬로 올릴 때 동의하면 업로드와 함께 보냅니다. 보내지 않으면 LXP에 올린 뒤 편집 화면에서 입력합니다. 내용은 편집 화면이 저장한 것(`settings`)뿐입니다. 기본 문항은 없어서, 편집 화면에서 저장하기 전에는 학생 화면이 "아직 내용이 없습니다" 안내를 보입니다 (`app.hasContent` · `app.emptyState()`).
|
|
51
|
+
|
|
52
|
+
교육자 화면은 없습니다 (`metadata.json` `screens.instructor.enabled: false`). LXP에서 교육자가 열면 학생 화면이 열려 직접 풀고 제출해 볼 수 있고, 교육자의 제출은 채점만 하고 기록되지 않습니다. 교육자 화면이 필요하면 `instructor.html` · `screens/instructor.js`를 만들고 `metadata.json`에서 켭니다.
|
|
52
53
|
|
|
53
54
|
`lib/`(화면 키트)는 플랫폼 연결 로직이라 고치지 않습니다. SDK는 `package.json` 의존성(`@eliceio/cdk`)이고 키트가 import하며, `ecdk build`(Vite)가 화면 코드와 함께 번들로 묶습니다 (처음 한 번 `npm install`, 올리기 `npm update @eliceio/cdk`). 화면은 **누가 보는지(학생 · 교육자 · 튜터)나 미리보기인지 몰라도 됩니다.**
|
|
54
55
|
|
|
@@ -91,11 +92,11 @@ app.useSave({ getContent, validate });
|
|
|
91
92
|
|
|
92
93
|
## 퀴즈 데이터와 정답
|
|
93
94
|
|
|
94
|
-
- 문항은 편집 화면에서 만들어 저장한 내용(`settings`)뿐입니다. 처음에는 문항이 없어 편집 화면은 **문항 추가**로 시작하고, 저장하기 전 학생
|
|
95
|
+
- 문항은 편집 화면에서 만들어 저장한 내용(`settings`)뿐입니다. 처음에는 문항이 없어 편집 화면은 **문항 추가**로 시작하고, 저장하기 전 학생 화면은 "아직 내용이 없습니다" 안내를 보입니다. 형식은 ecdk 문서 ADR 0006.
|
|
95
96
|
- 퀴즈 하나에 문항은 **하나**입니다 (기존 LXP 퀴즈처럼). 문항이 있으면 "문항 추가" 대신 안내가 보이고, 여러 문항은 퀴즈 페이지를 여러 개 만듭니다. 이미 여러 문항으로 저장된 퀴즈도 그대로 보이고 저장됩니다.
|
|
96
97
|
- 문항 유형: 단일 선택 · 복수 선택 · 순서 맞추기 · 주관식 · 그룹 분류
|
|
97
98
|
- 학생 답은 문자열 하나로 제출합니다: 문항 순서대로 `문항id=답`을 `;`로 잇고 주관식은 URL 인코딩 (`q1=b;q2=a,d;q4=%EA%B0%80…`).
|
|
98
|
-
- 퀴즈는 채점 방식 **기준 답안(pattern)** 고정이고, 모든 문항을 맞혀야 100점입니다 (문항별 점수 없음, ADR 0009). 편집 화면은 답(`settings.grading`)만 저장합니다. 완료 정책은 LXP
|
|
99
|
+
- 퀴즈는 채점 방식 **기준 답안(pattern)** 고정이고, 모든 문항을 맞혀야 100점입니다 (문항별 점수 없음, ADR 0009). 편집 화면은 답(`settings.grading`)만 저장합니다. 완료 정책은 LXP 페이지 설정입니다 (ADR 0012): publish 스킬이 동의를 받아 업로드 때 정하거나 교육자가 LXP 편집 페이지 위쪽 '설정' 패널에서 고릅니다. 퀴즈는 **채점해 통과하면 완료(on_graded)**여야 채점합니다. 제출하면 완료(on_submit)면 서버가 채점하지 않고 제출만으로 완료되어 점수 없이 "제출했어요."가 보입니다.
|
|
99
100
|
|
|
100
101
|
## 정답
|
|
101
102
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"kind": "material",
|
|
3
3
|
"screens": {
|
|
4
4
|
"learn": { "enabled": true, "entry": "index.html" },
|
|
5
|
-
"instructor": { "enabled":
|
|
5
|
+
"instructor": { "enabled": false },
|
|
6
6
|
"edit": { "enabled": true, "entry": "edit.html" }
|
|
7
7
|
},
|
|
8
8
|
"commentary": "commentary.txt"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// 내용 편집 화면(CMS). 기존 퀴즈 편집 폼을 옮김 (docs/quiz-spec.md §3). 저장 버튼 · 변경 표시는 키트(useSave)가 합니다.
|
|
2
|
-
// 퀴즈는 채점 방식 pattern 고정 (ADR 0009, 완료 정책은 LXP 설정
|
|
2
|
+
// 퀴즈는 채점 방식 pattern 고정 (ADR 0009, 완료 정책은 LXP 자료 편집 화면의 '설정'에서 교육자가 고름, ADR 0012): 문항 카드마다 정답을
|
|
3
3
|
// 고르고 (단일 · 복수 · 그룹은 보기 줄에서 바로, 순서 · 주관식은 아래 "정답"에서), 저장할 때 고른 답으로 정답 정규식 하나를 만들어 검증한 뒤 settings.grading에 함께 저장합니다.
|
|
4
4
|
// 문제 내용(content)은 학생에게도 내려가므로 정답을 넣지 않습니다 (정답은 grading에만, 서버가 학생에게 내려주지 않음).
|
|
5
5
|
// 여기서는 어떤 칸을 어떤 순서로 놓을지만 정합니다. 모양은 ui/(templates/edit.js · texts · theme.css), 동작은 core/.
|
|
@@ -18,7 +18,7 @@ else root.replaceChildren(app.emptyState());
|
|
|
18
18
|
|
|
19
19
|
function show() {
|
|
20
20
|
const { title, description, questions = [] } = app.content;
|
|
21
|
-
//
|
|
21
|
+
// 문항 유형은 보이지 않는다 (무엇을 할지는 질문 문장이 알려 줌). 교육자도 이 화면에서 풀어 본다 (교육자 화면 없음)
|
|
22
22
|
const views = questions.map((q, i) =>
|
|
23
23
|
renderQuestion(q, i, {
|
|
24
24
|
templates,
|
|
@@ -1,24 +1,7 @@
|
|
|
1
1
|
/* 퀴즈 앱 스타일. 색 · 간격 · 모서리 값은 ui/theme.css(그 아래는 EDS 토큰 lib/elice-tokens.css), 모양은 EDS 컴포넌트 명세를 따릅니다
|
|
2
|
-
보기 = RadioCard · 유형 표시
|
|
2
|
+
보기 = RadioCard · 유형 표시 = Tag(muted) · 해설 = Accordion */
|
|
3
3
|
|
|
4
|
-
/* ---------- 학생
|
|
5
|
-
/* Tag filled primary medium: 24px, 모서리 6px, 11px / 700 */
|
|
6
|
-
.qz-badge {
|
|
7
|
-
align-self: flex-start;
|
|
8
|
-
display: inline-flex;
|
|
9
|
-
align-items: center;
|
|
10
|
-
height: 24px;
|
|
11
|
-
padding: 0 6px;
|
|
12
|
-
border-radius: 6px;
|
|
13
|
-
font-size: 11px;
|
|
14
|
-
font-weight: var(--eds-fw-bold);
|
|
15
|
-
color: var(--qz-accent-contrast);
|
|
16
|
-
background: var(--qz-accent);
|
|
17
|
-
}
|
|
18
|
-
.qz-badge.dark {
|
|
19
|
-
background: var(--eds-secondary-main);
|
|
20
|
-
color: var(--eds-secondary-contrast-text);
|
|
21
|
-
}
|
|
4
|
+
/* ---------- 학생 ---------- */
|
|
22
5
|
.qz-title {
|
|
23
6
|
margin: 0;
|
|
24
7
|
}
|
|
@@ -30,19 +13,6 @@
|
|
|
30
13
|
font-size: var(--eds-fs-caption);
|
|
31
14
|
margin: 0;
|
|
32
15
|
}
|
|
33
|
-
.qz-summary {
|
|
34
|
-
display: flex;
|
|
35
|
-
flex-direction: column;
|
|
36
|
-
gap: 6px;
|
|
37
|
-
padding: 16px 20px;
|
|
38
|
-
border: 1px solid var(--qz-question-border);
|
|
39
|
-
border-radius: var(--qz-radius-card);
|
|
40
|
-
background: var(--qz-surface);
|
|
41
|
-
}
|
|
42
|
-
.qz-summary p {
|
|
43
|
-
margin: 0;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
16
|
.qz-question {
|
|
47
17
|
margin: 0;
|
|
48
18
|
padding: var(--qz-card-padding);
|
|
@@ -406,7 +376,7 @@
|
|
|
406
376
|
.qz-group:hover .ec-dropzone {
|
|
407
377
|
border-color: var(--qz-accent);
|
|
408
378
|
}
|
|
409
|
-
/* 읽기 전용(
|
|
379
|
+
/* 읽기 전용(disabled로 그린 문항): 놓으라는 안내 · 누르는 손 모양을 감춘다 (빈 칸 자리는 그대로) */
|
|
410
380
|
.qz-question:disabled .qz-group {
|
|
411
381
|
cursor: default;
|
|
412
382
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quiz",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"title": "퀴즈",
|
|
5
|
-
"description": "한 문항 퀴즈 (여러 문항은 페이지를 여러 개로). 문항 없이 시작해 편집 화면 \"문항 추가\"로 선택 · 순서 · 주관식 · 그룹 분류 문항 하나를 만듦. 정답은 편집 화면에서 정하고 기준 답안(pattern)으로 채점 (완료 정책은 LXP 설정
|
|
5
|
+
"description": "한 문항 퀴즈 (여러 문항은 페이지를 여러 개로). 문항 없이 시작해 편집 화면 \"문항 추가\"로 선택 · 순서 · 주관식 · 그룹 분류 문항 하나를 만듦. 정답은 편집 화면에서 정하고 기준 답안(pattern)으로 채점 (완료 정책은 LXP 자료 편집 화면의 '설정'에서 교육자가 고름)"
|
|
6
6
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
//
|
|
1
|
+
// 학생 화면 머리와 불러오는 동안 보이는 자리. 문항 위에 무엇을 보일지 여기서 고칩니다.
|
|
2
2
|
import { html } from '../../core/dom.js';
|
|
3
3
|
import { markdown } from '../../core/markdown.js';
|
|
4
4
|
import { texts } from '../texts.js';
|
|
5
5
|
|
|
6
|
-
/** 내용을 받기 전까지 보이는 문구 (학생 ·
|
|
6
|
+
/** 내용을 받기 전까지 보이는 문구 (학생 · 편집 공통) */
|
|
7
7
|
export const loading = () => html`<p class="ec-muted">${texts.page.loading}</p>`;
|
|
8
8
|
|
|
9
9
|
/** 학생 화면 머리: 제목 · 안내 */
|
|
@@ -11,18 +11,3 @@ export const learnHeader = ({ title, description }) => html`
|
|
|
11
11
|
<h1 class="qz-title">${title}</h1>
|
|
12
12
|
${description ? markdown(description, 'qz-markdown qz-lead') : null}
|
|
13
13
|
`;
|
|
14
|
-
|
|
15
|
-
/** 교육자 화면 머리: 제목 · 요약. byType: [[유형 이름, 문항 수], …] */
|
|
16
|
-
export const instructorHeader = ({ title, count, byType }) => html`
|
|
17
|
-
<h1 class="qz-title">${title}</h1>
|
|
18
|
-
<section class="qz-summary">
|
|
19
|
-
<span class="qz-badge dark">${texts.instructor.badge}</span>
|
|
20
|
-
<p>
|
|
21
|
-
${texts.instructor.summary(
|
|
22
|
-
count,
|
|
23
|
-
byType.map(([type, n]) => texts.instructor.summaryType(type, n)),
|
|
24
|
-
)}
|
|
25
|
-
</p>
|
|
26
|
-
<p class="qz-muted">${texts.instructor.note}</p>
|
|
27
|
-
</section>
|
|
28
|
-
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// 문항
|
|
1
|
+
// 문항 겉모양: 제목 · 유형 표시(labels.types를 넘길 때만) · 지문 · 본문 · 결과 · 해설
|
|
2
2
|
// 꼭 남길 것: data-role="result" (정답 · 오답 문구 자리), data-role="explanation" (해설, 처음엔 hidden)
|
|
3
3
|
// 동작이 문항 요소에 data-role="question" · data-id · data-result="correct|wrong"를 붙입니다.
|
|
4
4
|
import { html } from '../../core/dom.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// 퀴즈 화면에 보이는 문구 모음 (학생 ·
|
|
1
|
+
// 퀴즈 화면에 보이는 문구 모음 (학생 · 편집). 문구를 바꾸려면 여기만 고치면 됩니다.
|
|
2
2
|
// 숫자 · 이름이 들어가는 문구는 함수입니다: 모양(인자)은 그대로 두고 돌려주는 글만 바꾸세요.
|
|
3
3
|
|
|
4
4
|
export const texts = {
|
|
@@ -14,7 +14,6 @@ export const texts = {
|
|
|
14
14
|
/** 브라우저 탭 제목 · 불러오는 동안 보이는 문구 (화면이 넣음. HTML의 같은 글은 스크립트가 돌기 전 대비용) */
|
|
15
15
|
page: {
|
|
16
16
|
learn: '학생 화면',
|
|
17
|
-
instructor: '교육자 화면',
|
|
18
17
|
edit: '내용 편집',
|
|
19
18
|
loading: '불러오는 중…',
|
|
20
19
|
},
|
|
@@ -50,15 +49,7 @@ export const texts = {
|
|
|
50
49
|
unanswered: no => `${no}번 문항에 답해 주세요.`,
|
|
51
50
|
},
|
|
52
51
|
|
|
53
|
-
/**
|
|
54
|
-
instructor: {
|
|
55
|
-
badge: '교육자 화면',
|
|
56
|
-
summary: (count, byType) => `문항 ${count}개 · ${byType.join(' · ')}`,
|
|
57
|
-
summaryType: (type, n) => `${type} ${n}`,
|
|
58
|
-
note: '정답은 내용 편집 화면에서 문항마다 정합니다. 모든 문항을 맞혀야 100점입니다.',
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
/** 문항 (학생 · 교육자 공통) */
|
|
52
|
+
/** 문항 */
|
|
62
53
|
question: {
|
|
63
54
|
title: (no, title) => `${no}. ${title}`,
|
|
64
55
|
correct: '정답',
|