@eliceio/cdk-cli 1.4.1 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +2 -2
  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 +12 -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 +1 -1
@@ -14,13 +14,17 @@ import {
14
14
  answerFormatOf,
15
15
  decodeAnswer,
16
16
  isAnswered,
17
+ isPerQuestionType,
18
+ isRubricMode,
17
19
  joinAnswerList,
18
20
  joinAnswers,
21
+ joinQuestionAnswers,
19
22
  PARTIAL,
23
+ questionAnswerIds,
20
24
  splitAnswers,
21
25
  } from '../core/model.js';
22
26
  import { labels, templates } from '../ui/templates/index.js';
23
- import { loading, partialScore, someWrong } from '../ui/templates/page.js';
27
+ import { aiGrading, aiScore, loading, partialScore, passedScore, someWrong } from '../ui/templates/page.js';
24
28
  import { texts } from '../ui/texts.js';
25
29
 
26
30
  const root = document.getElementById('app');
@@ -89,11 +93,19 @@ function show() {
89
93
  setImages(app.content.images);
90
94
  // 답 모양은 채점 방식을 따른다 (학생 화면은 grading을 받지 못해 편집 화면이 같이 저장한 공개 값 gradingType으로 안다):
91
95
  // pattern은 문자열 하나 "q1=b;q2=a,d;…" (ADR 0008 · 0009), partial_pattern은 문항별 배열 ["q1=b", "q2=a,d", …]
92
- const partial = app.content.gradingType === PARTIAL;
96
+ // per_question (1.11.0, AI 채점 문제가 있음 · 서버 #65): partial_pattern처럼 문항별 배열, AI 채점 문제 자리는 답 글만
97
+ // (["q1=b", "q2=weight", "과적합은 …"]). 개발 중 제안 items로 저장한 draft도 같은 모양
98
+ const perQuestion = isPerQuestionType(app.content.gradingType);
99
+ const partial = app.content.gradingType === PARTIAL || perQuestion;
100
+ // 통과 점수 (per_question): 학생 화면은 grading을 받지 못해 편집 화면이 같이 저장한 공개 값 passScore로 안다 (없으면 100)
101
+ const passScore =
102
+ Number.isInteger(app.content.passScore) && app.content.passScore >= 1 && app.content.passScore <= 100
103
+ ? app.content.passScore
104
+ : 100;
93
105
  // 주관식 답 형식 (ADR 0013): 편집 화면 1.10.0부터 settings answerFormat 2(원문), 없으면 옛 자료라 encodeURIComponent.
94
106
  // 정답 정규식이 같은 형식으로 저장돼 있어 늘 짝이 맞는다. 더 새 형식(3 이상)은 2로 보낸다
95
107
  const format = answerFormatOf(app.content);
96
- if (Number(app.content.answerFormat) > 2)
108
+ if (Number(app.content.answerFormat) > (perQuestion ? 3 : 2))
97
109
  console.warn(
98
110
  `[quiz] 이 퀴즈는 퀴즈 템플릿 ${app.content.requires?.quiz ?? '새 버전'} 이상이 저장했습니다. 채점이 맞지 않으면 교육자에게 알려 주세요.`,
99
111
  );
@@ -114,14 +126,24 @@ function show() {
114
126
  root.replaceChildren(...views.map((v) => v.el));
115
127
 
116
128
  /**
117
- * 문제별 맞음 (partial_pattern), 지금 문제 순서대로. answerCorrectness[i]는 낸 답 answer[i]의 맞음이고 answer[i]는 "문제id=답"이라
129
+ * 문제별 맞음 (partial_pattern · per_question), 지금 문제 순서대로. answerCorrectness[i]는 낸 답 answer[i]의 맞음이고 answer[i]는 "문제id=답"이라
118
130
  * 문제 id로 맞춘다 (제출 뒤 교육자가 문제 순서를 바꿔도 표시가 제 문제에). 다시 열 때는 마지막 제출 기록의 answer,
119
131
  * 제출 직후에는 지금 답(방금 낸 답과 같음). 낸 답과 지금 문제가 하나라도 맞지 않으면(빠짐 · 더함 · 옛 문자열 답) null → 전체 결과만
120
132
  */
133
+ const answerOf = (res) => res.answer ?? collect(views.map((v) => v.getValue()));
134
+ const collect = (values) =>
135
+ perQuestion
136
+ ? joinQuestionAnswers(questions, values, format)
137
+ : joinAnswerList(questions, values, format);
121
138
  const correctnessOf = (res) => {
122
139
  const marks = res.answerCorrectness;
123
- const answer = res.answer ?? joinAnswerList(questions, views.map((v) => v.getValue()), format);
140
+ const answer = answerOf(res);
124
141
  if (!Array.isArray(marks) || !Array.isArray(answer) || marks.length !== answer.length) return null;
142
+ // per_question: AI 채점 문제 자리는 `문항id=`가 없어 자리(문항 순서)로 맞춘다
143
+ if (perQuestion) {
144
+ const ids = questionAnswerIds(questions, answer);
145
+ return ids ? ids.map((_, i) => marks[i] === true) : null;
146
+ }
125
147
  const byId = new Map();
126
148
  answer.forEach((piece, i) => {
127
149
  const at = typeof piece === 'string' ? piece.indexOf('=') : -1;
@@ -132,7 +154,8 @@ function show() {
132
154
  };
133
155
  // 키트 점수 줄(정답 · 오답)은 감추고 문제 카드의 정답 · 오답과 제출 바 위 상자(.qz-overall)로 알린다 (styles.css, 연주님 디자인).
134
156
  // pattern: 여러 문제 중 틀린 것이 있으면 한 줄 (어느 문제인지는 pattern이 알려 주지 않음).
135
- // partial_pattern: 100점보다 낮으면 점수 · "아쉬워요!" · 마스코트 상자, 100점이면 상자 없음
157
+ // partial_pattern: 100점보다 낮으면 점수 · "아쉬워요!" · 마스코트 상자, 100점이면 상자 없음.
158
+ // per_question: 통과 점수 이상이면(완료) "통과했어요!", 아래면 "아쉬워요!"
136
159
  const overall = someWrong();
137
160
  const wrongText = overall.textContent;
138
161
  const hideOverall = () => {
@@ -146,22 +169,84 @@ function show() {
146
169
  overall.dataset.result = 'wrong';
147
170
  overall.hidden = false;
148
171
  };
172
+ /**
173
+ * 문제별 받은 점수 (per_question, 서버 question_results [{ score, is_correct }] → SDK가 camelCase로 questionResults).
174
+ * 지금 SDK submit은 이 값을 넘기지 않고(공개 API 변경은 3인 합의), 제출 기록(history)은 응답 필드를 그대로 넘긴다.
175
+ * 낸 답과 지금 문제가 맞지 않으면 null
176
+ */
177
+ const resultsOf = (res) => {
178
+ const list = res?.questionResults;
179
+ if (!perQuestion || !Array.isArray(list) || list.length !== questions.length) return null;
180
+ if (!questionAnswerIds(questions, answerOf(res))) return null;
181
+ return list.map((r) => (Number.isInteger(r?.score) ? r.score : null));
182
+ };
183
+ // 로컬(ecdk dev 흉내 서버 · mock SDK)의 AI 채점 점수는 흉내 값이라 그렇다고 붙인다
184
+ const mockRubric = app.sdkKind === 'mock' || Boolean(globalThis.__ECDK_DEV__);
185
+ /** AI 채점 문제의 배점: 문제가 하나면 100 */
186
+ const maxOf = (q) => (questions.length === 1 ? 100 : Number.isInteger(q.points) ? q.points : null);
187
+ /**
188
+ * AI 채점 문제 결과 줄 (점수가 없으면 null · undefined: 총점에 반영 안내, 회색). 색은 받은 점수로 (연주님 디자인):
189
+ * 배점 만점이면 초록(correct) · 0점이면 빨강(wrong) · 그 사이는 회색(note)
190
+ */
191
+ const showRubric = (res, scores) =>
192
+ views.forEach((v, i) => {
193
+ // 결과를 기다리는 동안 학생이 답을 고쳤으면 그 문항은 비워 둔다
194
+ if (!isRubricMode(questions[i]) || shown[i] === null) return;
195
+ if (res.score === null || res.score === undefined) return v.setResult(null);
196
+ const score = scores?.[i];
197
+ const max = maxOf(questions[i]);
198
+ const suffix = mockRubric ? texts.learn.rubricMock : '';
199
+ if (typeof score !== 'number' || max === null) return v.setNote(texts.learn.rubricDone + suffix);
200
+ v.setNote(
201
+ aiScore({ score, max, suffix }),
202
+ score >= max ? 'correct' : score <= 0 ? 'wrong' : undefined,
203
+ );
204
+ });
205
+ // AI 채점은 시간이 걸린다 (30초까지): 제출 버튼이 기다리는 동안(aria-busy) 제출 바 위에 "AI가 채점하고 있어요"
206
+ const waiting = aiGrading();
149
207
  const showScore = (score) => {
150
208
  if (score >= 100) return hideOverall();
151
- overall.replaceChildren(partialScore({ score }));
209
+ // per_question은 통과 점수 이상이면 완료 (서버 pass_score). 100점이 아니어도 "통과"
210
+ overall.replaceChildren(
211
+ perQuestion && score >= passScore ? passedScore({ score, pass: passScore }) : partialScore({ score }),
212
+ );
152
213
  overall.classList.add('qz-overall-mascot');
153
- overall.dataset.result = 'partial';
214
+ overall.dataset.result = perQuestion && score >= passScore ? 'passed' : 'partial';
154
215
  overall.hidden = false;
155
216
  };
217
+ // 답을 실제로 바꾸면 그 문항의 결과 색과 점수 상자를 지운다 (기존 동작). 결과를 보인 때의 답과 지금 답을 비교해서,
218
+ // 입력 칸을 누르거나 초점만 옮기거나 같은 보기를 다시 눌러 답이 그대로면 결과를 그대로 둔다.
219
+ // 답이 바뀌는 길(입력 · 고르기 · 끌어 놓기 · 키보드)이 유형마다 달라 문서의 이벤트 뒤에 비교한다 (맨 아래)
220
+ /** 결과를 보인 문항의 그때 답 (문항 순서). null이면 보인 결과가 없거나 이미 지움 */
221
+ let shown = views.map(() => null);
222
+ const answerKey = (i) => {
223
+ try {
224
+ return JSON.stringify(views[i].getValue() ?? null);
225
+ } catch {
226
+ return null;
227
+ }
228
+ };
229
+ function markShown() {
230
+ shown = views.map((_, i) => answerKey(i));
231
+ }
232
+ function clearChanged() {
233
+ if (app.readOnly) return;
234
+ views.forEach((v, i) => {
235
+ if (shown[i] === null || answerKey(i) === shown[i]) return;
236
+ shown[i] = null;
237
+ v.setResult(null);
238
+ hideOverall();
239
+ });
240
+ }
241
+ // 제출 직후 받은 결과를 고칠 수 있게 몇 번째 결과인지 센다 (늦게 온 제출 기록이 그 뒤 결과를 덮지 않게)
242
+ let resultSeq = 0;
156
243
  app.useSubmit({
157
244
  label: texts.learn.submit,
158
245
  // 제출하면 결과(점수 상자 · 제출 바)가 있는 맨 아래로 (성공 · 실패 모두, 단건 · 여러 문항 · pattern · partial_pattern 같음)
159
246
  scrollOnResult: 'bottom',
160
247
  getAnswer: () => {
161
248
  const values = views.map((v) => v.getValue());
162
- return partial
163
- ? joinAnswerList(questions, values, format)
164
- : joinAnswers(questions, values, format);
249
+ return partial ? collect(values) : joinAnswers(questions, values, format);
165
250
  },
166
251
  setAnswer: (answer) => {
167
252
  const byId = splitAnswers(questions, answer);
@@ -172,34 +257,59 @@ function show() {
172
257
  if (left < 0) return true;
173
258
  return questions.length === 1 ? texts.learn.unansweredSingle : texts.learn.unanswered(left + 1);
174
259
  },
175
- // partial_pattern이면 서버가 문항별 맞음 answerCorrectness를 준다 (제출 직후 · 다시 열 때 마지막 제출 기록에서).
260
+ // partial_pattern · per_question이면 서버가 문항별 맞음 answerCorrectness를 준다 (제출 직후 · 다시 열 때 마지막 제출 기록에서).
176
261
  // 문제 id로 맞춘 결과가 있으면 문제마다 정답 · 오답을 표시한다. 없거나([] = pattern · rubric) 맞추지 못하면 전체 결과만:
177
- // 문항이 하나면 그 결과가 곧 문항의 정답 · 오답, 여러 문항이면 모두 맞았을 때만 정답 표시. 해설은 한 번이라도 제출하면
178
- onResult: (res) => {
262
+ // 문항이 하나면 그 결과가 곧 문항의 정답 · 오답, 여러 문항이면 모두 맞았을 때만 정답 표시. 해설은 한 번이라도 제출하면.
263
+ // AI 채점 문제는 정답 · 오답 대신 "AI 채점 결과 받은 점수 / 배점" (서버 question_results)
264
+ onResult: (res, { restored }) => {
265
+ const seq = ++resultSeq;
266
+ markShown();
179
267
  const single = views.length === 1;
180
- const items = correctnessOf(res);
268
+ const marks = correctnessOf(res);
181
269
  views.forEach((v, i) => {
182
270
  const correct = typeof res.isCorrect === 'boolean' ? res.isCorrect : null;
183
- if (items) v.setResult(items[i]);
271
+ if (perQuestion && isRubricMode(questions[i])) return;
272
+ if (marks) v.setResult(marks[i]);
184
273
  else v.setResult(single ? correct : correct === true ? true : null);
185
- v.showExplanation();
186
274
  });
275
+ views.forEach((v) => v.showExplanation());
276
+ const scores = resultsOf(res);
277
+ if (perQuestion && !scores && !restored && typeof res.score === 'number') {
278
+ // 제출 직후: SDK submit이 문제별 점수를 넘기지 않으면 방금 저장된 제출 기록에서 읽는다 (학생 제출만 기록됨).
279
+ // 기록의 답 · 점수가 방금 낸 것과 같을 때만 쓰고, 못 읽으면(교육자 · 미리보기는 기록이 없음) "총점에 반영" 안내
280
+ const sent = JSON.stringify(answerOf(res));
281
+ app
282
+ .lastSubmission()
283
+ .then((last) =>
284
+ last && JSON.stringify(last.answer) === sent && last.score === res.score ? resultsOf(last) : null,
285
+ )
286
+ .catch(() => null)
287
+ .then((fromHistory) => {
288
+ if (seq === resultSeq) showRubric(res, fromHistory);
289
+ });
290
+ } else if (perQuestion) showRubric(res, scores);
187
291
  if (partial && typeof res.score === 'number') showScore(res.score);
188
292
  else if (!partial && !single && res.isCorrect === false) showWrong();
189
293
  else hideOverall();
190
294
  // 만점 축하(토끼 · 소리)는 LXP가 서버 점수 변경(소켓)을 받아 보인다. 콘텐츠는 제출만 하면 된다
191
295
  },
192
296
  });
193
- document.querySelector('.ec-submitbar')?.before(overall);
297
+ const bar = document.querySelector('.ec-submitbar');
298
+ bar?.before(overall);
299
+ if (perQuestion && bar) {
300
+ bar.before(waiting);
301
+ const button = bar.querySelector('button');
302
+ if (button)
303
+ new MutationObserver(() => {
304
+ const busy = button.getAttribute('aria-busy') === 'true';
305
+ waiting.hidden = !busy;
306
+ if (busy) hideOverall();
307
+ }).observe(button, { attributes: true, attributeFilter: ['aria-busy'] });
308
+ }
194
309
 
195
- // 다시 고치면 그 문항의 결과 색을 지운다 (기존 동작)
196
- root.addEventListener('input', (e) => clearResult(e.target));
197
- root.addEventListener('click', (e) => clearResult(e.target));
198
- function clearResult(target) {
199
- const card = target instanceof Element ? target.closest('[data-role="question"]') : null;
200
- const i = card ? questions.findIndex((q) => q.id === card.dataset.id) : -1;
201
- if (i < 0 || app.readOnly) return;
202
- views[i].setResult(null);
203
- hideOverall();
310
+ // 문서까지 올라온 이벤트는 답이 바뀐 뒤라 바로, 올라오지 않거나(보기 칩은 거품을 막음) 뒤에 바뀌는 답(끌어 놓기)은 이벤트가 끝난 뒤 한 번 더
311
+ for (const type of ['input', 'change', 'click', 'pointerup', 'keyup', 'drop']) {
312
+ document.addEventListener(type, clearChanged);
313
+ document.addEventListener(type, () => setTimeout(clearChanged, 0), true);
204
314
  }
205
315
  }
@@ -1,10 +1,11 @@
1
1
  /* 퀴즈 앱 스타일. 색 · 간격 · 모서리 값은 ui/theme.css(그 아래는 EDS 토큰 lib/elice-tokens.css), 모양은 EDS 컴포넌트 명세를 따릅니다
2
2
  보기 = RadioCard · 유형 표시 = Tag(muted) · 해설 = Accordion */
3
3
 
4
- /* 결과 아이콘 (원 안 ✓ · ✕, Font Awesome circle-check · circle-xmark 모양). mask로 쓰고 색은 결과 색 */
4
+ /* 결과 아이콘 (원 안 ✓ · ✕, Font Awesome circle-check · circle-xmark 모양 · AI 채점 결과는 반짝이). mask로 쓰고 색은 결과 색 */
5
5
  :root {
6
6
  --qz-icon-correct: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z'/%3E%3C/svg%3E");
7
7
  --qz-icon-wrong: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z'/%3E%3C/svg%3E");
8
+ --qz-icon-sparkle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.5 3.5 11 8l4.5 1.5L11 11l-1.5 4.5L8 11 3.5 9.5 8 8z'/%3E%3Cpath 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'/%3E%3Cpath 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'/%3E%3C/svg%3E");
8
9
  }
9
10
 
10
11
  /* ---------- 학생 ---------- */
@@ -129,6 +130,10 @@ body.qz-page .ec-result.no {
129
130
  --qz-result-bg: var(--qz-wrong-bg);
130
131
  --qz-result-border: var(--qz-wrong);
131
132
  }
133
+ .qz-question[data-result='note'] {
134
+ --qz-result-bg: var(--qz-surface-gray);
135
+ --qz-result-border: var(--eds-color-gray-400);
136
+ }
132
137
  .qz-question[data-result] .qz-text:not(:placeholder-shown) {
133
138
  border-color: var(--qz-result-border);
134
139
  }
@@ -335,6 +340,54 @@ body.qz-page .ec-result.no {
335
340
  color: var(--qz-wrong);
336
341
  background: var(--qz-wrong-bg);
337
342
  }
343
+ /* 정답 · 오답이 아닌 결과 줄 (data-result="note"): 회색 바탕, 아이콘 자리는 비움 */
344
+ .qz-result[data-result='note'],
345
+ .qz-question > .qz-result[data-result='note'] + .qz-explanation:not([hidden]) {
346
+ --qz-result-bg: var(--qz-surface-gray);
347
+ color: var(--eds-text-primary);
348
+ background: var(--qz-result-bg);
349
+ }
350
+ .qz-result[data-result='note']::before {
351
+ display: none;
352
+ }
353
+ /* AI 채점 문제의 결과 줄 (연주님 1.11.0 디자인): 만점 초록(correct) · 0점 빨강(wrong) · 그 사이 회색(note). 아이콘은 ✓ · ✕ 대신 반짝이 */
354
+ .qz-result[data-ai][data-result]::before {
355
+ display: block;
356
+ -webkit-mask-image: var(--qz-icon-sparkle);
357
+ mask-image: var(--qz-icon-sparkle);
358
+ }
359
+ /* 점수 "20"은 bold, "/ 35점"은 semibold (둘 다 18px primary 색, 줄 색과 상관없이). "AI 채점 결과"와 점수 사이는 글 공백에 더해 4px */
360
+ .qz-ai-score,
361
+ .qz-ai-max {
362
+ margin: 0;
363
+ color: var(--eds-primary-main);
364
+ font-size: 18px;
365
+ font-variant-numeric: normal;
366
+ letter-spacing: 0;
367
+ line-height: 1.5;
368
+ }
369
+ .qz-ai-score {
370
+ margin-left: 4px;
371
+ font-weight: var(--eds-fw-bold);
372
+ }
373
+ .qz-ai-max {
374
+ font-weight: var(--eds-fw-semibold);
375
+ }
376
+ /* AI 채점 문제 안내 (입력 칸 위): 배너 없이 반짝이 아이콘 + 글 */
377
+ .qz-ai-note {
378
+ display: flex;
379
+ align-items: center;
380
+ gap: 8px;
381
+ margin: 0;
382
+ color: var(--eds-text-primary);
383
+ font-size: var(--eds-fs-body2);
384
+ font-weight: var(--eds-fw-medium);
385
+ line-height: 1.5;
386
+ }
387
+ .qz-ai-note-icon {
388
+ flex: none;
389
+ color: var(--qz-accent);
390
+ }
338
391
  /* Accordion */
339
392
  .qz-explanation {
340
393
  border-radius: var(--qz-radius);
@@ -1419,13 +1472,16 @@ textarea.qe-group-name {
1419
1472
  margin-left: auto;
1420
1473
  }
1421
1474
  }
1422
- /* 학생: 100점보다 낮을 때 제출 바 위 상자 — 점수 · "아쉬워요!" · 안내, 오른쪽 아래 마스코트(위로 조금 넘침) */
1423
- .qz-result[data-result='partial'] {
1475
+ /* 학생: 100점보다 낮을 때 제출 바 위 상자 — 점수 · "아쉬워요!" · 안내, 오른쪽 아래 마스코트(위로 조금 넘침).
1476
+ per_question이 통과 점수 이상(passed, "통과했어요!")이면 같은 모양 */
1477
+ .qz-result[data-result='partial'],
1478
+ .qz-result[data-result='passed'] {
1424
1479
  border: 0;
1425
1480
  background: color-mix(in srgb, var(--eds-primary-main) 8%, var(--eds-background-paper, #fff));
1426
1481
  color: var(--eds-primary-dark, var(--eds-primary-main));
1427
1482
  }
1428
- .qz-result[data-result='partial']::before {
1483
+ .qz-result[data-result='partial']::before,
1484
+ .qz-result[data-result='passed']::before {
1429
1485
  display: none;
1430
1486
  }
1431
1487
  .qz-overall.qz-overall-mascot {
@@ -1484,6 +1540,25 @@ textarea.qe-group-name {
1484
1540
  font-size: var(--eds-fs-body2);
1485
1541
  font-weight: var(--eds-fw-medium);
1486
1542
  }
1543
+ /* 좁은 화면(휴대폰): 마스코트 · 점수 칸을 화면에 맞게 줄인다 (100px 그대로면 상자보다 커서 위 · 아래로 넘침) */
1544
+ @media (max-width: 599.98px) {
1545
+ .qz-overall.qz-overall-mascot {
1546
+ min-height: 72px;
1547
+ padding-right: 72px;
1548
+ }
1549
+ .qz-overall-img {
1550
+ right: 8px;
1551
+ width: 60px;
1552
+ }
1553
+ .qz-overall-score {
1554
+ min-width: 56px;
1555
+ height: 44px;
1556
+ padding: 0 10px;
1557
+ border-radius: 10px;
1558
+ font-size: 18px;
1559
+ line-height: 44px;
1560
+ }
1561
+ }
1487
1562
 
1488
1563
  /* 편집: 부분 채점 설정 상자 (문제 2개 이상일 때 맨 위) */
1489
1564
  .qe-score {
@@ -1739,8 +1814,10 @@ textarea.qe-group-name {
1739
1814
  overflow: hidden;
1740
1815
  clip-path: inset(50%);
1741
1816
  }
1817
+ /* 배점 칸: 세 자리(100)도 잘리지 않게 넓히고, 숫자 증감 버튼(스피너)은 자리를 차지하지 않게 숨긴다 (연주님 1.11.0 수정) */
1742
1818
  .qe-points-input {
1743
- width: 40px;
1819
+ box-sizing: border-box;
1820
+ width: 52px;
1744
1821
  height: 100%;
1745
1822
  min-height: 0;
1746
1823
  padding: 0 4px;
@@ -1750,6 +1827,13 @@ textarea.qe-group-name {
1750
1827
  font: inherit;
1751
1828
  font-weight: var(--eds-fw-semibold);
1752
1829
  text-align: right;
1830
+ -moz-appearance: textfield;
1831
+ appearance: textfield;
1832
+ }
1833
+ .qe-points-input::-webkit-outer-spin-button,
1834
+ .qe-points-input::-webkit-inner-spin-button {
1835
+ -webkit-appearance: none;
1836
+ margin: 0;
1753
1837
  }
1754
1838
  .qe-points-input:focus {
1755
1839
  outline: none;
@@ -1911,3 +1995,172 @@ textarea.qe-group-name {
1911
1995
  .qe-regex-tester .qe-regex-result:empty {
1912
1996
  display: none;
1913
1997
  }
1998
+
1999
+ /* AI 채점을 기다리는 동안 제출 바 위 (items, 1.11.0 · 연주님 디자인 전) */
2000
+ .qz-grading {
2001
+ box-sizing: border-box;
2002
+ width: 100%;
2003
+ max-width: 720px;
2004
+ margin: 0 auto 16px;
2005
+ padding: 12px 16px;
2006
+ border-radius: var(--qz-radius);
2007
+ background: color-mix(in srgb, var(--eds-primary-main) 8%, var(--eds-background-paper, #fff));
2008
+ align-items: center;
2009
+ gap: 12px;
2010
+ display: flex;
2011
+ }
2012
+ .qz-grading[hidden] {
2013
+ display: none;
2014
+ }
2015
+ .qz-grading-text {
2016
+ font-size: var(--eds-fs-body2);
2017
+ color: var(--eds-text-secondary);
2018
+ gap: 2px;
2019
+ display: grid;
2020
+ }
2021
+ .qz-grading-text strong {
2022
+ color: var(--eds-text-primary);
2023
+ font-size: var(--eds-fs-body1);
2024
+ }
2025
+ .qz-grading-spinner {
2026
+ flex: none;
2027
+ width: 20px;
2028
+ height: 20px;
2029
+ border: 2px solid color-mix(in srgb, var(--eds-primary-main) 25%, transparent);
2030
+ border-top-color: var(--eds-primary-main);
2031
+ border-radius: 50%;
2032
+ animation: qz-spin 0.8s linear infinite;
2033
+ }
2034
+ @keyframes qz-spin {
2035
+ to {
2036
+ transform: rotate(360deg);
2037
+ }
2038
+ }
2039
+ @media (prefers-reduced-motion: reduce) {
2040
+ .qz-grading-spinner {
2041
+ animation: none;
2042
+ }
2043
+ }
2044
+ /* AI 채점 문제의 채점 기준 칸 (편집 화면, 정규식 칸과 같은 간격). 라벨은 칸 위에 따로, 칸은 outlined (연주님 1.11.0 수정) */
2045
+ .qe-rubric {
2046
+ gap: 8px;
2047
+ display: grid;
2048
+ }
2049
+ .qe-rubric-field {
2050
+ gap: 6px;
2051
+ display: grid;
2052
+ }
2053
+ .qe-rubric-field .qe-rubric-label {
2054
+ line-height: 1.5;
2055
+ }
2056
+ .qe-rubric-head {
2057
+ justify-content: space-between;
2058
+ align-items: center;
2059
+ gap: 8px;
2060
+ display: flex;
2061
+ }
2062
+ .qe-rubric-label {
2063
+ color: var(--eds-text-secondary);
2064
+ font-size: var(--eds-fs-body2);
2065
+ font-weight: var(--eds-fw-semibold);
2066
+ }
2067
+ .qe-rubric-input {
2068
+ box-sizing: border-box;
2069
+ width: 100%;
2070
+ min-height: 112px;
2071
+ padding: 10px 12px;
2072
+ border: 1px solid var(--qz-border);
2073
+ border-radius: 6px;
2074
+ background: var(--eds-background-paper, #fff);
2075
+ font: inherit;
2076
+ line-height: 1.5;
2077
+ resize: vertical;
2078
+ }
2079
+ .qe-rubric-input:focus {
2080
+ outline: none;
2081
+ border-color: var(--qz-accent);
2082
+ box-shadow: inset 0 0 0 1px var(--qz-accent);
2083
+ }
2084
+ /* 칸 안(.qe-rubric-field)에서는 키트 밑줄 칸(textarea.ec-field-input)보다 앞서게 클래스 두 개로: 테두리 칸(outlined) */
2085
+ .qe-rubric-field .qe-rubric-input {
2086
+ padding: 10px 12px;
2087
+ border: 1px solid var(--qz-border);
2088
+ border-radius: 8px;
2089
+ }
2090
+ .qe-rubric-field .qe-rubric-input:hover {
2091
+ border-color: var(--eds-color-bluegray-400);
2092
+ }
2093
+ .qe-rubric-field .qe-rubric-input:focus {
2094
+ border-color: var(--qz-accent);
2095
+ box-shadow: inset 0 0 0 1px var(--qz-accent);
2096
+ }
2097
+ .qe-rubric-field .qe-rubric-input[aria-invalid='true'] {
2098
+ border-color: var(--eds-error-main);
2099
+ box-shadow: inset 0 0 0 1px var(--eds-error-main);
2100
+ }
2101
+ /* 배점 환산 안내 (배점이 100점이 아닐 때만): 배경 없이 info 아이콘 + 글, 점수만 굵게 (아래 가이드 상자와 겹치지 않게) */
2102
+ .qe-rubric-score {
2103
+ display: flex;
2104
+ align-items: flex-start;
2105
+ gap: 6px;
2106
+ margin: 0;
2107
+ color: var(--eds-text-secondary);
2108
+ font-size: var(--eds-fs-body2);
2109
+ font-weight: var(--eds-fw-medium);
2110
+ line-height: 1.5;
2111
+ }
2112
+ .qe-rubric-score[hidden] {
2113
+ display: none;
2114
+ }
2115
+ .qe-rubric-score-icon {
2116
+ flex: none;
2117
+ margin-top: 3px;
2118
+ color: var(--eds-text-secondary);
2119
+ }
2120
+ .qe-rubric-score strong {
2121
+ color: var(--eds-text-primary);
2122
+ font-weight: var(--eds-fw-bold);
2123
+ }
2124
+ .qe-count[data-state='over'] {
2125
+ color: var(--eds-error-main);
2126
+ }
2127
+ /* AI 채점 문제가 있어 잠근 부분 채점 스위치 */
2128
+ .qe-score-switch[data-locked] {
2129
+ cursor: default;
2130
+ }
2131
+ .qe-score-switch[data-locked] .qe-sw {
2132
+ opacity: 0.6;
2133
+ }
2134
+ /* 채점 기준 작성 가이드 (LXP AI 채점 설정의 안내 상자를 퀴즈 토큰으로) */
2135
+ .qe-rubric-guide {
2136
+ display: grid;
2137
+ grid-template-columns: auto minmax(0, 1fr);
2138
+ gap: 10px;
2139
+ padding: 12px 16px;
2140
+ border-radius: 8px;
2141
+ background: var(--qz-accent-soft);
2142
+ color: var(--eds-text-primary);
2143
+ }
2144
+ .qe-rubric-guide-icon {
2145
+ display: flex;
2146
+ color: var(--qz-accent);
2147
+ padding-top: 1px;
2148
+ }
2149
+ .qe-rubric-guide-body {
2150
+ min-width: 0;
2151
+ }
2152
+ .qe-rubric-guide-title {
2153
+ margin: 0 0 4px;
2154
+ color: var(--qz-accent);
2155
+ font-size: var(--eds-fs-body2);
2156
+ font-weight: var(--eds-fw-semibold);
2157
+ }
2158
+ .qe-rubric-guide-list {
2159
+ display: grid;
2160
+ gap: 2px;
2161
+ margin: 0;
2162
+ padding-left: 18px;
2163
+ color: var(--eds-text-secondary);
2164
+ font-size: var(--eds-fs-body2);
2165
+ line-height: 1.55;
2166
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quiz",
3
- "version": "1.10.1",
3
+ "version": "1.11.2",
4
4
  "title": "퀴즈",
5
5
  "description": "문항을 만들고 답안 형식을 고릅니다",
6
6
  "catalog": {
@@ -26,6 +26,7 @@ export declare const textAnswerAdd: Template;
26
26
  export declare const textAnswers: Template;
27
27
  export declare const textAnswerBox: Template;
28
28
  export declare const regexAnswer: Template;
29
+ export declare const rubricAnswer: Template;
29
30
  export declare const addQuestion: Template;
30
31
  export declare const questionLimit: Template;
31
32
  export declare const groupBox: Template;