@eliceio/cdk-cli 1.4.0 → 1.5.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 (79) hide show
  1. package/README.md +17 -16
  2. package/es/cli.js +1 -1
  3. package/es/commands/create/index.js +1 -0
  4. package/es/commands/create/scaffold.d.ts +1 -1
  5. package/es/commands/create/scaffold.js +1 -1
  6. package/es/core/config.d.ts +36 -0
  7. package/es/core/config.js +234 -6
  8. package/es/core/quiz-check.js +123 -4
  9. package/es/dev/grading.d.ts +26 -4
  10. package/es/dev/grading.js +66 -11
  11. package/es/dev/mock-api.d.ts +6 -1
  12. package/es/dev/mock-api.js +45 -6
  13. package/es/rules/answers.d.ts +1 -0
  14. package/es/rules/answers.js +8 -0
  15. package/es/rules.json.js +1 -1
  16. package/package.json +2 -2
  17. package/rules.json +1 -1
  18. package/skills/_shared/always.md +1 -1
  19. package/skills/_shared/references/02-design-the-material.md +8 -7
  20. package/skills/_shared/references/03-create-the-project.md +10 -9
  21. package/skills/_shared/references/12-upload-with-the-material-mcp.md +5 -5
  22. package/skills/_shared/references/16-using-the-survey-template.md +158 -0
  23. package/skills/elice-content-create/SKILL.md +2 -2
  24. package/skills/elice-content-edit/SKILL.md +2 -2
  25. package/skills/elice-content-publish/SKILL.md +1 -1
  26. package/templates/_shared/lib/cdk-mock.d.ts +22 -3
  27. package/templates/_shared/lib/cdk-mock.js +78 -11
  28. package/templates/_shared/lib/elice-content.d.ts +17 -1
  29. package/templates/_shared/lib/elice-content.js +47 -5
  30. package/templates/blank/template.json +1 -1
  31. package/templates/document/template.json +1 -1
  32. package/templates/quiz/README.md +26 -1
  33. package/templates/quiz/core/behaviors.d.ts +5 -0
  34. package/templates/quiz/core/behaviors.js +16 -1
  35. package/templates/quiz/core/model.d.ts +78 -1
  36. package/templates/quiz/core/model.js +219 -4
  37. package/templates/quiz/screens/edit.js +244 -55
  38. package/templates/quiz/screens/learn.js +137 -27
  39. package/templates/quiz/styles.css +258 -5
  40. package/templates/quiz/template.json +1 -1
  41. package/templates/quiz/ui/templates/edit.d.ts +1 -0
  42. package/templates/quiz/ui/templates/edit.js +67 -8
  43. package/templates/quiz/ui/templates/page.js +34 -0
  44. package/templates/quiz/ui/templates/text.js +15 -2
  45. package/templates/quiz/ui/texts.js +61 -0
  46. package/templates/steps/template.json +1 -1
  47. package/templates/survey/README.md +112 -0
  48. package/templates/survey/commentary.txt +2 -0
  49. package/templates/survey/core/behaviors.d.ts +14 -0
  50. package/templates/survey/core/behaviors.js +115 -0
  51. package/templates/survey/core/dom.d.ts +13 -0
  52. package/templates/survey/core/dom.js +83 -0
  53. package/templates/survey/core/editor.d.ts +80 -0
  54. package/templates/survey/core/editor.js +720 -0
  55. package/templates/survey/core/markdown.d.ts +21 -0
  56. package/templates/survey/core/markdown.js +298 -0
  57. package/templates/survey/core/model.d.ts +83 -0
  58. package/templates/survey/core/model.js +209 -0
  59. package/templates/survey/core/rich-text.d.ts +18 -0
  60. package/templates/survey/core/rich-text.js +469 -0
  61. package/templates/survey/edit.html +26 -0
  62. package/templates/survey/gitignore +4 -0
  63. package/templates/survey/index.html +26 -0
  64. package/templates/survey/metadata.json +9 -0
  65. package/templates/survey/package.json +13 -0
  66. package/templates/survey/screens/edit.js +345 -0
  67. package/templates/survey/screens/learn.js +100 -0
  68. package/templates/survey/styles.css +1264 -0
  69. package/templates/survey/template.json +6 -0
  70. package/templates/survey/ui/templates/edit.d.ts +27 -0
  71. package/templates/survey/ui/templates/edit.js +656 -0
  72. package/templates/survey/ui/templates/index.d.ts +3 -0
  73. package/templates/survey/ui/templates/index.js +3 -0
  74. package/templates/survey/ui/templates/learn.js +147 -0
  75. package/templates/survey/ui/templates/page.js +19 -0
  76. package/templates/survey/ui/texts.d.ts +3 -0
  77. package/templates/survey/ui/texts.js +116 -0
  78. package/templates/survey/ui/theme.css +42 -0
  79. package/templates/video/template.json +10 -3
