@eliceio/cdk-cli 1.6.0 → 1.6.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.
@@ -378,7 +378,8 @@ function checkPartial(ctx, grading) {
378
378
  /**
379
379
  * per_question (AI 채점 문항이 있는 퀴즈, 1.11.0 · 서버 #65): questions 자리 = 문항 순서. AI 채점 문항 자리는 rubric 채점기
380
380
  * (채점 기준 + 문제 글), 나머지는 partial_pattern과 같은 문항별 정답 정규식(pattern 채점기). 배점은 문제마다 points와 같은 자리 score.
381
- * 공개 값: gradingType per_question · answerFormat 3(1.10 편집 화면이 덮어쓰지 못하게) · requires 1.11.0 · passScore(= pass_score).
381
+ * 공개 값: gradingType per_question · answerFormat 3(1.10 편집 화면이 덮어쓰지 못하게) · requires 1.11.0.
382
+ * 통과 점수(pass_score)는 퀴즈 1.12.0부터 두지 않는다: 이 프로젝트 편집 화면이 만들지 않는데 남아 있으면 경고.
382
383
  * 서버 저장 규칙(배점 합 · AI 채점 10개 · pass_score 범위)은 project.grading이 본다
383
384
  */
384
385
  function checkPerQuestion(ctx, grading) {
@@ -401,9 +402,8 @@ function checkPerQuestion(ctx, grading) {
401
402
  if (typeof tag === 'number' && settings.answerFormat !== tag) warn(`per_question 퀴즈의 answerFormat이 ${JSON.stringify(settings.answerFormat)}입니다. 편집 화면은 ${tag}로 저장해 퀴즈 1.10 편집 화면이 이 채점 설정을 덮어쓰지 못하게 합니다. ${RESAVE_FIX}`);
402
403
  const requires = settings.requires?.quiz;
403
404
  if (typeof requires !== 'string' || (compareVersions(requires, PER_QUESTION_VERSION) ?? 0) < 0) warn(`settings requires.quiz가 ${JSON.stringify(requires)}입니다. per_question은 퀴즈 템플릿 ${PER_QUESTION_VERSION} 이상이 읽으므로 편집 화면은 requires { "quiz": "${PER_QUESTION_VERSION}" }을 같이 저장합니다.`);
404
- const pass = grading.pass_score;
405
- if (pass === undefined) warn('grading.pass_score가 없습니다 (서버는 100점이어야 완료). 편집 화면은 AI 채점 문항이 있으면 통과 점수를 늘 같이 저장합니다.');
406
- if (settings.passScore !== (pass ?? 100)) warn(`공개 값 passScore(${JSON.stringify(settings.passScore)})가 grading.pass_score(${JSON.stringify(pass ?? 100)})와 다릅니다. 학생 화면은 passScore로 "통과"를 보입니다 (학생은 grading을 받지 못함).`);
405
+ // 이 프로젝트 편집 화면이 통과 점수를 아는지: 1.11.x는 넘긴 값을 pass_score로 넣고 1.12.0부터는 무시한다
406
+ if (grading.pass_score !== undefined && !('pass_score' in model.buildPerQuestionGrading([], {}, [], format, 100))) warn(`grading.pass_score(${JSON.stringify(grading.pass_score)})가 남아 있습니다. 이 퀴즈 템플릿에는 통과 점수가 없어 학생 화면은 100점보다 낮으면 "아쉬워요!"를 보이는데 서버는 이 값 이상이면 완료로 기록합니다. ${RESAVE_FIX}`);
407
407
  const list = grading.questions;
408
408
  if (!Array.isArray(list)) return; // 모양 오류는 project.grading이 알린다
409
409
  if (list.length !== questions.length) add(`문항은 ${questions.length}개인데 grading.questions는 ${list.length}개입니다. ${MOVE_HINT}`);
@@ -447,7 +447,7 @@ function checkPerQuestion(ctx, grading) {
447
447
  add(`정답: ${invalid.message}`);
448
448
  return;
449
449
  }
450
- const rebuilt = model.buildPerQuestionGrading(questions, parsed.key, parsed.scores, format, parsed.passScore).questions;
450
+ const rebuilt = model.buildPerQuestionGrading(questions, parsed.key, parsed.scores, format).questions;
451
451
  if (JSON.stringify(rebuilt) !== JSON.stringify(list)) {
452
452
  // 문제 글(question)만 다르면 경고: 채점은 되지만 AI가 지금 문제와 다른 글을 읽는다
453
453
  const strip = xs => JSON.stringify(xs.map(x => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eliceio/cdk-cli",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "교육자용 Custom HTML 콘텐츠 CLI",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -39,14 +39,15 @@
39
39
  "vite": "^8.3.6"
40
40
  },
41
41
  "devDependencies": {
42
- "@elice/rollup-config": "^1.260406.0",
43
- "@types/node": "^24.12.4",
42
+ "@elice/rollup-config": "5.261125.0",
43
+ "@elice/tsconfig": "5.261125.0",
44
+ "@types/node": "24.13.3",
44
45
  "cross-env": "^7.0.2",
45
46
  "del-cli": "^3.0.1",
46
- "rollup": "^4.0.0",
47
- "tslib": "^2.6.1",
48
- "typescript": "~5.9.3",
49
- "@eliceio/cdk": "^1.6.0"
47
+ "rollup": "4.62.4",
48
+ "tslib": "2.8.1",
49
+ "typescript": "6.0.3",
50
+ "@eliceio/cdk": "^1.6.1"
50
51
  },
51
52
  "scripts": {
52
53
  "prebuild": "del-cli \"buildcache/*\" \"es/*\"",
@@ -34,7 +34,7 @@ Read or watch / change values and observe (simulation, visualization) / follow s
34
34
  - **The grader and the answers are set on the edit screen** and saved to `settings.grading` with the edit token (`useSave` with `getGrading`): `{ "type": "pattern", "answer_key": "^…$" }` or `{ "type": "rubric", "rubric": "…" }`. The kit's default block `app.useGradingBlock()` uses LXP's wording (기준 답안 (정규표현식), 작성 예시 보기, 평가 기준). When the answers depend on the content's structure (questions, choices, steps), set them where the content is edited, for example in each question card. The answer to `pattern` is **one regular expression** that must match the whole submitted answer string (trimmed), so submit one string and build the regex from the instructor's choices.
35
35
  - **AI grading is `rubric`, saved on the edit screen.** AI가 답을 평가해 점수를 매기는 학습자료는 `settings.grading`을 `rubric`으로 저장한다 (편집 화면 `useSave`의 `getGrading`으로 평가 기준을 rubric 글로 만들어 저장), 학습 화면은 학습자 답만 제출한다, 화면에서 계산한 점수는 서버 채점에 쓰이지 않는다. Without `settings.grading`, `on_graded` scores 0 and never completes and `on_submit` gives 100 whatever the AI said. With `on_graded` + `rubric` the server grades 0–100 and completes at 1 point or more. Never compute the score with `mlapi` in the browser and submit it. Sketch and details: [5](05-screen-code.md) "AI grading".
36
36
  - **`partial_pattern` (partial score per question)**: `{ "type": "partial_pattern", "answer_key": ["^…$", "^…$"], "scores": [50, 50] }`. The student submits a **string array** in question order and `answer[i]` is matched against `answer_key[i]` the same way as `pattern` (trimmed, full match). The score is the sum of `scores[i]` of the matched questions, capped at 100. Rules the server enforces on save (422 otherwise): both arrays 1–50 long and the same length, each score an integer 0–100, the sum at least 100 (a lower sum could never complete). Only 100 is `is_correct: true` and completes `on_graded`; a missing item scores 0, extra items are ignored, and an answer that is not an array of strings is rejected (422). The response also carries `answer_correctness` (per question, `answer_key` order; `[]` for `pattern` · `rubric`), in the submit response and the submission lists, so a screen can mark each question right or wrong (SDK `answerCorrectness`). Kit helpers: `validatePartialGrading` (the same rules, for `getGrading`) and `splitScores(n)` (equal integer split summing to 100, e.g. 3 → [33, 33, 34]). The quiz template supports both (6).
37
- - **`per_question` (regex and AI-graded questions mixed, quiz template 1.11.0+)**: `{ "type": "per_question", "questions": [{ "score": 50, "grader": { "type": "pattern", "answer_key": "^q1=b$" } }, { "score": 50, "grader": { "type": "rubric", "rubric": "…", "question": "the problem text" } }], "pass_score": 60 }`. The answer is a string array in question order; an AI-graded item is the plain answer text (no `qN=`). A question earns `floor(grader score 0–100 × score / 100)`, the total is capped at 100, only 100 is `is_correct: true`, and `on_graded` completes at `pass_score` (1–100, default 100). Save rules (422 otherwise): 1–50 questions, integer scores summing to at least 100, at most 10 `rubric` graders, `rubric` ≤ 10,000 and `question` ≤ 2,000 characters. The response carries `question_results: [{ score, is_correct }]` per question (in the submission lists too). Use the quiz template's AI-graded question rather than writing this by hand.
37
+ - **`per_question` (regex and AI-graded questions mixed, quiz template 1.11.0+)**: `{ "type": "per_question", "questions": [{ "score": 50, "grader": { "type": "pattern", "answer_key": "^q1=b$" } }, { "score": 50, "grader": { "type": "rubric", "rubric": "…", "question": "the problem text" } }] }`. The answer is a string array in question order; an AI-graded item is the plain answer text (no `qN=`). A question earns `floor(grader score 0–100 × score / 100)`, the total is capped at 100, only 100 is `is_correct: true`, and `on_graded` completes only at 100 (the quiz template sets no pass score from 1.12.0 and drops an old `pass_score` when re-saved). Save rules (422 otherwise): 1–50 questions, integer scores summing to at least 100, at most 10 `rubric` graders, `rubric` ≤ 10,000 and `question` ≤ 2,000 characters. The response carries `question_results: [{ score, is_correct }]` per question (in the submission lists too). Use the quiz template's AI-graded question rather than writing this by hand.
38
38
  - **`entry` (Entry template only, two modes)**: `{ "type": "entry", "mode": "general", "answer_project": { "enc": "gzip+base64", "data": "…" } }` (compared with the answer project, 0 or 100; no other keys) or `{ "type": "entry", "mode": "ai", "answer_project": {…}, "rubrics": [{ "object": "ik8o", "criteria": "…", "score": 100 }] }` (`object` is an object id of the answer project — there is no whole-project criterion, `""` or an unknown id is rejected with 422 `entry_rubric_object_not_found`; the AI mode also needs `settings.entry.startProject`, and the general answer project needs at least one script or global list, else 422 `entry_answer_project_empty`; 1–10 criteria of 1–1,000 characters, integer scores 1–100 summing to 100; `question_results` and `grading_feedback.criteria` per criterion, in the submit response and in the submission history). The Entry template's edit screen saves it; do not write it by hand ([17](17-using-the-entry-template.md)).
39
39
  - **Choosing between `pattern` and `partial_pattern` is the person's call.** For a material with several questions, ask: "모두 맞혀야 100점" (`pattern`) or "문항별 부분 점수" (`partial_pattern`). For partial scores, take the per-question scores from the person or from the planning material; if neither gives them, use an equal score and say so in the summary (the quiz template's automatic score is `ceil(100 / questions)` each, 3 → 34 · 34 · 34; the kit's `splitScores` sums to exactly 100, 3 → 33 · 33 · 34). In the quiz template the author can also change the grader and the scores on the edit screen. Scores are integers 0–100 summing to at least 100 (usually exactly 100). Students must answer every question before they submit (the quiz blocks an unanswered question), so a skipped question cannot score 0 by design.
40
40
  - **Regexes run on the server in Python `re`**, not JavaScript: for a case-insensitive match put `(?i)` at the very start (`(?i)^(paris|파리)$`); the kit, `ecdk dev` and the local mock turn a leading `(?i)` · `(?s)` · `(?m)` into the JS flag. Avoid what the two engines read differently: `\w` · `\d` · `\b` match Unicode (Korean letters, full-width digits) in Python but only ASCII in JS, so write the characters out (`[0-9]`, `[가-힣A-Za-z]`); named groups are `(?P<name>…)` in Python and `(?<name>…)` in JS (do not use them); lookbehind must be fixed-width in Python; inline flags anywhere but the start fail in both. The generated keys (escaped literals, `(?:…|…)`, `^…$`) mean the same in both.
@@ -3,6 +3,7 @@
3
3
  - The quiz has **no instructor screen** (`metadata.json` `screens.instructor.enabled: false`): an instructor who opens it in LXP gets the student screen and can solve and submit it (graded, not recorded). Add `instructor.html` and turn it on only when the person asks for one; it shows only in the LXP editor preview (instructor switch), and instructors on the learning page still get the student screen.
4
4
  - The template starts with **no questions**: the student screen shows "학습 자료를 준비하고 있어요" until the edit screen saves. The questions and answers are added on the edit screen ("+ 문제 추가", any of the five types picked from the type button's list, the answer in the same card; up to 20 questions): in `ecdk dev`, so the upload can carry them (`.ecdk/settings.json`, sent after the person agrees), or on the LXP edit screen after upload. There is no quiz title or description field (the student screen starts with the questions); a `title` · `description` saved earlier is kept as is.
5
5
  - Question types: `select_one` · `select_multiple` · `order` · `text` · `group`. For `order` the student taps the choices in the right order and each gets a number 1 · 2 · 3 (tap again to remove, "답안 초기화" to clear); the answer string is the same as before. Question, choice and group ids (`q1`, `a`, `g1`) are lower-case letters and digits; once set, do not change them.
6
+ - **In-progress answers are saved automatically (template 1.12.0)**: before the first submission, the student screen saves the answers being worked on to the viewer's own store (`app.kvstore`, key `quiz.draft`, shape `{ v: 1, savedAt, answers: { questionId: { type, value } } }`) 0.8 s after the last change and right away when the page is hidden, and fills them back when the student reopens. Answers of a question that was removed or changed type, and removed choices or groups, are dropped. Once a submission exists the submitted answer wins: the kit fills it, the draft is deleted and no longer saved. Tutors (read-only) and the editor preview do not save. Failures are silent (one console line). Keep this when changing `screens/learn.js`; do not add another save of the same answers.
6
7
  - Student answer (`pattern`, the default): **one string**, `id=answer` per question joined by `;` in question order: `q1=b;q2=a,d;q3=c,a,b;q4=weight;q5=g1:a|g2:b,c`. Multiple choice lists choice ids **sorted**, order lists them in slot order, group lists `group:choices(sorted)` in group order joined by `|`, and a text answer is trimmed and sent **as typed with only `%` → `%25` and `;` → `%3B`** when the settings carry `"answerFormat": 2` (template 1.10.0 and later saves it), or `encodeURIComponent`-encoded when the tag is missing (quizzes saved by 1.9.x or earlier). Both decode with one `decodeURIComponent`.
7
8
  - Answers: the instructor picks the answer in each question card of the edit screen. Single and multiple choice mark it in the option rows (a "정답" radio or checkbox per option), group sorting picks each option's group in its row, order uses a separate "정답" section, and text questions pick an answer mode ("정답 입력 방식"): "직접 입력" (one allowed answer per line, any one is correct) or "정규 표현식" (a regex such as `[Aa]pples?|사과`, with a "채점 테스트" box that grades a sample answer the way the server does). A leading `^` · trailing `$` are dropped and a leading `(?i)` becomes `(?i:…)`; syntax the server (Python `regex`) and the browser read differently is blocked on save (`;`, flags in the middle, back-references, named groups, `[^]`, `\p{…}`, `\b`, `\Z` and similar; the list is in ADR 0013). Saving builds one regex and checks it, and blocks the save with the question number when an answer is missing, points at a deleted choice, or the regex does not match the answers back or still matches a changed answer. The quiz grades with `pattern` or `partial_pattern` (no hand-written regex for the whole quiz, only per text question; the author picks the type on the edit screen with the "부분 채점 허용" switch shown from two questions, a new quiz is `pattern`); its completion policy is `on_graded` (set by the publish skill with the answers, or picked in the '설정' panel at the top of the LXP edit page); with `on_submit` the server does not grade (`is_correct: null`, the kit shows "제출했어요."). `pattern` compares the whole answer at once, so **everything must match for 100**.
8
9
  - **Partial score per question (`partial_pattern`, 2 ②)**: ask the person which one they want ("모두 맞혀야 100점" or "문항별 부분 점수"). For partial scores, write into `.ecdk/settings.json` both the public `"gradingType": "partial_pattern"` (the student screen cannot see `grading`, so this tells it to submit an array) and `grading` `{ "type": "partial_pattern", "answer_key": ["^q1=b$", "^q2=a,d$", …], "scores": [60, 40, …] }`, one regex per question in question order, each the same as one `id=answer` piece of the `pattern` regex wrapped in `^…$`. Scores come from the person or the planning material, otherwise the automatic score: every question gets `ceil(100 / questions)` (3 questions → 34 · 34 · 34, the server caps the student's score at 100). Also write `"pointsMode": "custom"` with each question's `"points"` (same values as `scores`), or `"pointsMode": "equal"` for the automatic score. Build the regexes with `core/model.js`, never by hand ([15](15-edit-settings-by-hand.md)), run `ecdk doctor`, then have the person open the edit view and save once ("초안으로 저장") so the edit screen checks every answer. The author can change both on the edit screen: the "부분 채점 허용" switch picks `pattern` or `partial_pattern`, the row under it shows "자동 배점" or "직접 배점" with the total, and each question card has a score field (custom scores must be integers 0–100 summing to at least 100; "동일 점수로 적용하기" goes back to automatic). A quiz saved before keeps its type and scores unless the author changes them. The student answer is then an array `["q1=b", "q2=a,d", …]`, and the student screen marks each question ✓ · ✕ from `answer_correctness` (right after submitting and when reopened); below 100 it shows a box with the score, "아쉬워요!" and a mascot above the submit bar, and with custom scores each question title shows "N점". With `pattern` the score line is hidden: one question shows "오답입니다." in its card, and several questions with any wrong show "틀린 문제가 있습니다. 다시 한번 풀어보세요." above the submit bar. Every question must still be answered before submitting.
@@ -78,6 +78,16 @@ app.useSave({ getContent, validate });
78
78
 
79
79
  필요하면 `app.viewer` · `app.readOnly` · `app.records` · `app.navigation` · `app.submit()` · `app.saveContent()`를 직접 써도 됩니다.
80
80
 
81
+ ### 풀던 답 자동 저장 (제출 전)
82
+
83
+ 학생이 답을 고르거나 쓰면 마지막으로 고친 뒤 0.8초 뒤에 보는 사람의 저장 칸(`app.kvstore`, key `quiz.draft`)에 저장하고, 창을 닫거나 다른 탭으로 가면 기다리던 저장을 바로 합니다 (`core/draft.js`). **제출하기 전에** 다시 열면 그 답을 채웁니다.
84
+
85
+ - 저장 값: `{ v: 1, savedAt, answers: { 문항id: { type, value } } }`. `value`는 화면의 답 그대로(답 문자열이 아님)이고 빈 답은 넣지 않습니다. 200KB를 넘으면 저장하지 않습니다 (서버 칸 한도 512KB).
86
+ - 다시 열 때 지금 문항과 맞춰 봅니다: 없어진 문항 · 유형이 바뀐 문항 · 없어진 보기 · 그룹은 버리고 남은 답만 채웁니다. 모양 버전(`v`)이 다르면 읽지 않습니다.
87
+ - **한 번이라도 제출했으면 제출한 답이 먼저**입니다: 키트가 마지막 제출의 답을 채우고, 풀던 답은 지우고 더 저장하지 않습니다 (제출하면 그때 지움). 제출이 실패하면 풀던 답은 그대로 둡니다.
88
+ - 저장하는 사람: 학생과 학습 페이지에서 풀어 보는 교육자. 튜터링(보기 전용)은 읽지도 쓰지도 않고, 편집기 미리보기는 저장하지 않습니다.
89
+ - 저장 실패는 화면에 알리지 않고(콘솔 한 줄) 풀이를 막지 않습니다. 잠깐 끊김 · 쓰기 횟수 초과면 2초 뒤 한 번 더 해 봅니다.
90
+
81
91
  ## SDK: mock ↔ real
82
92
 
83
93
  키트가 자동으로 고릅니다. 화면 코드는 바꿀 필요가 없습니다.
@@ -116,11 +126,11 @@ app.useSave({ getContent, validate });
116
126
  - 학생은 모든 문항에 답해야 제출할 수 있습니다 (두 방식 모두).
117
127
  - **주관식 정답 입력 방식** (1.10.0, 연주님 2026-11-19, ADR 0013): 주관식 카드의 "정답 입력 방식" 세그먼트에서 **직접 입력**(허용 답을 줄마다, 그중 하나만 맞아도 정답) 또는 **정규 표현식**(예: `[Aa]pples?|사과`)을 고릅니다. 정규식 칸 아래 **채점 테스트**에 답을 적으면 "일치합니다. 정답으로 채점됩니다." / "일치하지 않습니다. 오답으로 채점됩니다."가 보입니다. 채점 테스트는 서버(Python `regex`)와 같게 맞춰 봅니다 (`\w` · `\d`는 유니코드, `.`은 줄바꿈만 뺌, 앞뒤 공백은 자름). 맨 앞 `^` · 맨 끝 `$`는 떼고, 맨 앞 `(?i)`는 `(?i:…)`로 바꿔 저장합니다. 서버와 브라우저가 다르게 읽는 문법(`;` · 가운데 플래그 · 역참조 · 이름 그룹 · `[^]` · `\p{…}` · `\b` · `\Z` 등, 목록은 ADR 0013)은 저장을 막습니다. 정규식 방식은 왕복 · 오답 검사를 하지 않고(작성자가 일부러 넓게 쓸 수 있음) 빈 답도 맞는 식이면 안내만 합니다. 정규식 → 직접 입력으로 바꿀 때 글자만으로 된 `a|b`가 아니면 정규식을 지우고 "정규식을 지웠습니다."(되돌리기)를 보입니다.
118
128
  - **답 형식 꼬리표** (1.10.0, ADR 0013): 편집 화면은 저장할 때 공개 settings에 `"answerFormat": 2` · `"requires": { "quiz": "1.10.0" }`와 주관식 문항마다 `"answerMode": "list" | "regex"`를 둡니다. 학생 화면은 `answerFormat`이 2면 주관식 답을 원문으로, 없으면(1.9.x 이하가 저장한 자료) 예전처럼 `encodeURIComponent`로 보냅니다. 그래서 옛 자료는 다시 저장하지 않아도 그대로 맞게 채점되고, 편집 화면에서 저장하면 정답이 새 형식으로 다시 쓰입니다. 더 새 템플릿이 저장한 퀴즈(1.10은 `answerFormat` 3 이상, 1.11은 4 이상)는 편집 화면 맨 위에 알리고 정답을 저장하지 않습니다. **zip을 1.9.x 이하로 되돌릴 때는 편집 화면에서 다시 저장해야 합니다** (옛 화면은 꼬리표를 읽지 못해 한글 · 공백 · `%` · `;` 답이 오답, 정규식 문항은 글자 답으로 읽힘). 되돌렸다가 다시 1.10으로 올릴 때도 1.10 편집 화면에서 다시 저장합니다. settings를 직접 쓸 때는 꼬리표와 정답 형식을 같이 맞춥니다.
119
- - **AI 채점 (1.11.0, 서버 `per_question`, elice-material #65)**: 주관식 카드의 "정답 입력 방식"에 **AI 채점**이 있습니다. 고르면 **채점 기준** 칸(문제마다 10,000자까지, 학생에게는 보이지 않음, placeholder는 예시 채점 기준)과 **채점 기준 작성 가이드**가 열리고, 배점은 문제 카드 머리의 배점 칸에서 정합니다 (문제가 하나면 100점). 배점이 100점이 아니면 채점 기준 칸 아래에 "이 문제의 배점은 N점입니다. 배점에 맞게 환산되어 채점됩니다."가 보입니다. AI 채점 문제가 하나라도 있으면 퀴즈 전체를 문제별 채점 `per_question`으로 저장하고, 맨 위 "부분 채점 허용"은 켜진 채 잠기며 그 상자 안(문제가 하나면 따로 상자)에 **통과 점수** 칸이 생깁니다. 통과 점수는 늘 같이 저장합니다 (비우면 100). AI 채점 문제는 10개까지입니다. AI 채점 문제가 없으면 예전과 똑같이 `pattern` · `partial_pattern`으로 저장합니다 (`answerFormat` 2 · `requires` 1.10.0 그대로).
129
+ - **AI 채점 (1.11.0, 서버 `per_question`, elice-material #65)**: 주관식 카드의 "정답 입력 방식"에 **AI 채점**이 있습니다. 고르면 **채점 기준** 칸(문제마다 10,000자까지, 학생에게는 보이지 않음, placeholder는 예시 채점 기준)과 **채점 기준 작성 가이드**가 열리고, 배점은 문제 카드 머리의 배점 칸에서 정합니다 (문제가 하나면 100점). 배점이 100점이 아니면 채점 기준 칸 아래에 "이 문제의 배점은 N점입니다. 배점에 맞게 환산되어 채점됩니다."가 보입니다. AI 채점 문제가 하나라도 있으면 퀴즈 전체를 문제별 채점 `per_question`으로 저장하고, 맨 위 "부분 채점 허용"은 켜진 채 잠깁니다. AI 채점 문제는 10개까지입니다. AI 채점 문제가 없으면 예전과 똑같이 `pattern` · `partial_pattern`으로 저장합니다 (`answerFormat` 2 · `requires` 1.10.0 그대로).
120
130
 
121
131
  ```jsonc
122
132
  // settings (공개 값). answerFormat 3: 1.10 편집 화면은 answerFormat이 2보다 크면 정답을 저장하지 않으므로 이 자료의 채점 설정을 덮어쓰지 못한다
123
- "gradingType": "per_question", "answerFormat": 3, "requires": { "quiz": "1.11.0" }, "passScore": 60, "pointsMode": "custom",
133
+ "gradingType": "per_question", "answerFormat": 3, "requires": { "quiz": "1.11.0" }, "pointsMode": "custom",
124
134
  "questions": [{ "id": "q1", "type": "select_one", "points": 30, … },
125
135
  { "id": "q2", "type": "text", "answerMode": "list", "points": 20, … },
126
136
  { "id": "q3", "type": "text", "answerMode": "rubric", "points": 50, … }],
@@ -131,16 +141,16 @@ app.useSave({ getContent, validate });
131
141
  { "score": 30, "grader": { "type": "pattern", "answer_key": "^q1=b$" } },
132
142
  { "score": 20, "grader": { "type": "pattern", "answer_key": "^q2=(?:weight|Weight)$" } },
133
143
  { "score": 50, "grader": { "type": "rubric", "rubric": "과적합 · 일반화를 모두 설명하면 만점 …", "question": "과적합과 일반화의 관계를 설명하세요." } }
134
- ],
135
- "pass_score": 60
144
+ ]
136
145
  }
137
146
  // 학생 답 (partial_pattern처럼 배열, AI 채점 문제 자리는 `문항id=` 없이 답 글만)
138
147
  ["q1=b", "q2=weight", "과적합은 …"]
139
148
  ```
140
149
 
141
- `grader.question`은 AI가 채점 기준과 같이 읽는 문제 글입니다: 질문 + 지문을 서식 없는 글로(그림은 설명 글만) 2,000자까지 자릅니다. 서버는 AI 채점 문제를 제출마다 한 번에 묶어 채점하고(빈 답은 AI 없이 0점), 문제 점수는 `floor(AI 점수 0~100 × 배점 / 100)`, 합은 100에서 자릅니다. `is_correct`는 100점일 때만 참이고, 완료(on_graded)는 합계가 통과 점수 이상일 때입니다. 완료는 제출할 때 정해지므로 통과 점수를 나중에 바꿔도 이미 낸 제출은 다시 계산되지 않습니다 (편집 화면에 안내). AI 채점은 제출마다 크레딧을 씁니다.
150
+ `grader.question`은 AI가 채점 기준과 같이 읽는 문제 글입니다: 질문 + 지문을 서식 없는 글로(그림은 설명 글만) 2,000자까지 자릅니다. 서버는 AI 채점 문제를 제출마다 한 번에 묶어 채점하고(빈 답은 AI 없이 0점), 문제 점수는 `floor(AI 점수 0~100 × 배점 / 100)`, 합은 100에서 자릅니다. `is_correct`는 100점일 때만 참입니다.
151
+ **통과 점수는 없습니다** (1.12.0): 편집 화면은 `pass_score` · 공개 값 `passScore`를 저장하지 않아 완료(on_graded)는 서버 기본값대로 100점일 때만입니다. 1.11.x가 저장한 `pass_score` · `passScore`는 학생 화면이 무시하고, 편집 화면에서 다시 저장하면 빠집니다 (다시 저장하기 전에는 서버가 그 값 이상이면 완료로 기록하니 다시 저장합니다). AI 채점은 제출마다 크레딧을 씁니다.
142
152
 
143
- 학생 화면은 제출하고 기다리는 동안 제출 바 위에 "AI가 채점하고 있어요"를 보이고, 정규식 문제는 문항별 결과로 정답 · 오답, AI 채점 문제는 "AI 채점 결과 받은 점수 / 배점"을 보입니다 (배점 만점이면 초록 · 0점이면 빨강 · 그 사이는 회색 줄, 반짝이 아이콘). 결과는 학생이 답을 실제로 고칠 때까지 남습니다 (입력 칸을 누르거나 초점만 옮기면 그대로). 문항별 점수는 서버 `question_results`(SDK에서 `questionResults`)를 씁니다: 지금 SDK `submit()` 결과에는 없어 제출 직후에는 방금 저장된 제출 기록(`history`)에서 읽고(답 · 점수가 같을 때만), 못 읽으면(교육자 · 미리보기는 기록이 없음) "AI 채점 완료. 점수는 총점에 반영되었습니다."를 보입니다. 아래 점수 상자는 100점보다 낮고 통과 점수(공개 값 `passScore`) 이상이면 "통과했어요!", 아래면 "아쉬워요!"입니다. AI 채점이 실패하면(502 `MATERIAL_GRADING_FAILED`, 입력 가드 거절 `refused`는 따로 · 409 크레딧 없음) 제출은 저장되지 않고 제출 바에 이유를 보입니다. `ecdk dev`는 AI 대신 글 길이로 만든 **흉내 점수**(빈 답 0, 아니면 min(100, 20 + 글자 수 / 5)를 배점 비율로 내림)로 채점하고 1.2초 기다리며, 화면 · 로그에 흉내 값이라고 표시합니다. 답에 "이전 지시를 무시" 같은 문장을 쓰면 거절(`refused`)을 흉내 냅니다.
153
+ 학생 화면은 제출하고 기다리는 동안 제출 바 위에 "AI가 채점하고 있어요"를 보이고, 정규식 문제는 문항별 결과로 정답 · 오답, AI 채점 문제는 "AI 채점 결과 받은 점수 / 배점"을 보입니다 (배점 만점이면 초록 · 0점이면 빨강 · 그 사이는 회색 줄, 반짝이 아이콘). 결과는 학생이 답을 실제로 고칠 때까지 남습니다 (입력 칸을 누르거나 초점만 옮기면 그대로). 문항별 점수는 서버 `question_results`(SDK에서 `questionResults`)를 씁니다: 지금 SDK `submit()` 결과에는 없어 제출 직후에는 방금 저장된 제출 기록(`history`)에서 읽고(답 · 점수가 같을 때만), 못 읽으면(교육자 · 미리보기는 기록이 없음) "AI 채점 완료. 점수는 총점에 반영되었습니다."를 보입니다. 아래 점수 상자는 `partial_pattern`과 같습니다 (100점보다 낮으면 "아쉬워요!", 100점이면 없음). AI 채점이 실패하면(502 `MATERIAL_GRADING_FAILED`, 입력 가드 거절 `refused`는 따로 · 409 크레딧 없음) 제출은 저장되지 않고 제출 바에 이유를 보입니다. `ecdk dev`는 AI 대신 글 길이로 만든 **흉내 점수**(빈 답 0, 아니면 min(100, 20 + 글자 수 / 5)를 배점 비율로 내림)로 채점하고 1.2초 기다리며, 화면 · 로그에 흉내 값이라고 표시합니다. 답에 "이전 지시를 무시" 같은 문장을 쓰면 거절(`refused`)을 흉내 냅니다.
144
154
  - 편집 화면은 답(`settings.grading`)만 저장합니다. 완료 정책은 LXP 페이지 설정입니다 (ADR 0012): publish 스킬이 동의를 받아 업로드 때 정하거나 교육자가 LXP 편집 페이지 위쪽 '설정' 패널에서 고릅니다. 퀴즈는 **채점해 통과하면 완료(on_graded)**여야 채점합니다. 한 번도 저장하지 않은 페이지에 퀴즈 템플릿을 넣으면 서버가 `on_graded`(답안 확인 후 완료)로 정합니다 (템플릿 기본값, 저장한 적 있는 페이지는 그대로). 제출하면 완료(on_submit)면 서버가 채점하지 않고 제출만으로 완료되어 점수 없이 "제출했어요."가 보입니다.
145
155
 
146
156
  ## 정답
@@ -0,0 +1,32 @@
1
+ // core/draft.js 타입 (편집기 자동완성 · 테스트용)
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ export declare const DRAFT_KEY: 'quiz.draft';
4
+ export declare const DRAFT_VERSION: 1;
5
+ export declare const DRAFT_DELAY_MS: number;
6
+ export declare const DRAFT_MAX_BYTES: number;
7
+ /** 저장 값 { v: 1, savedAt, answers: { 문항id: { type, value } } } */
8
+ export interface QuizDraft {
9
+ v: 1;
10
+ savedAt: string;
11
+ answers: Record<string, { type: string; value: unknown }>;
12
+ }
13
+ export declare function draftValue(questions: any[], values: unknown[], now?: Date): QuizDraft;
14
+ /** 문항 순서대로 채울 답 (채울 것이 없는 문항은 undefined). 읽을 수 없거나 채울 것이 없으면 null */
15
+ export declare function readDraft(questions: any[], saved: unknown): (unknown | undefined)[] | null;
16
+ export interface DraftSaver {
17
+ baseline(): void;
18
+ changed(): boolean;
19
+ flush(): Promise<void>;
20
+ markStored(): void;
21
+ stop(): Promise<void>;
22
+ readonly stopped: boolean;
23
+ }
24
+ export declare function createDraftSaver(options: {
25
+ kvstore: {
26
+ post(params: { key: string; value: any }): Promise<void>;
27
+ delete(key: string): Promise<void>;
28
+ };
29
+ questions: any[];
30
+ getValues: () => unknown[];
31
+ delayMs?: number;
32
+ }): DraftSaver;
@@ -0,0 +1,224 @@
1
+ // 풀던 답 자동 저장 (제출 전): 학생이 답을 고치면 잠깐 모았다가 보는 사람의 저장 칸(키트 app.kvstore)에 두고,
2
+ // 제출하기 전에 다시 열면 그 답을 채운다. 한 번이라도 제출했으면 제출한 답이 먼저다 (키트 useSubmit이 채움) —
3
+ // 그때 남은 풀던 답은 지우고 더 저장하지 않는다.
4
+ // 저장 값 (DRAFT_KEY 'quiz.draft'): { v: 1, savedAt: ISO 시각, answers: { 문항id: { type, value } } }.
5
+ // value는 화면의 답 그대로(문항 getValue 모양, 답 문자열이 아님)라 채점 방식 · 답 형식이 바뀌어도 상관없다.
6
+ // 다시 열 때 지금 문항과 맞춰 본다: 없어진 문항 · 유형이 바뀐 문항 · 없어진 보기 · 그룹은 버린다.
7
+
8
+ /** 저장 이름 (서버는 학습자료 × 계정마다 칸 하나, 그 안의 'quiz' 아래 'draft') */
9
+ export const DRAFT_KEY = 'quiz.draft';
10
+ /** 저장 값 모양 버전. 모양을 바꾸면 올리고, 모르는 버전은 읽지 않는다 */
11
+ export const DRAFT_VERSION = 1;
12
+ /** 마지막으로 고친 뒤 이만큼 기다렸다 저장 (서버 쓰기 한도 초당 약 20번보다 훨씬 적게) */
13
+ export const DRAFT_DELAY_MS = 800;
14
+ /** 저장 값 크기 한도 (서버 칸 한도 512KB보다 넉넉히 작게). 넘으면 저장하지 않는다 */
15
+ export const DRAFT_MAX_BYTES = 200 * 1024;
16
+ /** 주관식 답 하나의 글자 수 한도 (다시 채울 때) */
17
+ const TEXT_MAX = 50_000;
18
+ /** 잠깐 끊김 · 쓰기 횟수 초과면 한 번 더 */
19
+ const RETRYABLE = new Set(['request_failed', 'rate_limited']);
20
+ const RETRY_MS = 2000;
21
+
22
+ const isText = (v) => typeof v === 'string';
23
+
24
+ /** 문항의 화면 답이 비었는지 (비었으면 저장하지 않음) */
25
+ function isEmpty(q, value) {
26
+ switch (q.type) {
27
+ case 'select_one':
28
+ return !value;
29
+ case 'text':
30
+ return !isText(value) || value === '';
31
+ case 'select_multiple':
32
+ case 'order':
33
+ return !Array.isArray(value) || !value.some(Boolean);
34
+ case 'group':
35
+ return !value || Object.values(value).every((ids) => !Array.isArray(ids) || ids.length === 0);
36
+ default:
37
+ return true;
38
+ }
39
+ }
40
+
41
+ /**
42
+ * 지금 답 → 저장 값. 빈 답은 넣지 않는다
43
+ * @param {object[]} questions
44
+ * @param {unknown[]} values 문항 순서대로 getValue()
45
+ */
46
+ export function draftValue(questions, values, now = new Date()) {
47
+ const answers = {};
48
+ questions.forEach((q, i) => {
49
+ if (!q?.id || isEmpty(q, values[i])) return;
50
+ answers[q.id] = { type: q.type, value: values[i] };
51
+ });
52
+ return { v: DRAFT_VERSION, savedAt: now.toISOString(), answers };
53
+ }
54
+
55
+ /** 저장한 답을 지금 문항에 맞춘다. 맞지 않는 것은 버리고, 남는 것이 없으면 undefined */
56
+ function sanitize(q, value) {
57
+ const optionIds = new Set((q.options ?? []).map((o) => o.id));
58
+ const ids = (list) => [
59
+ ...new Set((Array.isArray(list) ? list : []).filter((id) => isText(id) && optionIds.has(id))),
60
+ ];
61
+ switch (q.type) {
62
+ case 'select_one':
63
+ return isText(value) && optionIds.has(value) ? value : undefined;
64
+ case 'select_multiple': {
65
+ const picked = ids(value);
66
+ return picked.length ? picked : undefined;
67
+ }
68
+ case 'order': {
69
+ const picked = ids(value).slice(0, Math.max(0, Number(q.slots) || 0));
70
+ return picked.length ? picked : undefined;
71
+ }
72
+ case 'text':
73
+ return isText(value) && value !== '' ? value.slice(0, TEXT_MAX) : undefined;
74
+ case 'group': {
75
+ if (!value || typeof value !== 'object' || Array.isArray(value)) return undefined;
76
+ const out = Object.fromEntries((q.groups ?? []).map((g) => [g.id, []]));
77
+ const used = new Set();
78
+ for (const [gid, list] of Object.entries(value)) {
79
+ if (!(gid in out)) continue;
80
+ for (const id of ids(list)) if (!used.has(id)) (used.add(id), out[gid].push(id));
81
+ }
82
+ return used.size ? out : undefined;
83
+ }
84
+ default:
85
+ return undefined;
86
+ }
87
+ }
88
+
89
+ /**
90
+ * 저장 값 → 문항 순서대로 채울 답 (채울 것이 없는 문항은 undefined). 읽을 수 없는 값(모양 · 버전이 다름)이거나
91
+ * 채울 답이 하나도 없으면 null
92
+ * @param {object[]} questions
93
+ * @param {unknown} saved
94
+ */
95
+ export function readDraft(questions, saved) {
96
+ if (!saved || typeof saved !== 'object' || saved.v !== DRAFT_VERSION) return null;
97
+ const { answers } = saved;
98
+ if (!answers || typeof answers !== 'object') return null;
99
+ const values = questions.map((q) => {
100
+ const entry = Object.hasOwn(answers, q?.id) ? answers[q.id] : null;
101
+ if (!entry || typeof entry !== 'object' || entry.type !== q.type) return undefined;
102
+ return sanitize(q, entry.value);
103
+ });
104
+ return values.some((v) => v !== undefined) ? values : null;
105
+ }
106
+
107
+ /** JSON 크기 (UTF-8 바이트) */
108
+ const bytesOf = (value) => new TextEncoder().encode(JSON.stringify(value)).length;
109
+
110
+ /**
111
+ * 풀던 답 저장기. 답이 바뀌었을 수 있을 때 changed()를 부르면 지금 답이 마지막 저장과 다를 때만 delayMs 뒤 저장한다
112
+ * (그 사이 또 바뀌면 다시 기다림). 저장 중에 또 바뀌면 끝난 뒤 한 번 더. 실패는 화면에 알리지 않고(콘솔 한 줄)
113
+ * 잠깐 끊김 · 쓰기 횟수 초과면 한 번 더 해 본다.
114
+ * @param {{
115
+ * kvstore: { post(p: { key: string, value: unknown }): Promise<void>, delete(key: string): Promise<void> },
116
+ * questions: object[],
117
+ * getValues: () => unknown[],
118
+ * delayMs?: number,
119
+ * }} options
120
+ */
121
+ export function createDraftSaver({ kvstore, questions, getValues, delayMs = DRAFT_DELAY_MS }) {
122
+ let stopped = false;
123
+ let timer = null;
124
+ let running = null;
125
+ let again = false;
126
+ let retried = false;
127
+ /** 마지막으로 저장한(또는 처음 · 채운) 답 */
128
+ let lastSaved = null;
129
+ /** 저장 칸에 풀던 답이 있을 수 있는지 (지울 때) */
130
+ let stored = false;
131
+ let warned = false;
132
+
133
+ const current = () => {
134
+ try {
135
+ return JSON.stringify(draftValue(questions, getValues(), new Date(0)).answers);
136
+ } catch {
137
+ return null;
138
+ }
139
+ };
140
+ const warn = (err) => {
141
+ if (warned) return;
142
+ warned = true;
143
+ console.warn('[quiz] 풀던 답을 저장하지 못했어요:', err?.message ?? err);
144
+ };
145
+
146
+ async function save() {
147
+ const value = draftValue(questions, getValues());
148
+ const key = JSON.stringify(value.answers);
149
+ if (key === lastSaved) return;
150
+ if (bytesOf(value) > DRAFT_MAX_BYTES) return warn(new Error('too large'));
151
+ stored = true;
152
+ await kvstore.post({ key: DRAFT_KEY, value });
153
+ lastSaved = key;
154
+ retried = false;
155
+ }
156
+
157
+ function run() {
158
+ clearTimeout(timer);
159
+ timer = null;
160
+ if (stopped) return Promise.resolve();
161
+ if (running) {
162
+ again = true;
163
+ return running;
164
+ }
165
+ running = (async () => {
166
+ try {
167
+ await save();
168
+ } catch (err) {
169
+ if (!stopped && !retried && RETRYABLE.has(err?.code)) {
170
+ retried = true;
171
+ timer = setTimeout(() => void run(), RETRY_MS);
172
+ } else warn(err);
173
+ } finally {
174
+ running = null;
175
+ }
176
+ if (again) {
177
+ again = false;
178
+ await run();
179
+ }
180
+ })();
181
+ return running;
182
+ }
183
+
184
+ return {
185
+ /** 지금 답을 기준으로 (처음 그렸을 때 · 저장한 답을 채운 뒤): 이것과 같으면 저장하지 않는다 */
186
+ baseline() {
187
+ lastSaved = current();
188
+ },
189
+ /** 답이 바뀌었을 수 있음: 마지막 저장과 다르면 delayMs 뒤 저장. 다르면 true */
190
+ changed() {
191
+ if (stopped) return false;
192
+ const now = current();
193
+ if (now === null || now === lastSaved) return false;
194
+ clearTimeout(timer);
195
+ timer = setTimeout(() => void run(), delayMs);
196
+ return true;
197
+ },
198
+ /** 기다리는 저장이 있으면 바로 (창을 닫거나 숨길 때) */
199
+ flush() {
200
+ return timer || running ? run() : Promise.resolve();
201
+ },
202
+ /** 저장 칸에 풀던 답이 있다고 알림 (다시 열어 읽었을 때) */
203
+ markStored() {
204
+ stored = true;
205
+ },
206
+ /** 더 저장하지 않고, 저장 칸의 풀던 답을 지운다 (제출했을 때 · 제출 기록이 있을 때). 지우기 실패는 조용히 */
207
+ async stop() {
208
+ stopped = true;
209
+ clearTimeout(timer);
210
+ timer = null;
211
+ await running?.catch(() => undefined);
212
+ if (!stored) return;
213
+ stored = false;
214
+ try {
215
+ await kvstore.delete(DRAFT_KEY);
216
+ } catch {
217
+ // 남아도 다음에 열 때 제출 기록이 있으면 읽지 않고 다시 지운다
218
+ }
219
+ },
220
+ get stopped() {
221
+ return stopped;
222
+ },
223
+ };
224
+ }
@@ -131,11 +131,10 @@ export interface GradingQuestion {
131
131
  | { type: 'pattern'; answer_key: string }
132
132
  | { type: 'rubric'; rubric: string; question?: string };
133
133
  }
134
- /** per_question 채점 설정 (서버 GradingPerQuestion). pass_score는 1~100 (없으면 100) */
134
+ /** per_question 채점 설정 (서버 GradingPerQuestion). 통과 점수 pass_score는 넣지 않는다 (서버 기본값 100) */
135
135
  export interface PerQuestionGrading {
136
136
  type: 'per_question';
137
137
  questions: GradingQuestion[];
138
- pass_score?: number;
139
138
  }
140
139
  /** AI 채점 문항이 하나라도 있는지 (있으면 per_question으로 저장) */
141
140
  export declare function usesPerQuestion(questions: any[] | undefined): boolean;
@@ -154,14 +153,13 @@ export declare function buildPerQuestionGrading(
154
153
  questions: any[],
155
154
  key: Record<string, any>,
156
155
  scores: number[],
157
- format?: number,
158
- passScore?: number
156
+ format?: number
159
157
  ): PerQuestionGrading;
160
- /** per_question(옛 items도) 채점 설정 → 문항별 정답 · 배점 · 통과 점수. 모양이 다르면 null */
158
+ /** per_question(옛 items도) 채점 설정 → 문항별 정답 · 배점. 모양이 다르면 null */
161
159
  export declare function parsePerQuestionGrading(
162
160
  questions: any[],
163
161
  grading: unknown
164
- ): { key: Record<string, any>; scores: unknown[]; passScore?: number } | null;
162
+ ): { key: Record<string, any>; scores: unknown[] } | null;
165
163
  /** per_question 채점 설정 검사 (서버 규칙). 문제가 없으면 null */
166
164
  export declare function validatePerQuestionGrading(
167
165
  grading: unknown,
@@ -178,8 +176,7 @@ export declare function validatePerQuestionGrading(
178
176
  | 'questionMax'
179
177
  | 'rubricCount'
180
178
  | 'kind'
181
- | 'total'
182
- | 'passScore';
179
+ | 'total';
183
180
  } | null;
184
181
  /** 문항별 답 → 제출할 문자열 배열 (partial_pattern) */
185
182
  export declare function joinAnswerList(
@@ -17,10 +17,11 @@
17
17
  // 학생 화면은 grading을 받지 못하므로 settings에 공개 값 gradingType: 'partial_pattern'을 같이 둔다 (없으면 pattern)
18
18
  // - per_question (1.11.0, 서버 elice-material #65 · AI 채점 문항이 하나라도 있을 때): 문항마다 배점과 채점기
19
19
  // { type: 'per_question', questions: [{ score: 30, grader: { type: 'pattern', answer_key: '^q1=b$' } },
20
- // { score: 70, grader: { type: 'rubric', rubric: '…', question: '문제 글' } }], pass_score: 60 }.
20
+ // { score: 70, grader: { type: 'rubric', rubric: '…', question: '문제 글' } }] }.
21
21
  // questions 순서 = 답 배열 순서 = 문항 순서. 답은 partial_pattern처럼 문자열 배열이고, AI 채점 문항 자리에는 `문항id=` 없이 그 문항의 답 글만.
22
- // 서버는 AI 점수(0~100) × 배점 / 100을 내림, 합은 100에서 자르고 100점일 때만 정답, 합이 pass_score 이상이면 완료.
23
- // 공개 값 gradingType: 'per_question' · passScore(학생 화면의 "통과" 표시) · answerFormat 3 · requires { quiz: '1.11.0' }.
22
+ // 서버는 AI 점수(0~100) × 배점 / 100을 내림, 합은 100에서 자르고 100점일 때만 정답.
23
+ // 통과 점수 pass_score는 넣지 않는다 (1.12.0, 서버 기본값: on_graded는 100점일 때만 완료). 1.11.x가 저장한 값은 읽을 때 무시한다.
24
+ // 공개 값 gradingType: 'per_question' · answerFormat 3 · requires { quiz: '1.11.0' }.
24
25
  // AI 채점 문항이 없으면 pattern · partial_pattern을 예전 그대로 저장한다
25
26
 
26
27
  // 화면에 보이는 문구는 여기 두지 않습니다 (ui/texts.js). 문구가 필요한 함수는 화면(screens/)이 문구를 넘겨 줍니다.
@@ -780,9 +781,9 @@ export function questionText(q) {
780
781
  /**
781
782
  * 문항별 정답 · 배점 → per_question 채점 설정 (서버 GradingPerQuestion). 정규식 문항은 buildAnswerKey를 문항 하나씩
782
783
  * (partial_pattern과 같은 정규식), AI 채점 문항은 채점 기준 글과 문제 글(questionText). scores: 문항 순서의 배점.
783
- * passScore: 통과 점수 (편집 화면은 늘 넣는다, 비우면 100)
784
+ * 통과 점수(pass_score)는 넣지 않는다 (서버 기본값 100)
784
785
  */
785
- export function buildPerQuestionGrading(questions, key, scores, format = 1, passScore) {
786
+ export function buildPerQuestionGrading(questions, key, scores, format = 1) {
786
787
  return {
787
788
  type: PER_QUESTION,
788
789
  questions: questions.map((q, i) => ({
@@ -791,7 +792,6 @@ export function buildPerQuestionGrading(questions, key, scores, format = 1, pass
791
792
  ? { type: 'rubric', rubric: String(key[q.id] ?? ''), question: questionText(q) }
792
793
  : { type: 'pattern', answer_key: buildAnswerKey([q], key, format) },
793
794
  })),
794
- ...(passScore !== undefined ? { pass_score: passScore } : {}),
795
795
  };
796
796
  }
797
797
 
@@ -804,7 +804,8 @@ const fromItem = (item) =>
804
804
  : null;
805
805
 
806
806
  /**
807
- * 저장된 per_question(옛 items도) 채점 설정 → { key: 문항별 정답(화면 값), scores: 문항 순서 배점, passScore }.
807
+ * 저장된 per_question(옛 items도) 채점 설정 → { key: 문항별 정답(화면 값), scores: 문항 순서 배점 }.
808
+ * 1.11.x가 저장한 pass_score는 읽지 않는다 (다시 저장하면 빠짐).
808
809
  * 자리 = 문항 순서이고 정규식 문항은 문항 id가, AI 채점 문항은 그 자리 문항이 AI 채점 문항이어야 한다. 모양이 다르면 null
809
810
  */
810
811
  export function parsePerQuestionGrading(questions, grading) {
@@ -830,14 +831,14 @@ export function parsePerQuestionGrading(questions, grading) {
830
831
  } else return null;
831
832
  scores.push(entry.score);
832
833
  }
833
- const passScore = Number.isInteger(grading.pass_score) ? grading.pass_score : undefined;
834
- return { key, scores, passScore };
834
+ return { key, scores };
835
835
  }
836
836
 
837
837
  /**
838
838
  * per_question 채점 설정 검사 (서버 GradingPerQuestion과 같은 규칙, 그리고 편집 화면 규칙: 채점 기준은 비어 있지 않음):
839
839
  * 문항 1~50 · 배점 0~100 정수 · 합 100 이상 · 정규식은 비어 있지 않고 500자 이하 · 채점 기준 10,000자 이하 ·
840
- * 문제 글 2,000자 이하 · AI 채점 문항 10개 이하 · pass_score(있으면) 1~100 정수.
840
+ * 문제 글 2,000자 이하 · AI 채점 문항 10개 이하.
841
+ * pass_score는 검사하지 않는다 (편집 화면은 넣지 않음, 1.11.x가 저장한 옛 값이 있어도 읽다가 막히지 않게).
841
842
  * 문제가 없으면 null, 있으면 { index, code } (index는 문항 자리, 전체 문제면 -1. 문구는 화면이 정함)
842
843
  * @param {object} grading
843
844
  * @param {number} [answerKeyMax] 정규식 길이 상한 (키트 ANSWER_KEY_MAX)
@@ -865,9 +866,6 @@ export function validatePerQuestionGrading(grading, answerKeyMax = 500) {
865
866
  if (list.filter((entry) => entry.grader.type === 'rubric').length > RUBRIC_QUESTIONS_MAX)
866
867
  return { index: -1, code: 'rubricCount' };
867
868
  if (list.reduce((sum, entry) => sum + entry.score, 0) < 100) return { index: -1, code: 'total' };
868
- const pass = grading.pass_score;
869
- if (pass !== undefined && (!Number.isInteger(pass) || pass < 1 || pass > 100))
870
- return { index: -1, code: 'passScore' };
871
869
  return null;
872
870
  }
873
871
 
@@ -5,7 +5,8 @@
5
5
  // - 끔 · 문제 하나: pattern, 정답 정규식 하나 (모두 맞혀야 100점)
6
6
  // - 켬: partial_pattern, 문항마다 정규식 + 배점 (맞은 문항 배점의 합, 최대 100). 배점은 자동(똑같이 나눔) 또는 카드 머리에서 직접.
7
7
  // 학생 화면이 답을 배열로 내도록 settings에 gradingType을, 배점 표시용으로 pointsMode · 문제별 points도 같이 저장 (배점은 정답이 아님)
8
- // - AI 채점 문제가 하나라도 있음 (1.11.0): per_question, 문항마다 배점 + 채점기(정규식 · AI 채점 기준) + 통과 점수 pass_score.
8
+ // - AI 채점 문제가 하나라도 있음 (1.11.0): per_question, 문항마다 배점 + 채점기(정규식 · AI 채점 기준).
9
+ // 통과 점수(pass_score)는 두지 않는다 (1.12.0): 서버 기본값대로 100점일 때만 완료. 1.11.x가 저장한 pass_score · passScore는 다시 저장하면 빠진다.
9
10
  // 부분 채점 스위치는 켜진 채 잠기고, 답 형식 answerFormat 3 · requires 1.11.0으로 1.10 편집 화면이 덮어쓰지 못하게 한다
10
11
  // 문제 내용(content)은 학생에게도 내려가므로 정답을 넣지 않습니다 (정답은 grading에만, 서버가 학생에게 내려주지 않음).
11
12
  // 여기서는 어떤 칸을 어떤 순서로 놓을지만 정합니다. 모양은 ui/(templates/edit.js · texts · theme.css), 동작은 core/.
@@ -153,13 +154,10 @@ const partialActive = () => partialOn && draft.questions.length > 1;
153
154
  const perQuestionActive = () => usesPerQuestion(draft.questions);
154
155
  /** 문제별 배점을 쓰는지: 부분 채점이나 per_question이고 문제가 2개 이상 (per_question 문제 하나면 배점 100) */
155
156
  const scoringActive = () => (partialOn || perQuestionActive()) && draft.questions.length > 1;
156
- // 저장된 per_question(옛 제안 items도) 채점 설정 → 문항별 정답 · 배점 · 통과 점수 (자리 = 문항 순서). 못 읽으면 null
157
+ // 저장된 per_question(옛 제안 items도) 채점 설정 → 문항별 정답 · 배점 (자리 = 문항 순서). 못 읽으면 null
157
158
  const savedPerQuestion = isPerQuestionType(app.grading?.type)
158
159
  ? parsePerQuestionGrading(draft.questions, app.grading)
159
160
  : undefined;
160
- // 통과 점수 (AI 채점 문제가 있는 퀴즈만, grading.pass_score). 칸이 비었거나 숫자가 아니면 undefined · NaN.
161
- // 저장할 때는 늘 보낸다: 비었으면 100 (서버 기본값과 같음, 1.11.0 per_question 합의)
162
- let passScore = Number.isInteger(app.grading?.pass_score) ? app.grading.pass_score : undefined;
163
161
  // 배점: 저장된 grading.scores가 원본 (정규식의 문제 id로 맞춰 지금 순서로). 맞추지 못하면(문제를 더하거나 지움) 자동 배점.
164
162
  // 자동 · 직접은 공개 값 pointsMode, 없으면(1.7.x에 저장했거나 직접 쓴 settings) 저장된 배점이 자동 배점 값과 같을 때만 자동.
165
163
  // 1.7.x가 똑같이 나눠 저장한 33 · 33 · 34는 직접 배점으로 열어 고치지 않으면 그대로 저장된다
@@ -1218,7 +1216,6 @@ function render() {
1218
1216
  const cards = draft.questions.map(questionCard);
1219
1217
  root.replaceChildren(
1220
1218
  // 부분 채점 설정은 문제가 2개 이상일 때만 맨 위에.
1221
- // 통과 점수 칸은 두지 않는다 (연주님 1.11.1 수정본): 새 퀴즈는 pass_score 100, 예전에 저장한 값은 그대로 저장된다
1222
1219
  ...(scoreBox ? [scoreBox] : []),
1223
1220
  // 저장된 정답을 못 읽었을 때만 맨 위에 경고
1224
1221
  ...(unreadable ? [templates.answersIntro({ text: a.unreadable })] : []),
@@ -1350,7 +1347,7 @@ function partialGrading(questions) {
1350
1347
  /**
1351
1348
  * per_question 채점 설정 (AI 채점 문제가 있음, 1.11.0 · 서버 #65): 정규식 문제는 partial_pattern과 같은 문항별 정답 정규식과 검증
1352
1349
  * (길이 · 공통 검사 · 왕복 · 오답), AI 채점 문제는 채점 기준 글과 문제 글(질문 + 지문, 2,000자까지). 배점은 문제 카드 머리
1353
- * (문제가 하나면 100). 통과 점수는 늘 보낸다 (비우면 100)
1350
+ * (문제가 하나면 100). 통과 점수(pass_score)는 보내지 않는다 (1.12.0, 서버 기본값 100)
1354
1351
  */
1355
1352
  function perQuestionGrading(questions) {
1356
1353
  const base = sampleAnswers(questions);
@@ -1386,13 +1383,7 @@ function perQuestionGrading(questions) {
1386
1383
  : checkRegexTests(questions);
1387
1384
  if (keyProblem) return problemAt(keyProblem, { answer: true });
1388
1385
  const scores = questions.length > 1 ? questions.map((q) => q.points) : [100];
1389
- const grading = buildPerQuestionGrading(
1390
- questions,
1391
- answers,
1392
- scores,
1393
- ANSWER_FORMAT,
1394
- passScore ?? 100,
1395
- );
1386
+ const grading = buildPerQuestionGrading(questions, answers, scores, ANSWER_FORMAT);
1396
1387
  const problem = validatePerQuestionGrading(grading, ANSWER_KEY_MAX);
1397
1388
  if (!problem) return grading;
1398
1389
  const limit = {
@@ -1416,7 +1407,6 @@ root.classList.add("qz-enter");
1416
1407
  save = app.useSave({
1417
1408
  label: t.done,
1418
1409
  // partial_pattern이면 학생 화면이 답을 문항별 배열로 내도록 공개 값 gradingType과 배점 표시(pointsMode · points)를 같이 저장 (정답은 아님).
1419
- // per_question이면 통과 점수도 공개 값 passScore로 (학생 화면의 "통과" 표시, 정답은 아님)
1420
1410
  getContent: () => {
1421
1411
  const content = structuredClone(draft);
1422
1412
  const images = usedImages();
@@ -1434,13 +1424,12 @@ save = app.useSave({
1434
1424
  else delete q.answerMode;
1435
1425
  }
1436
1426
  // AI 채점 문제가 있으면 per_question: 학생 화면이 답을 배열로(AI 채점 문제는 답 글만) 내도록 공개 값 gradingType,
1437
- // 답 형식 3(1.10 편집 화면은 정답을 저장하지 않음)과 이 형식을 읽는 템플릿 버전(requires 1.11.0), 통과 점수를 둔다.
1427
+ // 답 형식 3(1.10 편집 화면은 정답을 저장하지 않음)과 이 형식을 읽는 템플릿 버전(requires 1.11.0)을 둔다.
1438
1428
  // 문제가 하나면 배점 표시 없이 100점
1439
1429
  if (perQuestionActive() && !futureFormat) {
1440
1430
  content.gradingType = PER_QUESTION;
1441
1431
  content.answerFormat = ANSWER_FORMAT_PER_QUESTION;
1442
1432
  content.requires = { ...(content.requires ?? {}), ...REQUIRES_PER_QUESTION };
1443
- content.passScore = passScore ?? 100;
1444
1433
  if (content.questions.length < 2) {
1445
1434
  delete content.pointsMode;
1446
1435
  for (const q of content.questions) delete q.points;
@@ -1451,7 +1440,8 @@ save = app.useSave({
1451
1440
  delete content.pointsMode;
1452
1441
  for (const q of content.questions) delete q.points;
1453
1442
  }
1454
- if (!perQuestionActive() && !futureFormat) delete content.passScore;
1443
+ // 통과 점수는 없앴다 (1.12.0): 1.11.x가 저장한 공개 값 passScore는 지운다 (grading의 pass_score도 다시 만들어 빠짐)
1444
+ if (!futureFormat) delete content.passScore;
1455
1445
  return content;
1456
1446
  },
1457
1447
  validate: (content) => {
@@ -1,8 +1,10 @@
1
1
  // 학생 화면. 화면 머리와 문항을 놓고, 답을 모으고 채우는 방법만 키트에 알려 줍니다.
2
2
  // 튜터링 잠금 · 미리보기 안내 · 답 복원 · 점수와 오류 표시는 키트(useSubmit)가 합니다.
3
+ // 제출 전에 풀던 답은 보는 사람의 저장 칸(kvstore 'quiz.draft')에 자동 저장하고 다시 열면 채웁니다 (core/draft.js).
3
4
  // 모양은 ui/(templates · texts · theme.css), 동작은 core/에 있습니다.
4
5
  import { start } from '../lib/elice-content.js';
5
6
  import { renderQuestion } from '../core/behaviors.js';
7
+ import { createDraftSaver, DRAFT_KEY, readDraft } from '../core/draft.js';
6
8
  import {
7
9
  ASSET_FILLED_EVENT,
8
10
  ASSET_TIMEOUT_MS,
@@ -24,7 +26,7 @@ import {
24
26
  splitAnswers,
25
27
  } from '../core/model.js';
26
28
  import { labels, templates } from '../ui/templates/index.js';
27
- import { aiGrading, aiScore, loading, partialScore, passedScore, someWrong } from '../ui/templates/page.js';
29
+ import { aiGrading, aiScore, loading, partialScore, someWrong } from '../ui/templates/page.js';
28
30
  import { texts } from '../ui/texts.js';
29
31
 
30
32
  const root = document.getElementById('app');
@@ -97,11 +99,6 @@ function show() {
97
99
  // (["q1=b", "q2=weight", "과적합은 …"]). 개발 중 제안 items로 저장한 draft도 같은 모양
98
100
  const perQuestion = isPerQuestionType(app.content.gradingType);
99
101
  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;
105
102
  // 주관식 답 형식 (ADR 0013): 편집 화면 1.10.0부터 settings answerFormat 2(원문), 없으면 옛 자료라 encodeURIComponent.
106
103
  // 정답 정규식이 같은 형식으로 저장돼 있어 늘 짝이 맞는다. 더 새 형식(3 이상)은 2로 보낸다
107
104
  const format = answerFormatOf(app.content);
@@ -155,7 +152,7 @@ function show() {
155
152
  // 키트 점수 줄(정답 · 오답)은 감추고 문제 카드의 정답 · 오답과 제출 바 위 상자(.qz-overall)로 알린다 (styles.css, 연주님 디자인).
156
153
  // pattern: 여러 문제 중 틀린 것이 있으면 한 줄 (어느 문제인지는 pattern이 알려 주지 않음).
157
154
  // partial_pattern: 100점보다 낮으면 점수 · "아쉬워요!" · 마스코트 상자, 100점이면 상자 없음.
158
- // per_question: 통과 점수 이상이면(완료) "통과했어요!", 아래면 "아쉬워요!"
155
+ // per_question: partial_pattern과 같음 (통과 점수 없음, 1.12.0)
159
156
  const overall = someWrong();
160
157
  const wrongText = overall.textContent;
161
158
  const hideOverall = () => {
@@ -206,12 +203,10 @@ function show() {
206
203
  const waiting = aiGrading();
207
204
  const showScore = (score) => {
208
205
  if (score >= 100) return hideOverall();
209
- // per_question은 통과 점수 이상이면 완료 (서버 pass_score). 100점이 아니어도 "통과"
210
- overall.replaceChildren(
211
- perQuestion && score >= passScore ? passedScore({ score, pass: passScore }) : partialScore({ score }),
212
- );
206
+ // 통과 점수는 없다 (1.12.0): per_question도 100점보다 낮으면 늘 "아쉬워요!" (1.11.x 공개 값 passScore는 무시)
207
+ overall.replaceChildren(partialScore({ score }));
213
208
  overall.classList.add('qz-overall-mascot');
214
- overall.dataset.result = perQuestion && score >= passScore ? 'passed' : 'partial';
209
+ overall.dataset.result = 'partial';
215
210
  overall.hidden = false;
216
211
  };
217
212
  // 답을 실제로 바꾸면 그 문항의 결과 색과 점수 상자를 지운다 (기존 동작). 결과를 보인 때의 답과 지금 답을 비교해서,
@@ -238,9 +233,29 @@ function show() {
238
233
  hideOverall();
239
234
  });
240
235
  }
236
+ // 풀던 답 자동 저장 (제출 전, 1.12.0): 학생(과 학습 페이지에서 풀어 보는 교육자)만. 튜터링은 보기 전용이라 읽지도 쓰지도 않고,
237
+ // 편집기 미리보기(isDraft)는 기록하지 않는 화면이라 쓰지 않는다. 한 번이라도 제출했으면(지난 제출 기록 · 이 화면에서 제출)
238
+ // 제출한 답이 먼저라 풀던 답을 지우고 더 저장하지 않는다 (키트가 마지막 제출의 답을 채움)
239
+ const canDraft = !app.readOnly && !app.isDraft && questions.length > 0;
240
+ const draft = canDraft
241
+ ? createDraftSaver({
242
+ kvstore: app.kvstore,
243
+ questions,
244
+ getValues: () => views.map((v) => v.getValue()),
245
+ })
246
+ : null;
247
+ // 다시 열 때 읽는 값 (제출 기록과 같이 받기 시작). 못 읽으면 빈 화면으로 (조용히)
248
+ const savedDraft = draft
249
+ ? app.kvstore.get({ key: DRAFT_KEY }).catch(() => null)
250
+ : Promise.resolve(null);
251
+ /** 지난 제출이 있는지 (다시 열 때 키트가 마지막 제출을 onResult restored로 알려 줌 · 서버 결과 submitCount) */
252
+ let submittedBefore = Number(app.result?.submitCount) > 0;
253
+ /** 풀던 답을 채웠거나 채울 것이 없다고 정한 뒤에만 저장한다 (그 전 저장이 칸의 풀던 답을 덮지 않게) */
254
+ let draftReady = false;
255
+
241
256
  // 제출 직후 받은 결과를 고칠 수 있게 몇 번째 결과인지 센다 (늦게 온 제출 기록이 그 뒤 결과를 덮지 않게)
242
257
  let resultSeq = 0;
243
- app.useSubmit({
258
+ const { restored } = app.useSubmit({
244
259
  label: texts.learn.submit,
245
260
  // 제출하면 결과(점수 상자 · 제출 바)가 있는 맨 아래로 (성공 · 실패 모두, 단건 · 여러 문항 · pattern · partial_pattern 같음)
246
261
  scrollOnResult: 'bottom',
@@ -263,6 +278,9 @@ function show() {
263
278
  // AI 채점 문제는 정답 · 오답 대신 "AI 채점 결과 받은 점수 / 배점" (서버 question_results)
264
279
  onResult: (res, { restored }) => {
265
280
  const seq = ++resultSeq;
281
+ // 제출했음 (다시 열었을 때 지난 제출 · 방금 제출): 풀던 답은 지우고 더 저장하지 않는다
282
+ submittedBefore = true;
283
+ void draft?.stop();
266
284
  markShown();
267
285
  const single = views.length === 1;
268
286
  const marks = correctnessOf(res);
@@ -307,6 +325,37 @@ function show() {
307
325
  }).observe(button, { attributes: true, attributeFilter: ['aria-busy'] });
308
326
  }
309
327
 
328
+ if (draft) {
329
+ // 처음 그린 답(빈 답)을 기준으로 두고, 제출 기록을 받은 뒤 제출한 적이 없으면 풀던 답을 채운다.
330
+ // 그 사이 학생이 이미 답을 고쳤으면 덮지 않는다 (고친 답이 새 풀던 답이 됨)
331
+ draft.baseline();
332
+ const blank = JSON.stringify(views.map((v) => v.getValue() ?? null));
333
+ void Promise.all([restored, savedDraft]).then(([, saved]) => {
334
+ if (saved) draft.markStored();
335
+ if (submittedBefore || draft.stopped) return void draft.stop();
336
+ const values = readDraft(questions, saved);
337
+ if (values && JSON.stringify(views.map((v) => v.getValue() ?? null)) === blank) {
338
+ values.forEach((value, i) => {
339
+ if (value !== undefined) views[i].setValue(value);
340
+ });
341
+ draft.baseline();
342
+ }
343
+ draftReady = true;
344
+ draft.changed();
345
+ });
346
+ const onChange = () => {
347
+ if (draftReady) draft.changed();
348
+ };
349
+ for (const type of ['input', 'change', 'click', 'pointerup', 'keyup', 'drop'])
350
+ document.addEventListener(type, () => setTimeout(onChange, 0), true);
351
+ // 창을 닫거나 숨길 때: 기다리는 저장이 있으면 바로
352
+ const flushDraft = () => void draft.flush();
353
+ addEventListener('pagehide', flushDraft);
354
+ document.addEventListener('visibilitychange', () => {
355
+ if (document.visibilityState === 'hidden') flushDraft();
356
+ });
357
+ }
358
+
310
359
  // 문서까지 올라온 이벤트는 답이 바뀐 뒤라 바로, 올라오지 않거나(보기 칩은 거품을 막음) 뒤에 바뀌는 답(끌어 놓기)은 이벤트가 끝난 뒤 한 번 더
311
360
  for (const type of ['input', 'change', 'click', 'pointerup', 'keyup', 'drop']) {
312
361
  document.addEventListener(type, clearChanged);
@@ -1472,16 +1472,13 @@ textarea.qe-group-name {
1472
1472
  margin-left: auto;
1473
1473
  }
1474
1474
  }
1475
- /* 학생: 100점보다 낮을 때 제출 바 위 상자 — 점수 · "아쉬워요!" · 안내, 오른쪽 아래 마스코트(위로 조금 넘침).
1476
- per_question이 통과 점수 이상(passed, "통과했어요!")이면 같은 모양 */
1477
- .qz-result[data-result='partial'],
1478
- .qz-result[data-result='passed'] {
1475
+ /* 학생: 100점보다 낮을 때 제출 바 위 상자 — 점수 · "아쉬워요!" · 안내, 오른쪽 아래 마스코트(위로 조금 넘침) */
1476
+ .qz-result[data-result='partial'] {
1479
1477
  border: 0;
1480
1478
  background: color-mix(in srgb, var(--eds-primary-main) 8%, var(--eds-background-paper, #fff));
1481
1479
  color: var(--eds-primary-dark, var(--eds-primary-main));
1482
1480
  }
1483
- .qz-result[data-result='partial']::before,
1484
- .qz-result[data-result='passed']::before {
1481
+ .qz-result[data-result='partial']::before {
1485
1482
  display: none;
1486
1483
  }
1487
1484
  .qz-overall.qz-overall-mascot {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quiz",
3
- "version": "1.11.4",
3
+ "version": "1.12.0",
4
4
  "title": "퀴즈",
5
5
  "description": "문항을 만들고 답안 형식을 고릅니다",
6
6
  "catalog": {
@@ -24,7 +24,7 @@ export const someWrong = () => html`
24
24
  `;
25
25
 
26
26
  /**
27
- * 부분 점수(partial_pattern)가 100점보다 낮을 때 결과 상자 안 (위 한 줄과 같은 .qz-overall 자리에 넣음, 연주님 부분 채점 UI):
27
+ * 부분 점수(partial_pattern · per_question)가 100점보다 낮을 때 결과 상자 안 (위 한 줄과 같은 .qz-overall 자리에 넣음, 연주님 부분 채점 UI):
28
28
  * 점수 · "아쉬워요!" · 안내 · 오른쪽 아래 마스코트. 100점이면 상자를 숨긴다 (만점 축하는 LXP 화면이 맡음)
29
29
  * 마스코트 그림은 public/img/mascot-half.webp (실행 중 문자열 경로로 받는 파일이라 public/, zip에는 img/mascot-half.webp. 장식이라 alt 없음)
30
30
  */
@@ -37,19 +37,6 @@ export const partialScore = ({ score }) => html`
37
37
  <img class="qz-overall-img" src="img/mascot-half.webp" alt="" />
38
38
  `;
39
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
40
  /**
54
41
  * AI 채점 문제 카드의 결과 줄 안 "AI 채점 결과 20 / 35점" (연주님 디자인: 점수는 .qz-ai-score 굵게, "/ 35점"은 .qz-ai-max).
55
42
  * 결과 줄은 아이콘과 글을 띄워 놓는 flex 줄이라 글 조각을 한 덩어리(span)로 묶는다. suffix: 뒤에 붙일 글 (로컬 흉내 점수 표시)
@@ -105,7 +105,6 @@ export const texts = {
105
105
  rubricCount: max => `AI 채점 문제는 ${max}개까지 둘 수 있습니다.`,
106
106
  kind: () => '채점 항목 모양이 올바르지 않습니다.',
107
107
  total: () => '배점 합계는 100점 이상이어야 합니다.',
108
- passScore: () => '통과 점수는 1부터 100 사이의 정수입니다.',
109
108
  },
110
109
  // 주관식 정규식 (core/model.js compileTextRegex의 error 코드). 서버(Python)와 브라우저가 다르게 읽는 문법은 막는다
111
110
  badTextRegex: '정답 정규식이 올바르지 않습니다.',
@@ -146,13 +145,10 @@ export const texts = {
146
145
  submit: '제출하기',
147
146
  // 모두 맞혀야 100점(pattern)인 여러 문제 퀴즈에서 틀린 것이 있을 때 제출 바 위 한 줄 (점수 줄은 감춤)
148
147
  someWrong: '틀린 문제가 있습니다. 다시 한번 풀어보세요.',
149
- // 부분 점수(partial_pattern)가 100점보다 낮을 때 제출 바 위 결과 상자 (점수 · 제목 · 안내 · 마스코트). 100점이면 상자 없음
148
+ // 부분 점수(partial_pattern · per_question)가 100점보다 낮을 때 제출 바 위 결과 상자 (점수 · 제목 · 안내 · 마스코트). 100점이면 상자 없음
150
149
  scoreUnit: '점',
151
150
  scoreTitle: '아쉬워요!',
152
151
  scoreSub: '틀린 문제를 다시 풀어 보세요.',
153
- // per_question 퀴즈가 통과 점수(pass_score) 이상이지만 100점이 아닐 때 결과 상자 (점수 · 제목 · 안내 · 마스코트, 같은 자리)
154
- passTitle: '통과했어요!',
155
- passSub: pass => `통과 점수 ${pass}점을 넘었어요. 다시 풀어 점수를 올릴 수도 있어요.`,
156
152
  // AI 채점 문항이 있는 퀴즈 (per_question): 제출하고 결과를 기다리는 동안 제출 바 위 (AI 채점은 30초까지 걸릴 수 있음)
157
153
  grading: 'AI가 채점하고 있어요',
158
154
  gradingSub: '잠시만 기다려 주세요. 30초까지 걸릴 수 있습니다.',