@eliceio/cdk-cli 1.2.1 → 1.3.0-contenttypes.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -50
- package/es/cli.js +11 -2
- package/es/commands/build/index.js +12 -0
- package/es/commands/create/index.js +1 -0
- package/es/commands/create/scaffold.d.ts +2 -2
- package/es/commands/create/scaffold.js +3 -3
- package/es/commands/dev/index.d.ts +10 -1
- package/es/commands/dev/index.js +47 -7
- package/es/core/config.d.ts +20 -9
- package/es/core/config.js +53 -12
- package/es/core/project-check.d.ts +3 -2
- package/es/core/project-check.js +14 -3
- package/es/core/regex.d.ts +11 -0
- package/es/core/regex.js +41 -0
- package/es/core/sandbox.d.ts +26 -0
- package/es/core/sandbox.js +240 -30
- package/es/dev/check.d.ts +30 -0
- package/es/dev/check.js +224 -34
- package/es/dev/grading.d.ts +20 -1
- package/es/dev/grading.js +38 -7
- package/es/dev/host-page.js +1 -1
- package/es/dev/mock-api.d.ts +3 -1
- package/es/dev/mock-api.js +20 -11
- package/es/engines/vite/index.js +1 -1
- package/es/engines/vite/plugin.d.ts +2 -0
- package/es/engines/vite/plugin.js +33 -5
- package/es/rules/answers.d.ts +13 -0
- package/es/rules/answers.js +94 -0
- package/es/rules/check.js +70 -1
- package/es/rules/index.d.ts +1 -0
- package/es/rules/index.js +1 -0
- package/es/rules/size.d.ts +31 -0
- package/es/rules/size.js +58 -0
- package/es/rules/types.d.ts +12 -0
- package/es/rules.json.js +2 -2
- package/package.json +2 -2
- package/rules.json +32 -3
- package/skills/_shared/always.md +3 -3
- package/skills/_shared/references/00-what-the-person-decides.md +1 -1
- package/skills/_shared/references/02-design-the-material.md +10 -7
- package/skills/_shared/references/03-create-the-project.md +2 -1
- package/skills/_shared/references/05-screen-code.md +49 -22
- package/skills/_shared/references/06-using-the-quiz-template.md +7 -6
- package/skills/_shared/references/08-fix-check-errors.md +23 -22
- package/skills/_shared/references/09-check.md +7 -6
- package/skills/_shared/references/12-upload-with-the-material-mcp.md +13 -13
- package/skills/_shared/references/13-edit-screen-design.md +122 -0
- package/skills/_shared/references/14-layouts.md +96 -0
- package/skills/elice-content-check/SKILL.md +2 -2
- package/skills/elice-content-create/SKILL.md +1 -1
- package/skills/elice-content-migrate/SKILL.md +1 -1
- package/templates/_shared/lib/cdk-mock.d.ts +30 -3
- package/templates/_shared/lib/cdk-mock.js +88 -15
- package/templates/_shared/lib/elice-content-editor.js +89 -58
- package/templates/_shared/lib/elice-content.css +1313 -126
- package/templates/_shared/lib/elice-content.d.ts +162 -23
- package/templates/_shared/lib/elice-content.js +863 -82
- package/templates/_shared/lib/icons/empty-content.d.ts +2 -0
- package/templates/_shared/lib/icons/empty-content.js +11 -0
- package/templates/_shared/lib/icons/file-video.d.ts +2 -0
- package/templates/_shared/lib/icons/file-video.js +11 -0
- package/templates/_shared/lib/icons/file.d.ts +2 -0
- package/templates/_shared/lib/icons/file.js +11 -0
- package/templates/blank/README.md +5 -3
- package/templates/blank/edit.html +8 -2
- package/templates/blank/index.html +6 -1
- package/templates/blank/instructor.html +6 -1
- package/templates/blank/template.json +1 -1
- package/templates/quiz/README.md +28 -12
- package/templates/quiz/core/behaviors.d.ts +13 -7
- package/templates/quiz/core/behaviors.js +36 -51
- package/templates/quiz/core/editor.d.ts +10 -0
- package/templates/quiz/core/editor.js +334 -8
- package/templates/quiz/core/markdown.d.ts +4 -0
- package/templates/quiz/core/markdown.js +65 -11
- package/templates/quiz/core/model.d.ts +34 -1
- package/templates/quiz/core/model.js +86 -5
- package/templates/quiz/core/rich-text.d.ts +19 -0
- package/templates/quiz/core/rich-text.js +521 -0
- package/templates/quiz/edit.html +12 -3
- package/templates/quiz/index.html +12 -3
- package/templates/quiz/screens/edit.js +217 -48
- package/templates/quiz/screens/learn.js +90 -14
- package/templates/quiz/styles.css +840 -678
- package/templates/quiz/template.json +9 -2
- package/templates/quiz/ui/templates/edit.d.ts +18 -5
- package/templates/quiz/ui/templates/edit.js +309 -71
- package/templates/quiz/ui/templates/group.js +19 -8
- package/templates/quiz/ui/templates/order.js +25 -24
- package/templates/quiz/ui/templates/page.js +19 -8
- package/templates/quiz/ui/templates/question.js +2 -2
- package/templates/quiz/ui/texts.js +72 -25
- package/templates/quiz/ui/theme.css +8 -9
- package/templates/steps/README.md +77 -0
- package/templates/steps/commentary.txt +7 -0
- package/templates/steps/edit.html +21 -0
- package/templates/steps/gitignore +4 -0
- package/templates/steps/index.html +69 -0
- package/templates/steps/metadata.json +9 -0
- package/templates/steps/package.json +13 -0
- package/templates/steps/screens/edit.js +32 -0
- package/templates/steps/screens/learn.js +108 -0
- package/templates/steps/styles.css +54 -0
- package/templates/steps/template.json +6 -0
package/templates/quiz/edit.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
-
<!-- 제목 ·
|
|
6
|
+
<!-- 제목 · 불러오는 동안 화면 읽기 문구는 ui/texts.js(page)에서 고칩니다. #app 안은 스크립트가 돌기 전 자리로, ui/templates/page.js loading()과 같은 퀴즈 모양 (질문 막대 + 보기 막대 넷) -->
|
|
7
7
|
<title>내용 편집</title>
|
|
8
8
|
<link rel="stylesheet" href="lib/elice-tokens.css" />
|
|
9
9
|
<link rel="stylesheet" href="lib/elice-content.css" />
|
|
@@ -11,7 +11,16 @@
|
|
|
11
11
|
<link rel="stylesheet" href="styles.css" />
|
|
12
12
|
<script type="module" src="screens/edit.js"></script>
|
|
13
13
|
</head>
|
|
14
|
-
<body>
|
|
15
|
-
<main id="app"
|
|
14
|
+
<body class="ec-edit-page">
|
|
15
|
+
<main id="app">
|
|
16
|
+
<div class="qz-skeleton" role="status">
|
|
17
|
+
<span class="ec-visually-hidden">불러오는 중…</span>
|
|
18
|
+
<span class="qz-sk qz-sk-title"></span>
|
|
19
|
+
<span class="qz-sk qz-sk-option"></span>
|
|
20
|
+
<span class="qz-sk qz-sk-option"></span>
|
|
21
|
+
<span class="qz-sk qz-sk-option"></span>
|
|
22
|
+
<span class="qz-sk qz-sk-option"></span>
|
|
23
|
+
</div>
|
|
24
|
+
</main>
|
|
16
25
|
</body>
|
|
17
26
|
</html>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
-
<!-- 제목 ·
|
|
6
|
+
<!-- 제목 · 불러오는 동안 화면 읽기 문구는 ui/texts.js(page)에서 고칩니다. #app 안은 스크립트가 돌기 전 자리로, ui/templates/page.js loading()과 같은 퀴즈 모양 (질문 막대 + 보기 막대 넷) -->
|
|
7
7
|
<title>학생 화면</title>
|
|
8
8
|
<link rel="stylesheet" href="lib/elice-tokens.css" />
|
|
9
9
|
<link rel="stylesheet" href="lib/elice-content.css" />
|
|
@@ -11,7 +11,16 @@
|
|
|
11
11
|
<link rel="stylesheet" href="styles.css" />
|
|
12
12
|
<script type="module" src="screens/learn.js"></script>
|
|
13
13
|
</head>
|
|
14
|
-
<body>
|
|
15
|
-
<main id="app"
|
|
14
|
+
<body class="qz-page">
|
|
15
|
+
<main id="app">
|
|
16
|
+
<div class="qz-skeleton" role="status">
|
|
17
|
+
<span class="ec-visually-hidden">불러오는 중…</span>
|
|
18
|
+
<span class="qz-sk qz-sk-title"></span>
|
|
19
|
+
<span class="qz-sk qz-sk-option"></span>
|
|
20
|
+
<span class="qz-sk qz-sk-option"></span>
|
|
21
|
+
<span class="qz-sk qz-sk-option"></span>
|
|
22
|
+
<span class="qz-sk qz-sk-option"></span>
|
|
23
|
+
</div>
|
|
24
|
+
</main>
|
|
16
25
|
</body>
|
|
17
26
|
</html>
|
|
@@ -1,28 +1,44 @@
|
|
|
1
1
|
// 내용 편집 화면(CMS). 기존 퀴즈 편집 폼을 옮김 (docs/quiz-spec.md §3). 저장 버튼 · 변경 표시는 키트(useSave)가 합니다.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// 완료 정책은 LXP 자료 편집 화면의 '설정'에서 교육자가 고릅니다 (ADR 0012). 문항 카드마다 정답을 고르고 (단일 · 복수 · 그룹은 보기 줄에서
|
|
3
|
+
// 바로, 순서 · 주관식은 아래 "정답"에서), 저장할 때 고른 답으로 정답 정규식을 만들어 검증한 뒤 settings.grading에 함께 저장합니다.
|
|
4
|
+
// 채점 방식은 저장된 것을 그대로 씁니다 (작성자가 정함, 새 퀴즈는 pattern):
|
|
5
|
+
// - pattern: 정답 정규식 하나 (모두 맞혀야 100점)
|
|
6
|
+
// - partial_pattern: 문항마다 정규식 + 점수 (맞은 문항 점수의 합). 점수는 이 화면에서 고치지 않는다: 문항 수가 같으면 저장된 점수,
|
|
7
|
+
// 바뀌었으면 똑같이 나눈 점수로 저장하고 짧게 알린다. 학생 화면이 답을 배열로 내도록 settings에 gradingType도 같이 저장
|
|
4
8
|
// 문제 내용(content)은 학생에게도 내려가므로 정답을 넣지 않습니다 (정답은 grading에만, 서버가 학생에게 내려주지 않음).
|
|
5
9
|
// 여기서는 어떤 칸을 어떤 순서로 놓을지만 정합니다. 모양은 ui/(templates/edit.js · texts · theme.css), 동작은 core/.
|
|
6
10
|
import {
|
|
7
11
|
ANSWER_KEY_MAX,
|
|
12
|
+
showSnackbar as showNotice,
|
|
13
|
+
splitScores,
|
|
8
14
|
start,
|
|
9
15
|
validateAnswerRegex,
|
|
16
|
+
validatePartialGrading,
|
|
10
17
|
} from "../lib/elice-content.js";
|
|
11
18
|
import { renderAnswerBody } from "../core/behaviors.js";
|
|
12
19
|
import { createEditor } from "../core/editor.js";
|
|
20
|
+
import { setImages } from "../core/markdown.js";
|
|
21
|
+
import { compressImage } from "../core/rich-text.js";
|
|
13
22
|
import {
|
|
14
23
|
buildAnswerKey,
|
|
24
|
+
buildAnswerKeys,
|
|
15
25
|
canAddQuestion,
|
|
16
26
|
checkAnswerKey,
|
|
27
|
+
checkAnswerKeys,
|
|
28
|
+
gradingTypeOf,
|
|
17
29
|
INLINE_ANSWER_TYPES,
|
|
18
30
|
isAnswered,
|
|
31
|
+
joinAnswerList,
|
|
19
32
|
joinAnswers,
|
|
20
33
|
LIMITS,
|
|
21
34
|
newQuestion,
|
|
22
35
|
nextId,
|
|
23
36
|
optionAnswer,
|
|
37
|
+
PARTIAL,
|
|
24
38
|
parseAnswerKey,
|
|
39
|
+
parseAnswerKeys,
|
|
25
40
|
pruneAnswer,
|
|
41
|
+
scoresFor,
|
|
26
42
|
validateAnswerKey,
|
|
27
43
|
validateQuiz,
|
|
28
44
|
withOptionAnswer,
|
|
@@ -40,14 +56,70 @@ root.replaceChildren(loading());
|
|
|
40
56
|
const app = await start({ screen: "edit" });
|
|
41
57
|
const draft = structuredClone(app.content);
|
|
42
58
|
draft.questions ??= [];
|
|
59
|
+
// 지문 · 해설에 올린 그림 (아이디 → data: 주소). 글에는 만 두고 그림은 내용 images에 (학생 화면도 같이 받음)
|
|
60
|
+
setImages(draft.images);
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* 지문 · 해설에 그림 올리기 (서식 도구의 그림 버튼, 연주님 최종 수정본). 그림은 줄여서 settings 내용(images)에 data: 주소로
|
|
64
|
+
* 저장한다 (한 장 40만 자 · 모두 합쳐 270만 자, 약 2MB). 끄면(false) 버튼이 숨고, 이미 저장된 그림은 그대로 보이고 지울 수 있다
|
|
65
|
+
* 지금은 끔: 서버 settings 한도가 약 64KB라 사진 한 장도 저장되지 않는다(2026-11-17 실측). 서버 /storage/upload-url이
|
|
66
|
+
* 이미지를 받고 SDK assets가 이미지를 올릴 수 있게 되면 파일 업로드 방식으로 바꿔 다시 켠다
|
|
67
|
+
*/
|
|
68
|
+
const IMAGE_UPLOAD = false;
|
|
69
|
+
const imageErrors = {
|
|
70
|
+
"not-image": t.md.imageNotImage,
|
|
71
|
+
unreadable: t.md.imageUnreadable,
|
|
72
|
+
"too-big": t.md.imageTooBig,
|
|
73
|
+
total: t.md.imageTotal,
|
|
74
|
+
};
|
|
75
|
+
/** 그림 올리기: 파일을 줄여 images에 넣고 아이디를 돌려준다. 실패는 알림으로 */
|
|
76
|
+
const imageUpload = IMAGE_UPLOAD
|
|
77
|
+
? {
|
|
78
|
+
async add(file) {
|
|
79
|
+
const url = await compressImage(file, LIMITS.imageChars);
|
|
80
|
+
const images = (draft.images ??= {});
|
|
81
|
+
const total = Object.values(images).reduce((sum, v) => sum + v.length, 0);
|
|
82
|
+
if (total + url.length > LIMITS.imagesTotalChars)
|
|
83
|
+
throw Object.assign(new Error("total"), { code: "total" });
|
|
84
|
+
const id = nextId(Object.keys(images), "i");
|
|
85
|
+
images[id] = url;
|
|
86
|
+
setImages(images);
|
|
87
|
+
return id;
|
|
88
|
+
},
|
|
89
|
+
fail: (error) => showSnackbar(imageErrors[error.code] ?? t.md.imageUnreadable),
|
|
90
|
+
}
|
|
91
|
+
: undefined;
|
|
92
|
+
/** 글 칸 사이 그림 칸: 지우면 되돌리기 알림 */
|
|
93
|
+
const imageBlocks = {
|
|
94
|
+
removeLabel: t.md.imageRemove,
|
|
95
|
+
onRemoved: (undo) => showSnackbar(t.md.imageDeleted, undo),
|
|
96
|
+
};
|
|
97
|
+
/** 글에서 쓰는 그림만 (지운 그림은 저장하지 않음) */
|
|
98
|
+
function usedImages() {
|
|
99
|
+
const text = draft.questions
|
|
100
|
+
.flatMap((q) => [q.description, q.explanation?.text])
|
|
101
|
+
.filter(Boolean)
|
|
102
|
+
.join("\n");
|
|
103
|
+
const used = new Set([...text.matchAll(/\(image:([\w-]+)\)/g)].map((m) => m[1]));
|
|
104
|
+
const kept = Object.fromEntries(Object.entries(draft.images ?? {}).filter(([id]) => used.has(id)));
|
|
105
|
+
return Object.keys(kept).length ? kept : undefined;
|
|
106
|
+
}
|
|
43
107
|
// 처음 열면 문항 1이 이미 있는 상태로 시작한다
|
|
44
108
|
const startedEmpty = draft.questions.length === 0;
|
|
45
109
|
if (startedEmpty)
|
|
46
110
|
draft.questions.push(newQuestion("select_one", [], texts.defaults));
|
|
47
111
|
|
|
48
|
-
//
|
|
49
|
-
const
|
|
50
|
-
|
|
112
|
+
// 채점 방식: 저장된 settings.grading.type (없으면 settings.gradingType, 그것도 없으면 pattern). 이 화면은 바꾸지 않는다
|
|
113
|
+
const gradingType = gradingTypeOf(app.content, app.grading);
|
|
114
|
+
|
|
115
|
+
// 문항 id → 정답(화면 값: 선택 id · id 목록 · 그룹별 목록, 주관식은 허용 답 목록). 저장된 정규식(partial_pattern은 문항별 배열)을 읽어 채운다
|
|
116
|
+
const rawKey = app.grading?.answer_key;
|
|
117
|
+
const savedKey = Array.isArray(rawKey) && rawKey.length === 0 ? null : rawKey;
|
|
118
|
+
const parsed = Array.isArray(savedKey)
|
|
119
|
+
? parseAnswerKeys(draft.questions, savedKey)
|
|
120
|
+
: savedKey
|
|
121
|
+
? parseAnswerKey(draft.questions, savedKey)
|
|
122
|
+
: {};
|
|
51
123
|
/** @type {Record<string, unknown>} */
|
|
52
124
|
const answers = parsed ?? {};
|
|
53
125
|
/** 새 문항의 기본 정답: 첫 번째 보기 하나 (단일 · 복수 선택만, 나머지 유형은 직접 고른다) */
|
|
@@ -193,9 +265,11 @@ function groupBoard(q, shuffle) {
|
|
|
193
265
|
o.text = input.value;
|
|
194
266
|
});
|
|
195
267
|
row.querySelector('[data-role="delete"]').addEventListener("click", () => {
|
|
268
|
+
const undo = restorer(q, true);
|
|
196
269
|
q.options.splice(q.options.indexOf(o), 1);
|
|
197
270
|
answers[q.id] = pruneAnswer(q, answers[q.id] ?? {});
|
|
198
271
|
render();
|
|
272
|
+
if (o.text.trim()) showSnackbar(t.optionDeleted, () => (undo(), render()));
|
|
199
273
|
});
|
|
200
274
|
const handle = row.querySelector('[data-role="handle"]');
|
|
201
275
|
handle.dataset.optionHandle = o.id;
|
|
@@ -267,7 +341,8 @@ function groupBoard(q, shuffle) {
|
|
|
267
341
|
|
|
268
342
|
/**
|
|
269
343
|
* 오답 보기 영역 (그룹 분류 · 순서 맞추기 공통): 보기가 있거나 열어 둔 문항이면 점선 상자, 아니면 "오답 보기 추가 +" 버튼.
|
|
270
|
-
* 머리줄의 ✕로 상자를 닫으면 안의 오답 보기도 함께 지운다 (있었다면 되돌리기 알림)
|
|
344
|
+
* 머리줄의 ✕로 상자를 닫으면 안의 오답 보기도 함께 지운다 (있었다면 되돌리기 알림).
|
|
345
|
+
* 오답 보기가 하나만 남으면 그 줄의 ✕는 끄고 상자의 ✕로 닫으라고 안내한다 (빈 상자가 남지 않게)
|
|
271
346
|
*/
|
|
272
347
|
function noneArea(q, { items, rowFor, addOption, addButton, fullOptions, hint }) {
|
|
273
348
|
if (items.length) noneOpen.add(q.id);
|
|
@@ -279,8 +354,14 @@ function noneArea(q, { items, rowFor, addOption, addButton, fullOptions, hint })
|
|
|
279
354
|
return none;
|
|
280
355
|
}
|
|
281
356
|
const canClose = q.options.length - items.length >= LIMITS.optionsMin;
|
|
357
|
+
const rows = items.map((o) => rowFor(o));
|
|
358
|
+
if (rows.length === 1) {
|
|
359
|
+
const remove = rows[0].querySelector('[data-role="delete"]');
|
|
360
|
+
remove.disabled = true;
|
|
361
|
+
remove.title = t.noneRowMin;
|
|
362
|
+
}
|
|
282
363
|
const none = templates.noneBox({
|
|
283
|
-
rows
|
|
364
|
+
rows,
|
|
284
365
|
add: addButton(""),
|
|
285
366
|
hint,
|
|
286
367
|
canClose,
|
|
@@ -392,10 +473,12 @@ function orderBoard(q, shuffle) {
|
|
|
392
473
|
o.text = input.value;
|
|
393
474
|
});
|
|
394
475
|
row.querySelector('[data-role="delete"]').addEventListener("click", () => {
|
|
476
|
+
const undo = restorer(q, true);
|
|
395
477
|
q.options.splice(q.options.indexOf(o), 1);
|
|
396
478
|
answers[q.id] = orderIds(q);
|
|
397
479
|
syncSlots(q);
|
|
398
480
|
render();
|
|
481
|
+
if (o.text.trim()) showSnackbar(t.optionDeleted, () => (undo(), render()));
|
|
399
482
|
});
|
|
400
483
|
const handle = row.querySelector('[data-role="handle"]');
|
|
401
484
|
handle.dataset.optionHandle = o.id;
|
|
@@ -459,10 +542,17 @@ function answerField(q) {
|
|
|
459
542
|
if (i === rows.length - 1) rows.push("");
|
|
460
543
|
paint(i + 1);
|
|
461
544
|
});
|
|
545
|
+
// 글이 있던 정답을 지우면 "정답을 삭제했습니다. 되돌리기"
|
|
462
546
|
row.querySelector('[data-role="delete"]').addEventListener("click", () => {
|
|
463
|
-
rows.splice(i, 1);
|
|
547
|
+
const [removed] = rows.splice(i, 1);
|
|
464
548
|
sync();
|
|
465
549
|
paint(Math.min(i, rows.length - 1));
|
|
550
|
+
if (!removed.trim()) return;
|
|
551
|
+
showSnackbar(t.answerDeleted, () => {
|
|
552
|
+
rows.splice(i, 0, removed);
|
|
553
|
+
sync();
|
|
554
|
+
render();
|
|
555
|
+
});
|
|
466
556
|
});
|
|
467
557
|
return row;
|
|
468
558
|
});
|
|
@@ -516,6 +606,24 @@ function inlineAnswer(q) {
|
|
|
516
606
|
};
|
|
517
607
|
}
|
|
518
608
|
|
|
609
|
+
/**
|
|
610
|
+
* 보기를 지우기 전 상태로 되돌리는 함수 (되돌리기 알림). 정답 · 순서 맞추기 칸 수, withOptions면 보기 목록도
|
|
611
|
+
*/
|
|
612
|
+
function restorer(q, withOptions = false) {
|
|
613
|
+
const prev = {
|
|
614
|
+
options: withOptions ? structuredClone(q.options) : undefined,
|
|
615
|
+
answer: structuredClone(answers[q.id]),
|
|
616
|
+
slots: q.slots,
|
|
617
|
+
};
|
|
618
|
+
return () => {
|
|
619
|
+
if (prev.options) q.options = prev.options;
|
|
620
|
+
if (prev.answer === undefined) delete answers[q.id];
|
|
621
|
+
else answers[q.id] = prev.answer;
|
|
622
|
+
if (prev.slots !== undefined) q.slots = prev.slots;
|
|
623
|
+
answerViews.delete(q.id);
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
|
|
519
627
|
/** 보기 목록 옵션: 지우면 정답에서 빼고, 단일 · 복수 · 그룹은 줄마다 정답 칸 */
|
|
520
628
|
function optionsOpts(q) {
|
|
521
629
|
const inline = INLINE_ANSWER_TYPES.includes(q.type);
|
|
@@ -533,6 +641,12 @@ function optionsOpts(q) {
|
|
|
533
641
|
// 다시 그릴 때 지우기 전 칸 값으로 덮지 않게
|
|
534
642
|
answerViews.delete(q.id);
|
|
535
643
|
},
|
|
644
|
+
// 글이 있던 보기를 지우면 "보기를 삭제했습니다. 되돌리기" (정답 · 칸 수도 되돌림)
|
|
645
|
+
snapshot: () => {
|
|
646
|
+
readAnswerViews();
|
|
647
|
+
return restorer(q);
|
|
648
|
+
},
|
|
649
|
+
onRemoved: (undo) => showSnackbar(t.optionDeleted, undo),
|
|
536
650
|
// 순서 맞추기: 보기 글을 고치면 정답 칸의 보기 이름도 바로 바꾼다 (다시 그리면 입력 중 초점을 잃음)
|
|
537
651
|
onInput:
|
|
538
652
|
q.type === 'order'
|
|
@@ -580,16 +694,25 @@ function questionFields(q, i) {
|
|
|
580
694
|
// 문항 설명: 필요할 때만 "설명 추가 +"로 연다. 열리면 해설과 같은 머리줄(아이콘 · 이름 · 지우기). 새 문항에는 키가 없고, 적으면 생긴다
|
|
581
695
|
form.revealable(
|
|
582
696
|
t.addDescription,
|
|
583
|
-
form.
|
|
697
|
+
form.richField(
|
|
584
698
|
t.description,
|
|
585
699
|
q.description ?? "",
|
|
586
700
|
(v) => (q.description = v),
|
|
587
|
-
{
|
|
588
|
-
placeholder: t.descriptionPlaceholder,
|
|
589
|
-
multiline: true,
|
|
590
|
-
},
|
|
701
|
+
{ placeholder: t.descriptionPlaceholder, images: imageBlocks },
|
|
591
702
|
),
|
|
592
|
-
{
|
|
703
|
+
{
|
|
704
|
+
open: Boolean(q.description),
|
|
705
|
+
title: t.description,
|
|
706
|
+
icon: "comment",
|
|
707
|
+
// 서식 도구 (굵게 · 기울임 · 취소선 · 목록 · 코드 · 그림) — 연주님 최종 수정본
|
|
708
|
+
tools: t.md,
|
|
709
|
+
images: imageUpload,
|
|
710
|
+
onRemoved: (text) =>
|
|
711
|
+
showSnackbar(t.fieldDeleted(t.description), () => {
|
|
712
|
+
q.description = text;
|
|
713
|
+
render();
|
|
714
|
+
}),
|
|
715
|
+
},
|
|
593
716
|
),
|
|
594
717
|
];
|
|
595
718
|
if (q.type === "select_one" || q.type === "select_multiple") {
|
|
@@ -621,6 +744,11 @@ function questionFields(q, i) {
|
|
|
621
744
|
title: t.placeholder,
|
|
622
745
|
icon: "textbox",
|
|
623
746
|
hint: t.placeholderHint,
|
|
747
|
+
onRemoved: (text) =>
|
|
748
|
+
showSnackbar(t.fieldDeleted(t.placeholder), () => {
|
|
749
|
+
q.placeholder = text;
|
|
750
|
+
render();
|
|
751
|
+
}),
|
|
624
752
|
},
|
|
625
753
|
),
|
|
626
754
|
);
|
|
@@ -628,14 +756,11 @@ function questionFields(q, i) {
|
|
|
628
756
|
body.push(
|
|
629
757
|
form.revealable(
|
|
630
758
|
t.addExplanation,
|
|
631
|
-
form.
|
|
759
|
+
form.richField(
|
|
632
760
|
t.explanation,
|
|
633
761
|
q.explanation?.text ?? "",
|
|
634
762
|
(v) => (q.explanation = { text: v, enabled: true }),
|
|
635
|
-
{
|
|
636
|
-
placeholder: t.explanationPlaceholder,
|
|
637
|
-
multiline: true,
|
|
638
|
-
},
|
|
763
|
+
{ placeholder: t.explanationPlaceholder, images: imageBlocks },
|
|
639
764
|
),
|
|
640
765
|
{
|
|
641
766
|
open: Boolean(q.explanation?.enabled),
|
|
@@ -644,7 +769,14 @@ function questionFields(q, i) {
|
|
|
644
769
|
onClose: () => (q.explanation = { text: "", enabled: false }),
|
|
645
770
|
title: t.explanation,
|
|
646
771
|
icon: "bulb",
|
|
772
|
+
tools: t.md,
|
|
773
|
+
images: imageUpload,
|
|
647
774
|
hint: t.explanationHint,
|
|
775
|
+
onRemoved: (text) =>
|
|
776
|
+
showSnackbar(t.fieldDeleted(t.explanation), () => {
|
|
777
|
+
q.explanation = { text, enabled: true };
|
|
778
|
+
render();
|
|
779
|
+
}),
|
|
648
780
|
},
|
|
649
781
|
),
|
|
650
782
|
);
|
|
@@ -734,10 +866,11 @@ function hideSnackbar() {
|
|
|
734
866
|
snackbarNode = null;
|
|
735
867
|
}
|
|
736
868
|
|
|
869
|
+
/** restore가 없으면 알림만 (되돌리기 버튼 없음) */
|
|
737
870
|
function showSnackbar(text, restore) {
|
|
738
871
|
hideSnackbar();
|
|
739
|
-
const node = templates.snackbar({ text, action: t.undo });
|
|
740
|
-
node.querySelector('[data-role="undo"]')
|
|
872
|
+
const node = templates.snackbar({ text, action: restore ? t.undo : null });
|
|
873
|
+
node.querySelector('[data-role="undo"]')?.addEventListener("click", () => {
|
|
741
874
|
hideSnackbar();
|
|
742
875
|
restore();
|
|
743
876
|
});
|
|
@@ -751,27 +884,9 @@ function render() {
|
|
|
751
884
|
answerViews.clear();
|
|
752
885
|
const cards = draft.questions.map(questionCard);
|
|
753
886
|
root.replaceChildren(
|
|
754
|
-
//
|
|
887
|
+
// 저장된 정답을 못 읽었을 때만 맨 위에 경고
|
|
755
888
|
...(unreadable ? [templates.answersIntro({ text: a.unreadable })] : []),
|
|
756
|
-
// 퀴즈 제목 ·
|
|
757
|
-
templates.quizInfo({
|
|
758
|
-
body: [
|
|
759
|
-
form.inlineField(t.quizTitle, draft.title, (v) => (draft.title = v), {
|
|
760
|
-
placeholder: t.quizTitlePlaceholder,
|
|
761
|
-
size: "title",
|
|
762
|
-
required: true,
|
|
763
|
-
}),
|
|
764
|
-
form.inlineField(
|
|
765
|
-
t.quizDescription,
|
|
766
|
-
draft.description,
|
|
767
|
-
(v) => (draft.description = v),
|
|
768
|
-
{
|
|
769
|
-
placeholder: t.quizDescriptionPlaceholder,
|
|
770
|
-
multiline: true,
|
|
771
|
-
},
|
|
772
|
-
),
|
|
773
|
-
],
|
|
774
|
-
}),
|
|
889
|
+
// 퀴즈 제목 · 안내 칸은 두지 않는다 (연주님 최종 수정본). 예전에 저장한 title · description은 draft에 그대로 남아 같이 저장된다
|
|
775
890
|
...cards,
|
|
776
891
|
// 문항은 LIMITS.questionsMax개까지: 다 차면 "문항 추가" 대신 안내
|
|
777
892
|
canAddQuestion(draft.questions)
|
|
@@ -821,20 +936,73 @@ function markAnswerError(card, message) {
|
|
|
821
936
|
area.addEventListener(type, clear);
|
|
822
937
|
}
|
|
823
938
|
|
|
939
|
+
/**
|
|
940
|
+
* partial_pattern 채점 설정: 문항마다 정답 정규식(서버 한도 ANSWER_KEY_MAX는 문항 하나에 걸림)과 점수.
|
|
941
|
+
* 검증(정규식 공통 검사 → 문항별 왕복 · 오답)을 통과해야 저장한다. 점수는 문항 수가 같으면 저장된 그대로,
|
|
942
|
+
* 바뀌었거나 저장된 점수가 규칙(0~100 정수, 합 100 이상)에 맞지 않으면 똑같이 나누고 짧게 알린다
|
|
943
|
+
*/
|
|
944
|
+
function partialGrading(questions) {
|
|
945
|
+
const keys = buildAnswerKeys(questions, answers);
|
|
946
|
+
const base = questions.map((q) =>
|
|
947
|
+
q.type === "text" ? (answers[q.id] ?? [])[0] : answers[q.id],
|
|
948
|
+
);
|
|
949
|
+
for (const [i, key] of keys.entries()) {
|
|
950
|
+
if (key.length > ANSWER_KEY_MAX)
|
|
951
|
+
return problemAt(
|
|
952
|
+
{
|
|
953
|
+
questionIndex: i,
|
|
954
|
+
message: a.validation.at(
|
|
955
|
+
i + 1,
|
|
956
|
+
a.validation.tooLongItem(key.length, ANSWER_KEY_MAX),
|
|
957
|
+
),
|
|
958
|
+
},
|
|
959
|
+
{ answer: true },
|
|
960
|
+
);
|
|
961
|
+
const regexProblem = validateAnswerRegex(key, [
|
|
962
|
+
joinAnswerList([questions[i]], [base[i]])[0],
|
|
963
|
+
]);
|
|
964
|
+
if (regexProblem)
|
|
965
|
+
return problemAt(
|
|
966
|
+
{ questionIndex: i, message: a.validation.at(i + 1, regexProblem) },
|
|
967
|
+
{ answer: true },
|
|
968
|
+
);
|
|
969
|
+
}
|
|
970
|
+
const keyProblem = checkAnswerKeys(questions, answers, keys, a.validation);
|
|
971
|
+
if (keyProblem) return problemAt(keyProblem, { answer: true });
|
|
972
|
+
// 저장된 점수는 저장된 정규식의 문제 id를 따라간다 (문제 순서를 바꿔도 제 문제에)
|
|
973
|
+
const saved = app.grading?.type === PARTIAL ? app.grading : undefined;
|
|
974
|
+
let { scores, resplit } = scoresFor(questions, saved, splitScores);
|
|
975
|
+
if (validatePartialGrading({ answer_key: keys, scores })) {
|
|
976
|
+
scores = splitScores(questions.length);
|
|
977
|
+
resplit = true;
|
|
978
|
+
}
|
|
979
|
+
if (resplit) showNotice({ text: t.scoresSplit(scores) });
|
|
980
|
+
return { type: PARTIAL, answer_key: keys, scores };
|
|
981
|
+
}
|
|
982
|
+
|
|
824
983
|
render();
|
|
984
|
+
// 불러오는 자리에서 내용으로 바뀔 때 살짝 나타나게 (styles.css .qz-enter)
|
|
985
|
+
root.classList.add("qz-enter");
|
|
825
986
|
save = app.useSave({
|
|
826
987
|
label: t.done,
|
|
827
|
-
|
|
988
|
+
// partial_pattern이면 학생 화면이 답을 문항별 배열로 내도록 공개 값 gradingType을 같이 저장 (정답은 아님)
|
|
989
|
+
getContent: () => {
|
|
990
|
+
const content = structuredClone(draft);
|
|
991
|
+
const images = usedImages();
|
|
992
|
+
if (images) content.images = images;
|
|
993
|
+
else delete content.images;
|
|
994
|
+
if (gradingType === PARTIAL) content.gradingType = PARTIAL;
|
|
995
|
+
else delete content.gradingType;
|
|
996
|
+
return content;
|
|
997
|
+
},
|
|
828
998
|
validate: (content) => {
|
|
829
999
|
const problem = validateQuiz(content, texts.validation);
|
|
830
1000
|
if (!problem) return true;
|
|
831
|
-
// 라벨이 없으니 비운 필수 칸(
|
|
1001
|
+
// 라벨이 없으니 비운 필수 칸(질문)에 빨간 밑줄을 긋고, 걸린 칸에 초점을 둔다
|
|
832
1002
|
form.markEmptyRequired();
|
|
833
|
-
const
|
|
834
|
-
problem.questionIndex
|
|
835
|
-
|
|
836
|
-
scope ?? form.cardAt(problem.questionIndex)
|
|
837
|
-
)?.querySelector("[aria-invalid]");
|
|
1003
|
+
const invalid = form
|
|
1004
|
+
.cardAt(problem.questionIndex)
|
|
1005
|
+
?.querySelector("[aria-invalid]");
|
|
838
1006
|
if (!invalid) return problemAt(problem);
|
|
839
1007
|
invalid.scrollIntoView({ block: "center" });
|
|
840
1008
|
invalid.focus({ preventScroll: true });
|
|
@@ -846,6 +1014,7 @@ save = app.useSave({
|
|
|
846
1014
|
const { questions } = draft;
|
|
847
1015
|
const missing = validateAnswerKey(questions, answers, a.validation);
|
|
848
1016
|
if (missing) return problemAt(missing, { answer: true });
|
|
1017
|
+
if (gradingType === PARTIAL) return partialGrading(questions);
|
|
849
1018
|
const answerKey = buildAnswerKey(questions, answers);
|
|
850
1019
|
// 정답 정규식은 서버 한도(ANSWER_KEY_MAX)가 퀴즈 전체에 걸린다. 한글 주관식은 한 글자가 9자로 늘어
|
|
851
1020
|
// 몇 문항이면 넘으므로, 정규식에서 가장 긴 문항으로 옮기고 무엇을 줄일지 알려 준다
|
|
@@ -3,54 +3,118 @@
|
|
|
3
3
|
// 모양은 ui/(templates · texts · theme.css), 동작은 core/에 있습니다.
|
|
4
4
|
import { start } from '../lib/elice-content.js';
|
|
5
5
|
import { renderQuestion } from '../core/behaviors.js';
|
|
6
|
-
import {
|
|
6
|
+
import { setImages } from '../core/markdown.js';
|
|
7
|
+
import {
|
|
8
|
+
decodeAnswer,
|
|
9
|
+
isAnswered,
|
|
10
|
+
joinAnswerList,
|
|
11
|
+
joinAnswers,
|
|
12
|
+
PARTIAL,
|
|
13
|
+
splitAnswers,
|
|
14
|
+
} from '../core/model.js';
|
|
7
15
|
import { labels, templates } from '../ui/templates/index.js';
|
|
8
|
-
import {
|
|
16
|
+
import { loading, someWrong } from '../ui/templates/page.js';
|
|
9
17
|
import { texts } from '../ui/texts.js';
|
|
10
18
|
|
|
11
19
|
const root = document.getElementById('app');
|
|
12
20
|
document.title = texts.page.learn;
|
|
13
21
|
root.replaceChildren(loading());
|
|
14
22
|
const app = await start({ screen: 'learn' });
|
|
15
|
-
// 편집 화면에서 아직 내용을 저장하지 않았으면 안내만 보인다 (기본 문항은
|
|
23
|
+
// 편집 화면에서 아직 내용을 저장하지 않았으면 키트 빈 안내만 보인다 (기본 문항은 없음, 모든 템플릿 공통 모양 · 문구,
|
|
24
|
+
// 교육자 · 튜터도 같은 문구 — 연주님 최종 수정본)
|
|
16
25
|
if (app.hasContent) show();
|
|
17
26
|
else root.replaceChildren(app.emptyState());
|
|
27
|
+
// 불러오는 자리에서 내용으로 바뀔 때 살짝 나타나게 (styles.css .qz-enter)
|
|
28
|
+
root.classList.add('qz-enter');
|
|
18
29
|
|
|
19
30
|
function show() {
|
|
20
|
-
|
|
31
|
+
// 퀴즈 제목 · 안내는 보이지 않는다 (연주님 최종 수정본: 문제부터 바로). 예전에 저장한 값은 settings에 그대로
|
|
32
|
+
const { questions = [] } = app.content;
|
|
33
|
+
// 편집 화면에서 지문 · 해설에 올린 그림 (글에는 만)
|
|
34
|
+
setImages(app.content.images);
|
|
21
35
|
// 문항 유형은 보이지 않는다 (무엇을 할지는 질문 문장이 알려 줌). 교육자도 이 화면에서 풀어 본다 (교육자 화면 없음)
|
|
22
36
|
const views = questions.map((q, i) =>
|
|
23
37
|
renderQuestion(q, i, {
|
|
24
38
|
templates,
|
|
25
39
|
labels: { ...labels, types: null },
|
|
40
|
+
// 문제가 하나면 번호 없이 제목만 (연주님 최종 수정본)
|
|
41
|
+
single: questions.length === 1,
|
|
26
42
|
seed: app.account?.anonymousId ?? '',
|
|
27
43
|
}),
|
|
28
44
|
);
|
|
29
45
|
|
|
30
|
-
root.replaceChildren(
|
|
46
|
+
root.replaceChildren(...views.map((v) => v.el));
|
|
31
47
|
|
|
32
|
-
//
|
|
48
|
+
// 답 모양은 채점 방식을 따른다 (학생 화면은 grading을 받지 못해 편집 화면이 같이 저장한 공개 값 gradingType으로 안다):
|
|
49
|
+
// pattern은 문자열 하나 "q1=b;q2=a,d;…" (ADR 0008 · 0009), partial_pattern은 문항별 배열 ["q1=b", "q2=a,d", …]
|
|
50
|
+
const partial = app.content.gradingType === PARTIAL;
|
|
51
|
+
/**
|
|
52
|
+
* 문제별 맞음 (partial_pattern), 지금 문제 순서대로. answerCorrectness[i]는 낸 답 answer[i]의 맞음이고 answer[i]는 "문제id=답"이라
|
|
53
|
+
* 문제 id로 맞춘다 (제출 뒤 교육자가 문제 순서를 바꿔도 표시가 제 문제에). 다시 열 때는 마지막 제출 기록의 answer,
|
|
54
|
+
* 제출 직후에는 지금 답(방금 낸 답과 같음). 낸 답과 지금 문제가 하나라도 맞지 않으면(빠짐 · 더함 · 옛 문자열 답) null → 전체 결과만
|
|
55
|
+
*/
|
|
56
|
+
const correctnessOf = (res) => {
|
|
57
|
+
const marks = res.answerCorrectness;
|
|
58
|
+
const answer = res.answer ?? joinAnswerList(questions, views.map((v) => v.getValue()));
|
|
59
|
+
if (!Array.isArray(marks) || !Array.isArray(answer) || marks.length !== answer.length) return null;
|
|
60
|
+
const byId = new Map();
|
|
61
|
+
answer.forEach((piece, i) => {
|
|
62
|
+
const at = typeof piece === 'string' ? piece.indexOf('=') : -1;
|
|
63
|
+
if (at > 0) byId.set(piece.slice(0, at), marks[i] === true);
|
|
64
|
+
});
|
|
65
|
+
if (byId.size !== questions.length || questions.some((q) => !byId.has(q.id))) return null;
|
|
66
|
+
return questions.map((q) => byId.get(q.id));
|
|
67
|
+
};
|
|
68
|
+
// pattern(모두 맞혀야 100점)은 점수 줄을 감추고 문제 카드의 정답 · 오답으로 알린다 (연주님 최종 수정본).
|
|
69
|
+
// 여러 문제 중 틀린 것이 있으면 제출 바 위에 한 줄 (어느 문제인지는 pattern이 알려 주지 않음). partial_pattern은 점수 줄 그대로
|
|
70
|
+
document.body.classList.toggle('qz-score-hidden', !partial);
|
|
71
|
+
const overall = someWrong();
|
|
72
|
+
const showOverall = (wrong) => {
|
|
73
|
+
overall.hidden = !wrong;
|
|
74
|
+
if (wrong) overall.dataset.result = 'wrong';
|
|
75
|
+
else delete overall.dataset.result;
|
|
76
|
+
};
|
|
33
77
|
app.useSubmit({
|
|
34
|
-
|
|
78
|
+
label: texts.learn.submit,
|
|
79
|
+
getAnswer: () => {
|
|
80
|
+
const values = views.map((v) => v.getValue());
|
|
81
|
+
return partial ? joinAnswerList(questions, values) : joinAnswers(questions, values);
|
|
82
|
+
},
|
|
35
83
|
setAnswer: (answer) => {
|
|
36
84
|
const byId = splitAnswers(questions, answer);
|
|
37
85
|
questions.forEach((q, i) => views[i].setValue(decodeAnswer(q, byId[q.id])));
|
|
38
86
|
},
|
|
39
87
|
validate: () => {
|
|
40
88
|
const left = questions.findIndex((q, i) => !isAnswered(q, views[i].getValue()));
|
|
41
|
-
|
|
89
|
+
if (left < 0) return true;
|
|
90
|
+
return questions.length === 1 ? texts.learn.unansweredSingle : texts.learn.unanswered(left + 1);
|
|
91
|
+
},
|
|
92
|
+
// 결과 줄(partial_pattern만 보임): 문제별 맞음이 있으면 점수와 틀린 문제 번호. 맞음 · 채점 안 함은 키트 기본 문장
|
|
93
|
+
resultText: (res) => {
|
|
94
|
+
if (res.isCorrect !== false || typeof res.score !== 'number') return undefined;
|
|
95
|
+
const marks = correctnessOf(res);
|
|
96
|
+
if (!marks) return undefined;
|
|
97
|
+
const wrong = marks.flatMap((ok, i) => (ok ? [] : [i + 1]));
|
|
98
|
+
return texts.learn.partial(res.score, marks.length - wrong.length, marks.length, wrong);
|
|
42
99
|
},
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
|
|
100
|
+
// partial_pattern이면 서버가 문항별 맞음 answerCorrectness를 준다 (제출 직후 · 다시 열 때 마지막 제출 기록에서).
|
|
101
|
+
// 문제 id로 맞춘 결과가 있으면 문제마다 정답 · 오답을 표시한다. 없거나([] = pattern · rubric) 맞추지 못하면 전체 결과만:
|
|
102
|
+
// 문항이 하나면 그 결과가 곧 문항의 정답 · 오답, 여러 문항이면 모두 맞았을 때만 정답 표시. 해설은 한 번이라도 제출하면
|
|
103
|
+
onResult: (res, info) => {
|
|
46
104
|
const single = views.length === 1;
|
|
47
|
-
|
|
105
|
+
const items = correctnessOf(res);
|
|
106
|
+
views.forEach((v, i) => {
|
|
48
107
|
const correct = typeof res.isCorrect === 'boolean' ? res.isCorrect : null;
|
|
49
|
-
v.setResult(
|
|
108
|
+
if (items) v.setResult(items[i]);
|
|
109
|
+
else v.setResult(single ? correct : correct === true ? true : null);
|
|
50
110
|
v.showExplanation();
|
|
51
111
|
});
|
|
112
|
+
showOverall(!partial && !single && res.isCorrect === false);
|
|
113
|
+
// 방금 낸 답이 만점이면 (다시 열었을 때 지난 기록으로는 아님)
|
|
114
|
+
if (res.isCorrect === true && !info?.restored) onPerfectScore();
|
|
52
115
|
},
|
|
53
116
|
});
|
|
117
|
+
document.querySelector('.ec-submitbar')?.before(overall);
|
|
54
118
|
|
|
55
119
|
// 다시 고치면 그 문항의 결과 색을 지운다 (기존 동작)
|
|
56
120
|
root.addEventListener('input', (e) => clearResult(e.target));
|
|
@@ -58,6 +122,18 @@ function show() {
|
|
|
58
122
|
function clearResult(target) {
|
|
59
123
|
const card = target instanceof Element ? target.closest('[data-role="question"]') : null;
|
|
60
124
|
const i = card ? questions.findIndex((q) => q.id === card.dataset.id) : -1;
|
|
61
|
-
if (i
|
|
125
|
+
if (i < 0 || app.readOnly) return;
|
|
126
|
+
views[i].setResult(null);
|
|
127
|
+
showOverall(false);
|
|
62
128
|
}
|
|
63
129
|
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* 방금 낸 답이 만점(100점)일 때 한 번 불린다 (다시 열 때 지난 기록으로는 불리지 않음).
|
|
133
|
+
* 만점 축하 토끼 · 소리는 콘텐츠가 보이지 않고 호스트(elice-web)가 보인다: elice-web에 같은 토끼 애니메이션
|
|
134
|
+
* (MaterialRabbitAnimation) · 소리와 기관별 켜고 끄는 설정이 있다. 콘텐츠가 호스트에 알리는 SDK 이벤트는 아직
|
|
135
|
+
* 정하지 않았으므로 지금은 아무것도 하지 않는다. 정해지면 그 SDK 호출 한 줄을 여기에 넣는다
|
|
136
|
+
*/
|
|
137
|
+
function onPerfectScore() {
|
|
138
|
+
// 호스트에 알리는 SDK 이벤트가 정해지면 여기서 부른다 (정하기 전에는 없는 API를 부르지 않는다)
|
|
139
|
+
}
|