@@ -26,11 +26,12 @@ const icons = {
26
26
  />
27
27
  </svg>
28
28
  `,
29
- info: () => html`
29
+ info: (size = 20, className = null) => html`
30
30
  <svg
31
+ class="${className}"
31
32
  viewBox="0 0 24 24"
32
- width="20"
33
- height="20"
33
+ width="${size}"
34
+ height="${size}"
34
35
  fill="none"
35
36
  stroke="currentColor"
36
37
  stroke-width="2"
@@ -42,6 +43,23 @@ const icons = {
42
43
  <path d="M12 11v5M12 8h.01" />
43
44
  </svg>
44
45
  `,
46
+ /** 채점 기준 작성 가이드 아이콘 (펼친 책, 연주님 디자인) */
47
+ book: () => html`
48
+ <svg
49
+ viewBox="0 0 24 24"
50
+ width="20"
51
+ height="20"
52
+ fill="none"
53
+ stroke="currentColor"
54
+ stroke-width="2"
55
+ stroke-linecap="round"
56
+ stroke-linejoin="round"
57
+ aria-hidden="true"
58
+ >
59
+ <path d="M2 5.5C4.5 4 8.5 4 12 6c3.5-2 7.5-2 10-.5V19c-2.5-1.5-6.5-1.5-10 .5-3.5-2-7.5-2-10-.5z" />
60
+ <path d="M12 6v13.5" />
61
+ </svg>
62
+ `,
45
63
  check: () => html`
46
64
  <svg
47
65
  viewBox="0 0 24 24"
@@ -738,15 +756,15 @@ export const card = ({ q, index, count, types, body, points }) => html`
738
756
  * 부분 채점 설정 (문제가 2개 이상일 때 편집 화면 맨 위, 연주님 부분 채점 UI): 스위치 · 안내, 켜면 배점 방식 · 합계 · 동일 점수 버튼.
739
757
  * data-role="partial"(스위치) · "sum"(합계 줄, data-mode="equal|custom") · "mode" · "total" · "equal" · "note"
740
758
  */
741
- export const scoreSettings = ({ partial }) => html`
759
+ export const scoreSettings = ({ partial, locked = false }) => html`
742
760
  <section class="qe-score" data-role="score-settings">
743
- <label class="qe-score-switch">
761
+ <label class="qe-score-switch" ${locked && 'data-locked'}>
744
762
  <span class="qe-sw">
745
- <input type="checkbox" role="switch" data-role="partial" ${partial && "checked"} />
763
+ <input type="checkbox" role="switch" data-role="partial" ${partial && "checked"} ${locked && "disabled"} />
746
764
  <span class="qe-sw-track" aria-hidden="true"></span>
747
765
  </span>
748
766
  <span class="qe-score-title">${t.scoring.toggle}</span>
749
- <span class="qe-score-hint">${partial ? t.scoring.hintOn : t.scoring.hintOff}</span>
767
+ <span class="qe-score-hint">${locked ? t.scoring.perQuestionLocked : partial ? t.scoring.hintOn : t.scoring.hintOff}</span>
750
768
  </label>
751
769
  <div class="qe-score-sum" data-role="sum" ${!partial && "hidden"}>
752
770
  <div class="qe-score-row">
@@ -820,17 +838,58 @@ export const textAnswers = ({ rows, add }) => html`<div class="qe-options qe-tex
820
838
  * 주관식 정답 칸 (연주님 2026-11-19): 정답 입력 방식 세그먼트(직접 입력 · 정규 표현식) + 안내, 아래에 목록 또는 정규식 칸.
821
839
  * data-role: "mode-list" · "mode-regex"(role=radio) · "mode-hint" · "list-area" · "regex-area"
822
840
  */
823
- export const textAnswerBox = ({ list, regex }) => html`
841
+ export const textAnswerBox = ({ list, regex, rubric }) => html`
824
842
  <div class="qe-text-answer-box">
825
843
  <div class="qe-seg-row">
826
844
  <div class="qe-seg" role="radiogroup" aria-label="${ta.modeLabel}">
827
845
  <button type="button" role="radio" class="qe-seg-btn" data-role="mode-list" aria-checked="true" tabindex="0">${ta.modeList}</button>
828
846
  <button type="button" role="radio" class="qe-seg-btn" data-role="mode-regex" aria-checked="false" tabindex="-1">${ta.modeRegex}</button>
847
+ <button type="button" role="radio" class="qe-seg-btn" data-role="mode-rubric" aria-checked="false" tabindex="-1">${ta.modeRubric}</button>
829
848
  </div>
830
849
  <span class="qe-seg-hint" data-role="mode-hint" data-ec-quiet></span>
831
850
  </div>
832
851
  <div data-role="list-area">${list}</div>
833
852
  <div data-role="regex-area" hidden>${regex}</div>
853
+ <div data-role="rubric-area" hidden>${rubric}</div>
854
+ </div>
855
+ `;
856
+
857
+ /**
858
+ * AI 채점 문항의 채점 기준 칸 (1.11.0). LXP AI 채점 설정의 "채점 기준 + 작성 가이드"를 퀴즈 카드 안 모양으로 옮김.
859
+ * 연주님 디자인: 라벨은 칸 위(outlined 칸), 아래에 배점 환산 안내(배점이 100점이 아닐 때만) · 작성 가이드(책 아이콘).
860
+ * data-role: "input"(채점 기준) · "count"(글자 수, data-ec-quiet) · "score-note"(배점 환산 안내, 처음엔 숨김) ·
861
+ * "score-text"(그 글, 화면이 채움). 배점은 카드 머리의 배점 칸
862
+ */
863
+ export const rubricAnswer = ({ max }) => html`
864
+ <div class="qe-rubric">
865
+ <div class="qe-rubric-field">
866
+ <div class="qe-rubric-head">
867
+ <span class="qe-rubric-label" aria-hidden="true">${ta.rubricLabel}<span class="qe-required">*</span></span>
868
+ <span class="qe-count" data-role="count" data-ec-quiet>${ta.rubricCount(0, max)}</span>
869
+ </div>
870
+ <textarea
871
+ class="qe-rubric-input ec-field-input"
872
+ data-role="input"
873
+ rows="5"
874
+ maxlength="${max}"
875
+ aria-label="${ta.rubricLabel}"
876
+ aria-required="true"
877
+ placeholder="${ta.rubricPlaceholder}"
878
+ ></textarea>
879
+ </div>
880
+ <p class="qe-rubric-score" data-role="score-note" role="note" hidden>
881
+ ${icons.info(16, "qe-rubric-score-icon")}
882
+ <span data-role="score-text"></span>
883
+ </p>
884
+ <div class="qe-rubric-guide" role="note">
885
+ <span class="qe-rubric-guide-icon">${icons.book()}</span>
886
+ <div class="qe-rubric-guide-body">
887
+ <p class="qe-rubric-guide-title">${ta.rubricGuideTitle}</p>
888
+ <ol class="qe-rubric-guide-list">
889
+ ${ta.rubricGuide.map((line) => html`<li>${line}</li>`)}
890
+ </ol>
891
+ </div>
892
+ </div>
834
893
  </div>
835
894
  `;
836
895
 
@@ -36,3 +36,37 @@ export const partialScore = ({ score }) => html`
36
36
  </span>
37
37
  <img class="qz-overall-img" src="img/mascot-half.webp" alt="" />
38
38
  `;
39
+
40
+ /**
41
+ * 문항별 채점(per_question)에서 통과 점수 이상이지만 100점이 아닐 때 결과 상자 안 (partialScore와 같은 자리 · 모양, 제목 · 안내만 다름).
42
+ * 서버는 합계가 pass_score 이상이면 완료로 기록한다
43
+ */
44
+ export const passedScore = ({ score, pass }) => html`
45
+ <strong class="qz-overall-score"><span>${score}</span><small>${texts.learn.scoreUnit}</small></strong>
46
+ <span class="qz-overall-text">
47
+ <strong class="qz-overall-title">${texts.learn.passTitle}</strong>
48
+ <span class="qz-overall-hint">${texts.learn.passSub(pass)}</span>
49
+ </span>
50
+ <img class="qz-overall-img" src="img/mascot-half.webp" alt="" />
51
+ `;
52
+
53
+ /**
54
+ * AI 채점 문제 카드의 결과 줄 안 "AI 채점 결과 20 / 35점" (연주님 디자인: 점수는 .qz-ai-score 굵게, "/ 35점"은 .qz-ai-max).
55
+ * 결과 줄은 아이콘과 글을 띄워 놓는 flex 줄이라 글 조각을 한 덩어리(span)로 묶는다. suffix: 뒤에 붙일 글 (로컬 흉내 점수 표시)
56
+ */
57
+ export const aiScore = ({ score, max, suffix = '' }) =>
58
+ html`<span>${texts.learn.rubricScore} <strong class="qz-ai-score">${score}</strong><span class="qz-ai-max">${texts.learn.rubricMax(max)}</span>${suffix}</span>`;
59
+
60
+ /**
61
+ * AI 채점 문제가 있는 퀴즈(per_question)에서 제출하고 결과를 기다리는 동안 제출 바 위 (처음엔 숨김). 도는 표시는 장식,
62
+ * 움직임 줄이기 설정이면 멈춘다 (styles.css .qz-grading)
63
+ */
64
+ export const aiGrading = () => html`
65
+ <p class="qz-grading" role="status" hidden>
66
+ <span class="qz-grading-spinner" aria-hidden="true"></span>
67
+ <span class="qz-grading-text">
68
+ <strong>${texts.learn.grading}</strong>
69
+ <span>${texts.learn.gradingSub}</span>
70
+ </span>
71
+ </p>
72
+ `;
@@ -5,15 +5,28 @@ import { texts } from '../texts.js';
5
5
 
6
6
  const t = texts.question;
7
7
 
8
- /** @param {{ q: object }} props. 아래 안내: 채점은 앞뒤 공백을 지우고 비교 (정답은 보이지 않음) */
8
+ /** AI 채점 표시 아이콘 (반짝이, 장식). 결과 줄 아이콘(styles.css .qz-result[data-ai])과 같은 모양 */
9
+ export const sparkle = (size = 18, className = 'qz-ai-note-icon') => html`
10
+ <svg class="${className}" viewBox="0 0 24 24" width="${size}" height="${size}" fill="currentColor" aria-hidden="true">
11
+ <path d="M9.5 3.5 11 8l4.5 1.5L11 11l-1.5 4.5L8 11 3.5 9.5 8 8z" />
12
+ <path d="M17.5 12.5 18.5 15.5 21.5 16.5 18.5 17.5 17.5 20.5 16.5 17.5 13.5 16.5 16.5 15.5z" />
13
+ <path d="M17 3 17.7 5 19.7 5.7 17.7 6.4 17 8.4 16.3 6.4 14.3 5.7 16.3 5z" />
14
+ </svg>
15
+ `;
16
+
17
+ /**
18
+ * @param {{ q: object }} props. 아래 안내: 채점은 앞뒤 공백을 지우고 비교 (정답은 보이지 않음).
19
+ * AI 채점 문항(answerMode 'rubric')은 글을 비교하지 않으므로 입력 칸 위에 반짝이 아이콘 + AI가 채점한다는 안내 (연주님 디자인)
20
+ */
9
21
  export const text = ({ q }) => html`
10
22
  <div class="qz-text-field">
23
+ ${q.answerMode === 'rubric' && html`<p class="qz-ai-note">${sparkle()}<span>${t.textRubric}</span></p>`}
11
24
  <textarea
12
25
  class="qz-text"
13
26
  data-role="input"
14
27
  placeholder="${q.placeholder || t.textPlaceholder}"
15
28
  aria-label="${t.textLabel}"
16
29
  ></textarea>
17
- <p class="qz-muted">${t.textTrim}</p>
30
+ ${q.answerMode !== 'rubric' && html`<p class="qz-muted">${t.textTrim}</p>`}
18
31
  </div>
19
32
  `;
@@ -25,6 +25,7 @@ export const texts = {
25
25
  order: '정답 순서대로 보기를 적으세요. 학생에게는 섞여서 보입니다',
26
26
  group: '보기를 알맞은 그룹 상자 안에 적으세요',
27
27
  text: '정답을 여러 개 추가하면 그중 하나만 맞아도 정답입니다.',
28
+ rubric: 'AI가 채점 기준을 읽고 학생 답에 배점 안에서 점수를 매깁니다.',
28
29
  },
29
30
  addText: '+ 정답 추가',
30
31
  textPlaceholder: '정답 입력',
@@ -35,6 +36,31 @@ export const texts = {
35
36
  modeLabel: '정답 입력 방식',
36
37
  modeList: '직접 입력',
37
38
  modeRegex: '정규 표현식',
39
+ // AI 채점 (1.11.0, 서버 per_question · 연주님 디자인 전): 채점 기준 글을 AI가 읽고 점수를 매긴다
40
+ modeRubric: 'AI 채점',
41
+ rubricLabel: '채점 기준',
42
+ // 예시 채점 기준을 placeholder로 (가이드의 '평가 관점 → 100점 기준 점수 구간' 모양)
43
+ rubricPlaceholder: [
44
+ '예)',
45
+ '평가 관점: 과적합의 뜻과 막는 방법을 정확히 설명했는지',
46
+ '90~100점: 뜻과 막는 방법 2가지를 모두 맞게 설명',
47
+ '60~89점: 뜻은 맞지만 막는 방법이 1가지이거나 일부 틀림',
48
+ '0~59점: 뜻이 틀렸거나 관련 없는 답',
49
+ ].join('\n'),
50
+ rubricCount: (length, max) => `${length.toLocaleString()} / ${max.toLocaleString()}`,
51
+ // 채점 기준 작성 가이드 (LXP AI 채점 설정의 가이드를 퀴즈 문항에 맞춤: AI 점수 0~100을 배점으로 환산)
52
+ rubricGuideTitle: '채점 기준 작성 가이드',
53
+ rubricGuide: [
54
+ "무엇을 평가할지 '평가 관점'을 먼저 적습니다. (예: 핵심 개념을 정확히 설명했는지)",
55
+ '점수 구간은 100점 기준으로 적습니다. (예: 90~100 / 70~89 / 0~69)',
56
+ 'AI는 이 기준과 문제 글을 함께 참고해 점수를 매깁니다. 학생에게는 채점 기준이 보이지 않습니다.',
57
+ ],
58
+ // 배점 환산 안내 (AI 채점 문제, 배점 칸이 있고 배점이 100점이 아닐 때만 채점 기준 칸 아래, 연주님 디자인). 점수만 굵게
59
+ rubricScoreNote: {
60
+ before: '이 문제의 배점은 ',
61
+ points: points => `${points}점`,
62
+ after: '입니다. 배점에 맞게 환산되어 채점됩니다.',
63
+ },
38
64
  // 정규식 → 직접 입력으로 바꿀 때 목록으로 풀 수 없는 식이면 지우고 알림 (되돌리기)
39
65
  regexCleared: '정규식을 지웠습니다.',
40
66
  regexPlaceholder: '예: [Aa]pples?|사과',
@@ -63,6 +89,24 @@ export const texts = {
63
89
  badRegex: '정답으로 기준 답안을 만들지 못했습니다. 정답을 다시 골라 주세요.',
64
90
  roundTrip: '정답으로 낸 답이 기준 답안과 맞지 않습니다. 정답을 다시 골라 주세요.',
65
91
  tooWide: '다른 답도 정답으로 인정됩니다. 정답을 다시 확인해 주세요.',
92
+ // AI 채점 (answerMode 'rubric')
93
+ noRubric: '채점 기준을 입력해 주세요.',
94
+ rubricMax: (length, max) =>
95
+ `채점 기준이 너무 깁니다 (${length.toLocaleString()}자, 최대 ${max.toLocaleString()}자).`,
96
+ // per_question 채점 설정 검사 (core/model.js validatePerQuestionGrading의 code)
97
+ perQuestion: {
98
+ count: max => `문제는 1개부터 ${max}개까지 채점할 수 있습니다.`,
99
+ score: () => '배점은 0부터 100 사이의 정수로 입력해 주세요.',
100
+ pattern: () => '정답을 골라 주세요.',
101
+ patternMax: max => `정답이 너무 깁니다 (최대 ${max}자). 이 문제의 정답을 줄여 주세요.`,
102
+ rubric: () => '채점 기준을 입력해 주세요.',
103
+ rubricMax: max => `채점 기준이 너무 깁니다 (최대 ${max.toLocaleString()}자).`,
104
+ questionMax: max => `AI에 보낼 문제 글이 너무 깁니다 (최대 ${max.toLocaleString()}자).`,
105
+ rubricCount: max => `AI 채점 문제는 ${max}개까지 둘 수 있습니다.`,
106
+ kind: () => '채점 항목 모양이 올바르지 않습니다.',
107
+ total: () => '배점 합계는 100점 이상이어야 합니다.',
108
+ passScore: () => '통과 점수는 1부터 100 사이의 정수입니다.',
109
+ },
66
110
  // 주관식 정규식 (core/model.js compileTextRegex의 error 코드). 서버(Python)와 브라우저가 다르게 읽는 문법은 막는다
67
111
  badTextRegex: '정답 정규식이 올바르지 않습니다.',
68
112
  textSemicolon: '정답 정규식에는 ; 를 쓸 수 없습니다.',
@@ -106,6 +150,19 @@ export const texts = {
106
150
  scoreUnit: '점',
107
151
  scoreTitle: '아쉬워요!',
108
152
  scoreSub: '틀린 문제를 다시 풀어 보세요.',
153
+ // per_question 퀴즈가 통과 점수(pass_score) 이상이지만 100점이 아닐 때 결과 상자 (점수 · 제목 · 안내 · 마스코트, 같은 자리)
154
+ passTitle: '통과했어요!',
155
+ passSub: pass => `통과 점수 ${pass}점을 넘었어요. 다시 풀어 점수를 올릴 수도 있어요.`,
156
+ // AI 채점 문항이 있는 퀴즈 (per_question): 제출하고 결과를 기다리는 동안 제출 바 위 (AI 채점은 30초까지 걸릴 수 있음)
157
+ grading: 'AI가 채점하고 있어요',
158
+ gradingSub: '잠시만 기다려 주세요. 30초까지 걸릴 수 있습니다.',
159
+ // AI 채점 문항 카드의 결과 줄 "AI 채점 결과 20 / 35점" (서버 question_results의 score / 배점, 연주님 디자인: 점수는 굵게 · "/ 35점"은 따로).
160
+ // 문항별 점수를 받지 못하면(교육자 미리보기 등) 총점에 반영됐다는 안내만
161
+ rubricScore: 'AI 채점 결과',
162
+ rubricMax: max => ` / ${max}점`,
163
+ rubricDone: 'AI 채점 완료. 점수는 총점에 반영되었습니다.',
164
+ // 로컬(ecdk dev · mock)의 AI 채점 점수는 AI가 아니라 글 길이로 만든 흉내 값
165
+ rubricMock: ' (로컬 흉내 점수, 실제 AI 아님)',
109
166
  // 올린 그림을 받지 못함 (10초 안에 받지 못함 · 서명 주소 만료). 그림 자리에 보인다
110
167
  imageExpired: '이미지 주소가 만료되었습니다. 새로고침해 주세요.',
111
168
  },
@@ -121,6 +178,8 @@ export const texts = {
121
178
  textPlaceholder: '답안을 작성해 주세요.',
122
179
  textLabel: '답안',
123
180
  textTrim: '앞뒤 공백은 무시하고 비교합니다.',
181
+ // AI 채점 문항 (answerMode 'rubric'): 글을 비교하지 않고 AI가 채점 기준으로 점수를 매김
182
+ textRubric: 'AI가 답을 읽고 채점합니다.',
124
183
  pool: '보기',
125
184
  answer: '답안',
126
185
  // 순서 맞추기: 고를 개수(답안 칸 수)가 보기 수와 같으면 개수를 말하지 않는다
@@ -243,6 +302,8 @@ export const texts = {
243
302
  equalLine: '문제마다 동일한 점수로 채점됩니다. 문제의 배점을 직접 수정할 수 있습니다.',
244
303
  modeEqual: '자동 배점',
245
304
  modeCustom: '직접 배점',
305
+ // AI 채점 문제가 있으면 문제별로 채점한다 (스위치는 켜진 채 잠김)
306
+ perQuestionLocked: 'AI 채점 문제가 있어 문제별로 채점합니다.',
246
307
  },
247
308
  sortLabel: label => `${label} 순서 바꾸기 (끌거나 ↑ · ↓ 키)`,
248
309
  sortTitle: '끌어서 순서 바꾸기',
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steps",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "title": "단계별 자료",
5
5
  "description": "여러 단계로 나눈 자료(도입 → 실험 → 정리, 슬라이드 · STEP)를 만들 때. 키트 스테퍼(app.useStepper, 이전 · 다음 · n / N)와 단계마다 다른 콘텐츠 레이아웃(single · stage · split) 예제 \"진자의 주기\"와 내용 JSON 편집기로 시작 (완료 정책은 LXP 자료 편집 화면의 '설정'에서 교육자가 고름)"
6
6
  }
@@ -0,0 +1,112 @@
1
+ # {{name}}
2
+
3
+ Elice Custom HTML 학습자료 프로젝트입니다 (설문 템플릿).
4
+
5
+ 학생이 문항(척도 · 단일 선택 · 다중 선택 · 서술형)에 답하고 제출합니다. **정답과 채점이 없습니다.** 제출하면 "응답해 주셔서 감사합니다." 화면으로 바뀌고, 다시 열면 그 화면부터 보이며 "응답 확인하고 수정하기"로 낸 답을 고쳐 다시 낼 수 있습니다.
6
+
7
+ ## 완료 정책: "제출 시 완료"(on_submit) 권장
8
+
9
+ 완료 정책은 프로젝트나 zip이 아니라 LXP 페이지 설정입니다. 설문은 **제출하면 완료(on_submit)**를 권합니다: 제출하면 서버가 채점 없이 100점 · 완료로 기록합니다 (`settings.grading`이 없으면 `on_submit` · `on_access`에서 100점).
10
+
11
+ - publish 스킬로 올리면 동의를 받아 업로드와 함께 `on_submit`을 정합니다.
12
+ - 직접 올리면 LXP 편집 페이지 위쪽 '설정' 패널에서 "제출 시 완료"를 고릅니다.
13
+ - `on_graded`(채점해 통과하면 완료)는 쓰지 않습니다: 설문에는 채점 설정(`grading`)이 없어 서버가 거절합니다.
14
+ - `on_access`(열면 완료)도 됩니다. 이때는 제출하지 않아도 완료됩니다.
15
+
16
+ ## 고치는 곳
17
+
18
+ | 파일 | 화면 |
19
+ | --------------------------------- | ---------------------------------------------------------------------------------- |
20
+ | `screens/learn.js` · `index.html` | 학생 화면 (무엇을 어떤 순서로 놓을지) |
21
+ | `screens/edit.js` · `edit.html` | 내용 편집 화면 (CMS) |
22
+ | `ui/` | 설문의 모양: 색 · 간격 · 문구 · 마크업 (아래 표) |
23
+ | `styles.css` | 이 콘텐츠의 스타일 (값은 `ui/theme.css`의 변수) |
24
+ | `metadata.json` | 화면 구성(`screens`) · 학습 참고 내용(`commentary`). `ecdk build`가 `build`만 채움 |
25
+ | `package.json` | SDK 버전(`@eliceio/cdk`) · 빌드 옵션 `"ecdk"` (`minify` 등). zip에 들어가지 않음 |
26
+
27
+ ```
28
+ ui/ 모양 — 마음대로 고칩니다
29
+ ├─ theme.css 색 · 간격 · 모서리 · 보기 카드 (EDS 토큰 위의 --qz-* 변수, 퀴즈 템플릿과 같은 이름)
30
+ ├─ texts.js 화면에 보이는 문구 전부 (탭 제목 · 학생 · 감사 화면 · 편집 · 검증 문구)
31
+ └─ templates/ HTML 조각 (learn: 머리 · 문항 · 보기 · 기타 · 척도 · 서술형 · 감사 화면 / edit: 편집 화면 / page: 불러오는 자리)
32
+ screens/ 배치 — 어떤 블록을 어떤 순서로 보일지
33
+ core/ 동작 — 고치지 않습니다 (답 모양 · 필수 응답 검사 · 기타 입력 · 척도 · 편집 도우미(퀴즈 템플릿과 같음)). ui/를 부르지 않습니다
34
+ ```
35
+
36
+ | 바꾸고 싶은 것 | 고치는 곳 |
37
+ | ------------------------------------- | ------------------------------------------------------------------------- |
38
+ | 색 · 간격 · 모서리 | `ui/theme.css`의 `--qz-*` 변수 (예: `--qz-accent`, `--qz-option-padding`) |
39
+ | 문구 ("응답해 주셔서 감사합니다." 등) | `ui/texts.js` (HTML의 `<title>`은 스크립트가 돌기 전 대비용) |
40
+ | 문항 · 보기 · 척도 · 서술형 마크업 | `ui/templates/learn.js` (모양은 `styles.css`의 `.qz-option` · `.sv-*`) |
41
+ | 감사 화면 | `ui/templates/learn.js`의 `done` · `styles.css`의 `.sv-done` |
42
+ | 편집 화면 칸 · 버튼 | `ui/templates/edit.js` |
43
+ | 문항 없음 안내 | 키트 `app.emptyState()` (모든 템플릿 공통 그림 · 문구) |
44
+
45
+ 템플릿은 `` html`…` `` 조각입니다. 끼워 넣는 글자는 자동으로 이스케이프되고, 클래스 · 태그 · 배치는 자유롭게 바꿔도 됩니다. **`data-role` 속성만 남기면** 동작(`core/`)이 그대로 붙습니다.
46
+
47
+ | `data-role` | 어디 |
48
+ | ------------------------------------------------------------------------------------ | ------------------------------------ |
49
+ | `choice` (`<input value="보기 id · other · 척도 수">`) | 보기 · 기타 · 척도 칸 (`learn.js`) |
50
+ | `other-text` | 기타 글 칸 (`learn.js`) |
51
+ | `input` | 서술형 입력란 (`learn.js`) · 편집 칸 |
52
+ | `done-title` · `done-edit` | 감사 화면 (`learn.js`) |
53
+ | `handle` · `delete` · `type` · `up` · `down` · `other-add` · `other-delete` · `undo` | 편집 화면 (`edit.js`) |
54
+
55
+ ## 설문 데이터
56
+
57
+ 문항은 편집 화면에서 만들어 저장한 내용(`settings`)뿐입니다. 저장하기 전 학생 화면은 키트 빈 안내("학습 자료를 준비하고 있어요")를 보이고, 편집 화면은 빈 단일 선택 문항 하나로 시작합니다.
58
+
59
+ 설문이 쓰는 것은 모두 **`settings.survey`** 아래에 둡니다. 서버는 이 키로 설문을 알아보고 문항 · 답 모양을 검사합니다. `settings` 맨 위에는 다른 키를 두지 않습니다 (설문은 `grading`도 없음).
60
+
61
+ ```jsonc
62
+ {
63
+ "survey": {
64
+ "description": "설문 안내 (마크다운, 없어도 됨)",
65
+ "questions": [
66
+ { "id": "q1", "type": "scale", "title": "…", "required": true,
67
+ "scale": { "min": 1, "max": 5, "minLabel": "전혀 그렇지 않다", "maxLabel": "매우 그렇다" } },
68
+ { "id": "q2", "type": "single", "title": "…", "required": true,
69
+ "options": [{ "id": "o1", "text": "…" }, { "id": "o2", "text": "…" }] },
70
+ { "id": "q3", "type": "multiple", "title": "…", "required": false, "other": true, "options": [ … ] },
71
+ { "id": "q4", "type": "text", "title": "…", "required": false }
72
+ ]
73
+ }
74
+ }
75
+ ```
76
+
77
+ - 문항은 **30개까지**, 보기는 2 ~ 10개. 척도는 시작값 0 · 1, 끝값 2 ~ 10 (7칸 이상은 좁은 화면에서 두 줄).
78
+ - 문항마다 `description`(설명, 마크다운)을 "설명 추가 +"로 열어 쓸 수 있습니다. 설명 · 안내 칸에 초점이 있으면 서식 도구가 뜹니다. 서식 도구의 그림 버튼은 퀴즈 템플릿과 같이 키트 `app.assets.uploadImage`로 그림을 줄여 서버에 올리고 글에는 파일 키 `![설명](asset:assets/…/….webp)`만 둡니다 (`settings`에는 키만, 설문 전체 50개까지). 학생 · 편집 화면은 `app.assets.url`의 서명 주소에서 받아 그리고, 10초 안에 받지 못하면 "이미지 주소가 만료되었습니다. 새로고침해 주세요."를 보입니다. 버튼을 숨기려면 `screens/edit.js`의 `IMAGE_UPLOAD`를 `false`로.
79
+ - 필수 응답(`required`)을 켜면 학생이 답해야 제출할 수 있습니다 ("N번 문항에 답해 주세요."). '기타'를 고르고 글을 비우면 "N번 문항의 '기타' 내용을 적어 주세요." 서버가 받지 않을 답(지금 문항에 없는 보기 · 척도 수 등)은 "N번 문항 답을 다시 골라 주세요."로 막습니다 (`core/model.js` `checkAnswer` · `answerProblem`).
80
+ - 학생 답(SDK `submit`에 그대로, 문항 id를 키로 한 JSON 객체 하나):
81
+
82
+ ```json
83
+ { "q1": 4, "q2": "o2", "q3": ["o1", "other"], "q3:other": "발표 자료", "q4": "예제가 좋았습니다." }
84
+ ```
85
+
86
+ 단일 선택은 보기 id(`"other"`는 기타) 또는 `null`, 다중 선택은 보기 id 배열, 척도는 정수 또는 `null`, 서술형은 문자열, 기타 글은 `문항id:other`(기타를 고르고 글이 있을 때만). 기타 글은 300자, 서술형은 1000자까지. 지금 문항만 키로 둡니다. `meta`는 없습니다 (낸 사람은 서버가 토큰으로 압니다).
87
+ `settings.survey`가 있으면 서버가 답 모양을 검사합니다: 아는 문항 id(또는 `id:other`)의 값 종류가 유형과 맞는지. 틀리면 422 `not_a_survey_answer`. 서버는 모르는 키를 무시하고, 학생 화면은 모르는 키를 내지 않습니다 (`answerProblem`).
88
+
89
+ - 서버는 채점 설정이 없으면 제출에 `is_correct: null`(`on_submit` · `on_access`면 점수 100)을 돌려줍니다. 키트의 결과 줄("제출했어요.")은 `styles.css`에서 감추고 감사 화면으로 알립니다 (튜터 화면에서도 보이지 않음).
90
+ - 튜터는 학생이 낸 답을 문항에서 읽기 전용으로 봅니다.
91
+ - **교육자 화면은 없습니다** (`metadata.json`의 `instructor`는 꺼 둠). LXP에서 교육자가 열면 학생 화면이 보이고, 거기서 낸 답도 서버에 기록됩니다. 학생마다 낸 답은 LXP 튜터링 화면(학생 화면을 읽기 전용으로)에서 봅니다.
92
+
93
+ 로컬에서는 `ecdk dev`의 **내용 편집**에서 저장하면 내용이 `.ecdk/settings.json`에 남습니다 (zip에는 들어가지 않음). publish 스킬로 올릴 때 동의하면 업로드와 함께 보냅니다.
94
+
95
+ `lib/`(화면 키트)는 플랫폼 연결 로직이라 고치지 않습니다. SDK는 `package.json` 의존성(`@eliceio/cdk`)이고 키트가 import하며, `ecdk build`(Vite)가 화면 코드와 함께 번들로 묶습니다 (처음 한 번 `npm install`, 올리기 `npm update @eliceio/cdk`).
96
+
97
+ ## SDK: mock ↔ real
98
+
99
+ 키트가 자동으로 고릅니다. 화면 코드는 바꿀 필요가 없습니다.
100
+
101
+ - 플랫폼에서 열 때 (`#token=`, 편집기 draft): real (`@eliceio/cdk`, 번들에 들어감)
102
+ - 그 밖 (로컬): mock (`lib/cdk-mock.js`), 저장 내용 · 제출은 이 브라우저에 (프로젝트 폴더를 열면 `.ecdk/settings.json`으로 시작)
103
+ - 강제로 바꾸기: 주소에 `?sdk=mock` 또는 `?sdk=real` · 보는 사람 바꾸기 (mock): `#viewer=tutor` (`student` · `instructor` · `tutor`)
104
+ - mock 기록 지우기: 개발자 도구에서 `localStorage`의 `elice-content-mock:*` 삭제
105
+
106
+ ## 명령
107
+
108
+ ```sh
109
+ ecdk dev # 로컬에서 운영과 같은 조건으로 보기 (http://localhost:4170)
110
+ ecdk doctor # 환경·프로젝트 점검
111
+ ecdk build # 검사 후 dist/content.zip (편집 화면에 올릴 파일)
112
+ ```
@@ -0,0 +1,2 @@
1
+ 수업 설문입니다. 학생이 수업 이해도, 더 알고 싶은 내용, 자유 의견을 답하고 제출합니다.
2
+ 정답과 채점이 없으며, 제출하면 학습이 완료됩니다(LXP 완료 정책: 제출 시 완료). 문항을 바꾸면 이 파일도 이 설문에 맞게 고쳐 주세요(설문 목적, 문항 구성).
@@ -0,0 +1,14 @@
1
+ // core/behaviors.js 타입 (편집기 자동완성 · 테스트용)
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ export interface QuestionView {
4
+ el: HTMLElement;
5
+ getValue(): unknown;
6
+ /** '기타'를 골랐고 글이 있으면 그 글 */
7
+ getOther(): string | null;
8
+ setValue(value: unknown, other?: unknown): void;
9
+ }
10
+ export declare function renderQuestion(
11
+ q: any,
12
+ index: number,
13
+ opts: { templates: Record<string, (props: any) => any> }
14
+ ): QuestionView;
@@ -0,0 +1,115 @@
1
+ // 학생 화면 문항 동작: 템플릿(ui/templates/learn.js)으로 문항을 그리고 답을 읽고 채운다.
2
+ // ui/를 직접 불러오지 않는다: 템플릿은 화면(screens/learn.js)이 넘겨 준다. 요소는 data-role로만 찾는다.
3
+ import { part, parts } from './dom.js';
4
+ import { LIMITS, normalizeScale, OTHER, scaleColumns, scaleSteps } from './model.js';
5
+
6
+ /**
7
+ * 문항 하나. getValue(): 답 (single: 보기 id | 'other' | null · multiple: 배열 · scale: 숫자 | null · text: 문자열),
8
+ * getOther(): '기타'를 골랐고 글이 있으면 그 글 (아니면 null) · setValue(값, 기타 글)
9
+ * @param {object} q 문항
10
+ * @param {number} index 0부터
11
+ * @param {{ templates: Record<string, (props: any) => any> }} opts
12
+ */
13
+ export function renderQuestion(q, index, { templates }) {
14
+ const no = index + 1;
15
+ if (q.type === 'single' || q.type === 'multiple') return choiceQuestion(q, no, templates);
16
+ if (q.type === 'scale') return scaleQuestion(q, no, templates);
17
+ return textQuestion(q, no, templates);
18
+ }
19
+
20
+ function wrap(q, no, body, templates) {
21
+ const el = templates.question({ q, no, body });
22
+ el.dataset.role = 'question';
23
+ el.dataset.id = q.id;
24
+ return el;
25
+ }
26
+
27
+ function choiceQuestion(q, no, templates) {
28
+ const multiple = q.type === 'multiple';
29
+ const body = templates.choice({ q, multiple });
30
+ let otherText = null;
31
+ if (q.other) {
32
+ const row = templates.other({ q, no, multiple, value: OTHER, max: LIMITS.otherMax });
33
+ otherText = part(row, 'other-text');
34
+ const pick = part(row, 'choice');
35
+ const select = () => {
36
+ if (pick.checked) return;
37
+ pick.checked = true;
38
+ pick.dispatchEvent(new Event('change', { bubbles: true }));
39
+ };
40
+ // 글 칸을 누르거나 쓰면 '기타'를 고른다. 고르면 글 칸으로, 풀면 글 칸에서 나간다
41
+ otherText.addEventListener('pointerdown', select);
42
+ otherText.addEventListener('input', () => {
43
+ if (otherText.value.trim()) select();
44
+ });
45
+ pick.addEventListener('change', () => (pick.checked ? otherText.focus() : otherText.blur()));
46
+ body.append(row);
47
+ }
48
+ const inputs = () => parts(body, 'choice');
49
+ const getValue = () =>
50
+ multiple
51
+ ? inputs()
52
+ .filter(i => i.checked)
53
+ .map(i => i.value)
54
+ : (inputs().find(i => i.checked)?.value ?? null);
55
+ return {
56
+ el: wrap(q, no, body, templates),
57
+ getValue,
58
+ getOther: () => {
59
+ const picked = [getValue()].flat().includes(OTHER);
60
+ const value = otherText?.value.trim();
61
+ return picked && value ? value : null;
62
+ },
63
+ setValue(value, other) {
64
+ for (const i of inputs())
65
+ i.checked = multiple
66
+ ? (Array.isArray(value) ? value : []).includes(i.value)
67
+ : i.value === value;
68
+ if (otherText) otherText.value = typeof other === 'string' ? other : '';
69
+ },
70
+ };
71
+ }
72
+
73
+ function scaleQuestion(q, no, templates) {
74
+ const s = normalizeScale(q);
75
+ const steps = scaleSteps(s);
76
+ const body = templates.scale({
77
+ q,
78
+ steps,
79
+ columns: scaleColumns(steps.length),
80
+ minLabel: s.minLabel,
81
+ maxLabel: s.maxLabel,
82
+ });
83
+ const inputs = () => parts(body, 'choice');
84
+ return {
85
+ el: wrap(q, no, body, templates),
86
+ getValue: () => {
87
+ const picked = inputs().find(i => i.checked);
88
+ return picked ? Number(picked.value) : null;
89
+ },
90
+ getOther: () => null,
91
+ setValue(value) {
92
+ for (const i of inputs()) i.checked = Number(i.value) === value;
93
+ },
94
+ };
95
+ }
96
+
97
+ function textQuestion(q, no, templates) {
98
+ const body = templates.text({ no, max: LIMITS.textMax });
99
+ const input = part(body, 'input');
100
+ // 글에 맞춰 높이를 늘린다
101
+ const fit = () => {
102
+ input.style.height = 'auto';
103
+ input.style.height = `${input.scrollHeight}px`;
104
+ };
105
+ input.addEventListener('input', fit);
106
+ return {
107
+ el: wrap(q, no, body, templates),
108
+ getValue: () => input.value,
109
+ getOther: () => null,
110
+ setValue(value) {
111
+ input.value = typeof value === 'string' ? value : '';
112
+ fit();
113
+ },
114
+ };
115
+ }
@@ -0,0 +1,13 @@
1
+ // core/dom.js 타입 (편집기 자동완성 · 테스트용)
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ export declare const present: (nodes: any[]) => any[];
4
+ export declare function el(
5
+ tag: string,
6
+ props?: Record<string, unknown>,
7
+ ...children: any[]
8
+ ): HTMLElement;
9
+ /** 최상위 요소가 하나면 그 요소(HTMLElement로 다룸), 아니면 DocumentFragment */
10
+ export declare function html(strings: TemplateStringsArray, ...values: unknown[]): any;
11
+ export declare function part(root: Element, name: string): HTMLElement | null;
12
+ export declare function parts(root: Element, name: string): HTMLElement[];
13
+ export declare function lock<T extends Element>(root: T): T;