@eliceio/cdk-cli 1.3.0-contenttypes.0 → 1.3.0-contenttypes.2
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 +24 -23
- package/es/cli.js +1 -1
- package/es/commands/create/index.js +1 -0
- package/es/commands/create/scaffold.d.ts +1 -1
- package/es/commands/create/scaffold.js +1 -1
- package/es/commands/doctor/index.js +6 -2
- package/es/core/config.d.ts +22 -0
- package/es/core/config.js +165 -1
- package/es/dev/assets.d.ts +80 -0
- package/es/dev/assets.js +240 -0
- package/es/dev/grading.d.ts +42 -26
- package/es/dev/grading.js +88 -39
- package/es/dev/host-page.js +26 -2
- package/es/dev/inject.d.ts +2 -1
- package/es/dev/inject.js +10 -2
- package/es/dev/mock-api.d.ts +23 -2
- package/es/dev/mock-api.js +210 -40
- package/es/dev/server.d.ts +12 -1
- package/es/dev/server.js +115 -9
- package/es/rules.json.js +1 -1
- package/package.json +2 -2
- package/rules.json +3 -3
- package/skills/_shared/references/02-design-the-material.md +1 -1
- package/skills/_shared/references/03-create-the-project.md +9 -8
- package/skills/_shared/references/04-rules.md +1 -1
- package/skills/_shared/references/05-screen-code.md +22 -20
- package/skills/_shared/references/06-using-the-quiz-template.md +6 -4
- package/skills/_shared/references/08-fix-check-errors.md +1 -1
- package/skills/_shared/references/09-check.md +1 -0
- package/skills/_shared/references/12-upload-with-the-material-mcp.md +1 -1
- package/skills/elice-content-publish/SKILL.md +1 -1
- package/templates/_shared/lib/cdk-mock.d.ts +17 -0
- package/templates/_shared/lib/cdk-mock.js +212 -7
- package/templates/_shared/lib/elice-content.d.ts +61 -1
- package/templates/_shared/lib/elice-content.js +317 -10
- package/templates/blank/README.md +1 -1
- package/templates/blank/screens/instructor.js +8 -2
- package/templates/blank/screens/learn.js +1 -1
- package/templates/blank/template.json +1 -1
- package/templates/document/README.md +92 -0
- package/templates/document/commentary.txt +2 -0
- package/templates/document/core/dom.d.ts +13 -0
- package/templates/document/core/dom.js +83 -0
- package/templates/document/core/file-type.d.ts +21 -0
- package/templates/document/core/file-type.js +85 -0
- package/templates/document/core/group-3d.d.ts +20 -0
- package/templates/document/core/group-3d.js +256 -0
- package/templates/document/core/inline-edit.d.ts +15 -0
- package/templates/document/core/inline-edit.js +377 -0
- package/templates/document/core/load.d.ts +13 -0
- package/templates/document/core/load.js +40 -0
- package/templates/document/core/pdf-options.d.ts +9 -0
- package/templates/document/core/pdf-options.js +36 -0
- package/templates/document/core/pdf-worker.d.ts +24 -0
- package/templates/document/core/pdf-worker.js +122 -0
- package/templates/document/core/pdf.d.ts +12 -0
- package/templates/document/core/pdf.js +190 -0
- package/templates/document/core/pptx-edit.d.ts +14 -0
- package/templates/document/core/pptx-edit.js +137 -0
- package/templates/document/core/pptx-fonts.d.ts +5 -0
- package/templates/document/core/pptx-fonts.js +115 -0
- package/templates/document/core/pptx-media.d.ts +18 -0
- package/templates/document/core/pptx-media.js +83 -0
- package/templates/document/core/pptx-view.d.ts +5 -0
- package/templates/document/core/pptx-view.js +185 -0
- package/templates/document/core/settings.d.ts +25 -0
- package/templates/document/core/settings.js +86 -0
- package/templates/document/core/slide-edges.d.ts +3 -0
- package/templates/document/core/slide-edges.js +82 -0
- package/templates/document/core/viewer.d.ts +28 -0
- package/templates/document/core/viewer.js +159 -0
- package/templates/document/edit.html +17 -0
- package/templates/document/gitignore +4 -0
- package/templates/document/index.html +18 -0
- package/templates/document/metadata.json +9 -0
- package/templates/document/package.json +17 -0
- package/templates/document/public/fonts/OFL-Caladea.txt +93 -0
- package/templates/document/public/fonts/OFL-Carlito.txt +93 -0
- package/templates/document/public/fonts/caladea-latin-400-normal.woff2 +0 -0
- package/templates/document/public/fonts/caladea-latin-700-normal.woff2 +0 -0
- package/templates/document/public/fonts/carlito-latin-400-normal.woff2 +0 -0
- package/templates/document/public/fonts/carlito-latin-700-normal.woff2 +0 -0
- package/templates/document/screens/edit.js +574 -0
- package/templates/document/screens/learn.js +61 -0
- package/templates/document/styles.css +644 -0
- package/templates/document/template.json +13 -0
- package/templates/document/ui/templates/edit.js +82 -0
- package/templates/document/ui/templates/page.js +11 -0
- package/templates/document/ui/templates/viewer.js +41 -0
- package/templates/document/ui/texts.d.ts +3 -0
- package/templates/document/ui/texts.js +62 -0
- package/templates/document/ui/theme.css +69 -0
- package/templates/quiz/README.md +16 -12
- package/templates/quiz/core/behaviors.d.ts +4 -0
- package/templates/quiz/core/behaviors.js +4 -2
- package/templates/quiz/core/editor.d.ts +17 -2
- package/templates/quiz/core/editor.js +85 -10
- package/templates/quiz/core/markdown.d.ts +15 -0
- package/templates/quiz/core/markdown.js +164 -4
- package/templates/quiz/core/model.d.ts +53 -9
- package/templates/quiz/core/model.js +384 -41
- package/templates/quiz/core/rich-text.d.ts +1 -2
- package/templates/quiz/core/rich-text.js +7 -59
- package/templates/quiz/public/img/mascot-half.webp +0 -0
- package/templates/quiz/screens/edit.js +403 -126
- package/templates/quiz/screens/learn.js +106 -40
- package/templates/quiz/styles.css +584 -4
- package/templates/quiz/template.json +1 -1
- package/templates/quiz/ui/templates/edit.d.ts +3 -0
- package/templates/quiz/ui/templates/edit.js +113 -11
- package/templates/quiz/ui/templates/page.js +14 -0
- package/templates/quiz/ui/templates/question.js +5 -3
- package/templates/quiz/ui/texts.js +89 -26
|
@@ -223,6 +223,9 @@ export const field = ({
|
|
|
223
223
|
* 화면 낭독기에는 aria-label로 이름을 준다. size: 'title'(퀴즈 제목) · 'question'(질문) · 'body'(안내 · 설명)
|
|
224
224
|
* data-role="input" (input · textarea) · max가 있고 showCount가 false가 아니면 data-role="count" (글자 수, 칸에 초점이 있을 때만 보임)
|
|
225
225
|
* showCount: false면 max(입력 제한)는 지키되 글자 수 표시는 뺀다
|
|
226
|
+
* singleLine: 한 줄 값(줄바꿈 없음)이지만 길면 칸 안에서 다음 줄로 넘겨 다 보이는 칸 (textarea data-single-line, Enter · 붙여 넣은 줄바꿈은 동작이 막음)
|
|
227
|
+
* softWrap: 길면 칸 안에서 다음 줄로 넘기고 Shift+Enter로 줄을 바꾸는 칸 (textarea data-soft-wrap, Enter만 동작이 막음. 질문 칸)
|
|
228
|
+
* (보기 · 주관식 정답 · 그룹 이름 칸도 같은 textarea[data-soft-wrap])
|
|
226
229
|
* 필수 칸은 data-required: 비운 채 저장하면 동작이 aria-invalid를 붙인다 (빨간 밑줄)
|
|
227
230
|
*/
|
|
228
231
|
export const inlineField = ({
|
|
@@ -233,16 +236,20 @@ export const inlineField = ({
|
|
|
233
236
|
max,
|
|
234
237
|
showCount = true,
|
|
235
238
|
multiline = false,
|
|
239
|
+
singleLine = false,
|
|
240
|
+
softWrap = false,
|
|
236
241
|
}) => html`
|
|
237
242
|
<div class="qe-inline qe-inline-${size} ec-field ec-field-${size}">
|
|
238
243
|
${
|
|
239
|
-
multiline
|
|
244
|
+
multiline || singleLine || softWrap
|
|
240
245
|
? html`<textarea
|
|
241
246
|
class="qe-inline-input ec-field-input"
|
|
242
247
|
data-role="input"
|
|
243
248
|
rows="1"
|
|
244
249
|
aria-label="${label}"
|
|
245
250
|
placeholder="${placeholder}"
|
|
251
|
+
${singleLine && "data-single-line"}
|
|
252
|
+
${softWrap && "data-soft-wrap"}
|
|
246
253
|
${required && "data-required aria-required=true"}
|
|
247
254
|
></textarea>`
|
|
248
255
|
: html`<input
|
|
@@ -325,7 +332,8 @@ const toolIcon = {
|
|
|
325
332
|
|
|
326
333
|
/**
|
|
327
334
|
* 지문 · 해설 서식 도구 (칸에 초점이 있을 때 칸 아래에 뜸). 버튼마다 data-role:
|
|
328
|
-
* "md-bold" · "md-italic" · "md-strike" · "md-ul" · "md-ol" · "md-code" · "md-image" (그림 올리기, 못 쓰면 동작이 숨김)
|
|
335
|
+
* "md-bold" · "md-italic" · "md-strike" · "md-ul" · "md-ol" · "md-code" · "md-image" (그림 올리기, 못 쓰면 동작이 숨김) ·
|
|
336
|
+
* "md-progress" (그림을 올리는 동안 진행률)
|
|
329
337
|
*/
|
|
330
338
|
export const mdTools = () => {
|
|
331
339
|
const m = t.md;
|
|
@@ -345,6 +353,7 @@ export const mdTools = () => {
|
|
|
345
353
|
<button type="button" class="qe-md-btn" data-role="md-image" aria-label="${m.image}" title="${m.image}">
|
|
346
354
|
${toolIcon.image()}
|
|
347
355
|
</button>
|
|
356
|
+
<span class="qe-md-progress" data-role="md-progress" aria-live="polite" hidden></span>
|
|
348
357
|
</div>
|
|
349
358
|
`;
|
|
350
359
|
};
|
|
@@ -504,12 +513,14 @@ export const row = ({
|
|
|
504
513
|
${answer && answer.type !== "select" && answerControl(answer, index)}
|
|
505
514
|
${numbered && html`<span class="qe-option-no ec-list-no">${k.marker(index)}</span>`}
|
|
506
515
|
<span class="qe-option-field">
|
|
507
|
-
<
|
|
516
|
+
<textarea
|
|
508
517
|
class="qe-inline-input qe-option-text ec-field-input"
|
|
509
518
|
data-role="input"
|
|
519
|
+
data-soft-wrap
|
|
520
|
+
rows="1"
|
|
510
521
|
aria-label="${k.input(index)}"
|
|
511
522
|
placeholder="${k.input(index)}"
|
|
512
|
-
|
|
523
|
+
></textarea>
|
|
513
524
|
${answer &&
|
|
514
525
|
answer.type !== "select" &&
|
|
515
526
|
html`<span class="qe-correct-tag" aria-hidden="true">${t.correctTag}</span>`}
|
|
@@ -657,7 +668,7 @@ export const typeMenu = ({ label, types, value }) => html`
|
|
|
657
668
|
* data-role="type" (유형 버튼: 누르면 typeMenu, 브라우저 select를 둬도 됨) · data-role="up" · data-role="down" · data-role="delete"
|
|
658
669
|
* 문항이 하나뿐이면 ↑ · ↓는 숨긴다 (옮길 곳이 없음)
|
|
659
670
|
*/
|
|
660
|
-
export const card = ({ q, index, count, types, body }) => html`
|
|
671
|
+
export const card = ({ q, index, count, types, body, points }) => html`
|
|
661
672
|
<section class="qe-card ec-edit-card">
|
|
662
673
|
<header class="qe-card-head ec-edit-card-head">
|
|
663
674
|
<strong>${t.question(index + 1)}</strong>
|
|
@@ -674,6 +685,22 @@ export const card = ({ q, index, count, types, body }) => html`
|
|
|
674
685
|
<span class="qe-type-label">${typeName(types, q.type)}</span>
|
|
675
686
|
${icons.chevronDown()}
|
|
676
687
|
</button>
|
|
688
|
+
${points !== undefined &&
|
|
689
|
+
html`<label class="qe-points">
|
|
690
|
+
<span class="qe-points-label">${t.scoring.points(index + 1)}</span>
|
|
691
|
+
<input
|
|
692
|
+
type="number"
|
|
693
|
+
inputmode="numeric"
|
|
694
|
+
min="0"
|
|
695
|
+
max="100"
|
|
696
|
+
step="1"
|
|
697
|
+
class="qe-points-input"
|
|
698
|
+
data-role="points"
|
|
699
|
+
aria-label="${t.scoring.points(index + 1)}"
|
|
700
|
+
/>
|
|
701
|
+
<span class="qe-points-unit" aria-hidden="true">${t.scoring.unit}</span>
|
|
702
|
+
</label>
|
|
703
|
+
<span class="qe-head-sep" aria-hidden="true"></span>`}
|
|
677
704
|
<button
|
|
678
705
|
type="button"
|
|
679
706
|
class="ec-icon-button"
|
|
@@ -707,6 +734,31 @@ export const card = ({ q, index, count, types, body }) => html`
|
|
|
707
734
|
</section>
|
|
708
735
|
`;
|
|
709
736
|
|
|
737
|
+
/**
|
|
738
|
+
* 부분 채점 설정 (문제가 2개 이상일 때 편집 화면 맨 위, 연주님 부분 채점 UI): 스위치 · 안내, 켜면 배점 방식 · 합계 · 동일 점수 버튼.
|
|
739
|
+
* data-role="partial"(스위치) · "sum"(합계 줄, data-mode="equal|custom") · "mode" · "total" · "equal" · "note"
|
|
740
|
+
*/
|
|
741
|
+
export const scoreSettings = ({ partial }) => html`
|
|
742
|
+
<section class="qe-score" data-role="score-settings">
|
|
743
|
+
<label class="qe-score-switch">
|
|
744
|
+
<span class="qe-sw">
|
|
745
|
+
<input type="checkbox" role="switch" data-role="partial" ${partial && "checked"} />
|
|
746
|
+
<span class="qe-sw-track" aria-hidden="true"></span>
|
|
747
|
+
</span>
|
|
748
|
+
<span class="qe-score-title">${t.scoring.toggle}</span>
|
|
749
|
+
<span class="qe-score-hint">${partial ? t.scoring.hintOn : t.scoring.hintOff}</span>
|
|
750
|
+
</label>
|
|
751
|
+
<div class="qe-score-sum" data-role="sum" ${!partial && "hidden"}>
|
|
752
|
+
<div class="qe-score-row">
|
|
753
|
+
<span class="qe-score-mode" data-role="mode"></span>
|
|
754
|
+
<span class="qe-score-total" data-role="total" role="status"></span>
|
|
755
|
+
<button type="button" class="qe-score-equal" data-role="equal">${t.scoring.equal}</button>
|
|
756
|
+
</div>
|
|
757
|
+
<p class="qe-score-note" data-role="note"></p>
|
|
758
|
+
</div>
|
|
759
|
+
</section>
|
|
760
|
+
`;
|
|
761
|
+
|
|
710
762
|
/** 저장하지 못한 정답 문제 (정답 자리 위). data-role="answer-error" */
|
|
711
763
|
export const answerError = ({ text }) =>
|
|
712
764
|
html`<p class="qe-answer-error" data-role="answer-error" role="alert">
|
|
@@ -733,17 +785,19 @@ export const answersIntro = ({ text }) =>
|
|
|
733
785
|
html`<p class="qe-hint qe-answers-intro">${text}</p>`;
|
|
734
786
|
|
|
735
787
|
/**
|
|
736
|
-
* 주관식 정답 목록: 줄마다 밑줄 칸 하나 + ✕, 아래에 "+
|
|
788
|
+
* 주관식 정답 목록: 줄마다 밑줄 칸 하나 + ✕, 아래에 "+ 정답 추가" (보기 목록과 같은 모양). 그중 하나만 맞아도 정답
|
|
737
789
|
* textAnswerRow: data-role="input" · "delete" / textAnswerAdd: data-role="add"
|
|
738
790
|
*/
|
|
739
791
|
export const textAnswerRow = ({ index, canDelete }) => html`
|
|
740
792
|
<div class="qe-option qe-text-answer ec-list-row">
|
|
741
|
-
<
|
|
793
|
+
<textarea
|
|
742
794
|
class="qe-inline-input qe-option-text ec-field-input"
|
|
743
795
|
data-role="input"
|
|
796
|
+
data-soft-wrap
|
|
797
|
+
rows="1"
|
|
744
798
|
aria-label="${ta.textInput(index)}"
|
|
745
|
-
placeholder="${ta.
|
|
746
|
-
|
|
799
|
+
placeholder="${ta.textPlaceholder}"
|
|
800
|
+
></textarea>
|
|
747
801
|
<button
|
|
748
802
|
type="button"
|
|
749
803
|
class="ec-icon-button ec-danger"
|
|
@@ -762,6 +816,52 @@ export const textAnswerAdd = () =>
|
|
|
762
816
|
|
|
763
817
|
export const textAnswers = ({ rows, add }) => html`<div class="qe-options qe-text-answers ec-list">${rows}${add}</div>`;
|
|
764
818
|
|
|
819
|
+
/**
|
|
820
|
+
* 주관식 정답 칸 (연주님 2026-11-19): 정답 입력 방식 세그먼트(직접 입력 · 정규 표현식) + 안내, 아래에 목록 또는 정규식 칸.
|
|
821
|
+
* data-role: "mode-list" · "mode-regex"(role=radio) · "mode-hint" · "list-area" · "regex-area"
|
|
822
|
+
*/
|
|
823
|
+
export const textAnswerBox = ({ list, regex }) => html`
|
|
824
|
+
<div class="qe-text-answer-box">
|
|
825
|
+
<div class="qe-seg-row">
|
|
826
|
+
<div class="qe-seg" role="radiogroup" aria-label="${ta.modeLabel}">
|
|
827
|
+
<button type="button" role="radio" class="qe-seg-btn" data-role="mode-list" aria-checked="true" tabindex="0">${ta.modeList}</button>
|
|
828
|
+
<button type="button" role="radio" class="qe-seg-btn" data-role="mode-regex" aria-checked="false" tabindex="-1">${ta.modeRegex}</button>
|
|
829
|
+
</div>
|
|
830
|
+
<span class="qe-seg-hint" data-role="mode-hint" data-ec-quiet></span>
|
|
831
|
+
</div>
|
|
832
|
+
<div data-role="list-area">${list}</div>
|
|
833
|
+
<div data-role="regex-area" hidden>${regex}</div>
|
|
834
|
+
</div>
|
|
835
|
+
`;
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* 주관식 정규식 칸 + 채점 테스트 (안내 · 결과 글은 data-ec-quiet: 바뀌어도 "저장하지 않은 변경"이 아님). data-role: "input"(정규식) · "error"(오류) · "notes"(저장 때 바꾸는 것 · 빈 답 경고) ·
|
|
839
|
+
* "test"(테스트 답) · "result"(일치 여부, data-state ok · miss)
|
|
840
|
+
*/
|
|
841
|
+
export const regexAnswer = () => html`
|
|
842
|
+
<div class="qe-regex">
|
|
843
|
+
<textarea
|
|
844
|
+
class="qe-inline-input qe-regex-input ec-field-input"
|
|
845
|
+
data-role="input"
|
|
846
|
+
data-single-line
|
|
847
|
+
rows="1"
|
|
848
|
+
spellcheck="false"
|
|
849
|
+
autocomplete="off"
|
|
850
|
+
aria-label="${ta.regexInput}"
|
|
851
|
+
placeholder="${ta.regexPlaceholder}"
|
|
852
|
+
></textarea>
|
|
853
|
+
<p class="qe-regex-error" data-role="error" role="alert" data-ec-quiet hidden></p>
|
|
854
|
+
<p class="qe-regex-hint" data-role="notes" data-ec-quiet hidden></p>
|
|
855
|
+
<div class="qe-regex-tester">
|
|
856
|
+
<label class="qe-regex-test">
|
|
857
|
+
<span class="qe-regex-test-label">${ta.testLabel}</span>
|
|
858
|
+
<input class="qe-inline-input" data-role="test" autocomplete="off" placeholder="${ta.testPlaceholder}" />
|
|
859
|
+
</label>
|
|
860
|
+
<p class="qe-regex-result" data-role="result" role="status" data-ec-quiet></p>
|
|
861
|
+
</div>
|
|
862
|
+
</div>
|
|
863
|
+
`;
|
|
864
|
+
|
|
765
865
|
/** 문항 추가 버튼 */
|
|
766
866
|
export const addQuestion = () =>
|
|
767
867
|
html`<button type="button" class="qe-add qe-add-question ec-add">
|
|
@@ -782,12 +882,14 @@ export const groupBox = ({ letter, canDelete, rows, add, nameLabel, namePlacehol
|
|
|
782
882
|
<div class="qe-group" data-group-box>
|
|
783
883
|
<div class="qe-group-head">
|
|
784
884
|
<span class="qe-group-badge">${letter}</span>
|
|
785
|
-
<
|
|
885
|
+
<textarea
|
|
786
886
|
class="qe-inline-input qe-group-name ec-field-input"
|
|
787
887
|
data-role="group-name"
|
|
888
|
+
data-soft-wrap
|
|
889
|
+
rows="1"
|
|
788
890
|
aria-label="${nameLabel}"
|
|
789
891
|
placeholder="${namePlaceholder}"
|
|
790
|
-
|
|
892
|
+
></textarea>
|
|
791
893
|
<button
|
|
792
894
|
type="button"
|
|
793
895
|
class="ec-icon-button ec-danger"
|
|
@@ -22,3 +22,17 @@ export const loading = () => html`
|
|
|
22
22
|
export const someWrong = () => html`
|
|
23
23
|
<p class="qz-result qz-overall" role="status" hidden>${texts.learn.someWrong}</p>
|
|
24
24
|
`;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 부분 점수(partial_pattern)가 100점보다 낮을 때 결과 상자 안 (위 한 줄과 같은 .qz-overall 자리에 넣음, 연주님 부분 채점 UI):
|
|
28
|
+
* 점수 · "아쉬워요!" · 안내 · 오른쪽 아래 마스코트. 100점이면 상자를 숨긴다 (만점 축하는 LXP 화면이 맡음)
|
|
29
|
+
* 마스코트 그림은 public/img/mascot-half.webp (실행 중 문자열 경로로 받는 파일이라 public/, zip에는 img/mascot-half.webp. 장식이라 alt 없음)
|
|
30
|
+
*/
|
|
31
|
+
export const partialScore = ({ score }) => html`
|
|
32
|
+
<strong class="qz-overall-score"><span>${score}</span><small>${texts.learn.scoreUnit}</small></strong>
|
|
33
|
+
<span class="qz-overall-text">
|
|
34
|
+
<strong class="qz-overall-title">${texts.learn.scoreTitle}</strong>
|
|
35
|
+
<span class="qz-overall-hint">${texts.learn.scoreSub}</span>
|
|
36
|
+
</span>
|
|
37
|
+
<img class="qz-overall-img" src="img/mascot-half.webp" alt="" />
|
|
38
|
+
`;
|
|
@@ -8,14 +8,16 @@ import { texts } from '../texts.js';
|
|
|
8
8
|
const t = texts.question;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* @param {{ q: object, no: number, type: string, body: Node, explanation: string | null }} props
|
|
12
|
-
* no: 1부터 (문제가 하나뿐이면 null: 번호 없이 제목만) · type: 유형 이름(학생 화면은 null: 그리지 않음) · body: 유형별 본문 · explanation: 해설(없으면 null)
|
|
11
|
+
* @param {{ q: object, no: number, type: string, body: Node, explanation: string | null, points?: number | null }} props
|
|
12
|
+
* no: 1부터 (문제가 하나뿐이면 null: 번호 없이 제목만) · type: 유형 이름(학생 화면은 null: 그리지 않음) · body: 유형별 본문 · explanation: 해설(없으면 null) ·
|
|
13
|
+
* points: 배점(부분 채점 · 직접 배점일 때만, 아니면 null: 그리지 않음)
|
|
13
14
|
*/
|
|
14
|
-
export const question = ({ q, no, type, body, explanation }) => html`
|
|
15
|
+
export const question = ({ q, no, type, body, explanation, points = null }) => html`
|
|
15
16
|
<fieldset class="qz-question">
|
|
16
17
|
<legend class="qz-question-head">
|
|
17
18
|
<span class="qz-question-title">${no === null ? q.title : t.title(no, q.title)}</span>
|
|
18
19
|
${type && html`<span class="qz-chip">${type}</span>`}
|
|
20
|
+
${points != null && html`<span class="qz-points">${t.points(points)}</span>`}
|
|
19
21
|
</legend>
|
|
20
22
|
${q.description ? markdown(q.description, 'qz-markdown qz-passage') : null} ${body}
|
|
21
23
|
<p class="qz-result" data-role="result" role="status" hidden></p>
|
|
@@ -24,27 +24,72 @@ export const texts = {
|
|
|
24
24
|
hint: {
|
|
25
25
|
order: '정답 순서대로 보기를 적으세요. 학생에게는 섞여서 보입니다',
|
|
26
26
|
group: '보기를 알맞은 그룹 상자 안에 적으세요',
|
|
27
|
-
text: '
|
|
27
|
+
text: '정답을 여러 개 추가하면 그중 하나만 맞아도 정답입니다.',
|
|
28
28
|
},
|
|
29
|
-
addText: '+
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
addText: '+ 정답 추가',
|
|
30
|
+
textPlaceholder: '정답 입력',
|
|
31
|
+
textInput: i => (i === 0 ? '정답 입력' : `정답 ${i + 1} 입력`),
|
|
32
|
+
textDelete: i => `정답 ${i + 1} 지우기`,
|
|
32
33
|
textMin: '정답은 하나 이상 있어야 합니다.',
|
|
34
|
+
// 주관식 정답 입력 방식 (연주님 2026-11-19): 직접 입력(허용 답 목록) · 정규 표현식
|
|
35
|
+
modeLabel: '정답 입력 방식',
|
|
36
|
+
modeList: '직접 입력',
|
|
37
|
+
modeRegex: '정규 표현식',
|
|
38
|
+
// 정규식 → 직접 입력으로 바꿀 때 목록으로 풀 수 없는 식이면 지우고 알림 (되돌리기)
|
|
39
|
+
regexCleared: '정규식을 지웠습니다.',
|
|
40
|
+
regexPlaceholder: '예: [Aa]pples?|사과',
|
|
41
|
+
regexInput: '정답 정규식 입력',
|
|
42
|
+
regexError: detail => `올바른 정규식이 아닙니다. ${detail ?? ''}`.trim(),
|
|
43
|
+
regexSemicolon: '정규식에는 ; 를 쓸 수 없습니다.',
|
|
44
|
+
testLabel: '채점 테스트',
|
|
45
|
+
testPlaceholder: '테스트해 볼 답변을 입력해 주세요',
|
|
46
|
+
testMatch: '일치합니다. 정답으로 채점됩니다.',
|
|
47
|
+
testMiss: '일치하지 않습니다. 오답으로 채점됩니다.',
|
|
48
|
+
// 정규식 칸 아래 안내 (저장은 막지 않음)
|
|
49
|
+
regexNotes: {
|
|
50
|
+
anchors: '맨 앞 ^ · 맨 끝 $는 빼고 저장합니다. 늘 답 전체와 맞춰 봅니다.',
|
|
51
|
+
flag: '맨 앞 (?i)는 (?i:…)로 바꿔 저장합니다 (대소문자 무시).',
|
|
52
|
+
emptyMatch: '빈 답도 정답으로 채점되는 정규식입니다.',
|
|
53
|
+
},
|
|
54
|
+
// 더 새 템플릿이 저장한 퀴즈 (settings answerFormat이 이 판보다 큼). 정답을 저장하지 않는다
|
|
55
|
+
futureFormat: version =>
|
|
56
|
+
`이 퀴즈는 퀴즈 템플릿 ${version ?? '새 버전'} 이상에서 저장했습니다. 이 화면으로 저장하면 정답이 바뀔 수 있어 저장하지 않습니다. 새 템플릿으로 다시 만들어 열어 주세요.`,
|
|
33
57
|
unreadable:
|
|
34
|
-
'저장된 정답(기준 답안)을 이 화면이 읽지
|
|
58
|
+
'저장된 정답(기준 답안)을 이 화면이 읽지 못했습니다. 문제마다 정답을 다시 골라 저장해 주세요.',
|
|
35
59
|
validation: {
|
|
36
60
|
at: (no, message) => `문제 ${no}: ${message}`,
|
|
37
61
|
noAnswer: '정답을 골라 주세요.',
|
|
38
62
|
missingOption: '정답으로 고른 보기나 그룹이 지금 문제에 없습니다 (지웠음). 다시 골라 주세요.',
|
|
39
|
-
badRegex: '정답으로 기준 답안을 만들지
|
|
63
|
+
badRegex: '정답으로 기준 답안을 만들지 못했습니다. 정답을 다시 골라 주세요.',
|
|
40
64
|
roundTrip: '정답으로 낸 답이 기준 답안과 맞지 않습니다. 정답을 다시 골라 주세요.',
|
|
41
65
|
tooWide: '다른 답도 정답으로 인정됩니다. 정답을 다시 확인해 주세요.',
|
|
66
|
+
// 주관식 정규식 (core/model.js compileTextRegex의 error 코드). 서버(Python)와 브라우저가 다르게 읽는 문법은 막는다
|
|
67
|
+
badTextRegex: '정답 정규식이 올바르지 않습니다.',
|
|
68
|
+
textSemicolon: '정답 정규식에는 ; 를 쓸 수 없습니다.',
|
|
69
|
+
regex: {
|
|
70
|
+
invalid: () => '정답 정규식이 올바르지 않습니다.',
|
|
71
|
+
semicolon: () => '정답 정규식에는 ; 를 쓸 수 없습니다.',
|
|
72
|
+
flag: () =>
|
|
73
|
+
'정규식 가운데의 (?i) · (?s) 같은 플래그는 쓸 수 없습니다. 일부만 대소문자를 무시하려면 (?i:…)로 감싸 주세요.',
|
|
74
|
+
backref: () => '정규식에 역참조(\\1 · \\k<…>)는 쓸 수 없습니다.',
|
|
75
|
+
namedGroup: () => '정규식에 이름 붙은 그룹((?<이름>…) · (?P<이름>…))은 쓸 수 없습니다. (…)로 적어 주세요.',
|
|
76
|
+
unicodeProperty: () => '정규식에 \\p{…} · \\P{…}는 쓸 수 없습니다. [가-힣]처럼 범위로 적어 주세요.',
|
|
77
|
+
wordBoundary: () => '정규식에 \\b · \\B는 쓸 수 없습니다 (답 전체와 맞춰 보므로 없어도 됩니다).',
|
|
78
|
+
negatedInClass: detail => `정규식의 [ ] 안에는 ${detail}를 쓸 수 없습니다.`,
|
|
79
|
+
escape: detail => `정규식에 ${detail}는 쓸 수 없습니다 (채점 서버와 뜻이 다릅니다).`,
|
|
80
|
+
emptyClass: () => '정규식에 [] · [^]는 쓸 수 없습니다. 글자 ]는 \\]로 적어 주세요.',
|
|
81
|
+
nestedClass: () => '정규식의 [ ] 안에서 [는 \\[로 적어 주세요.',
|
|
82
|
+
percentInClass: () => '정규식의 [ ] 안에는 %를 쓸 수 없습니다. (%|…)처럼 [ ] 밖에 적어 주세요.',
|
|
83
|
+
anchorMiddle: () => '^ · $는 정규식 맨 앞 · 맨 끝에만 쓸 수 있습니다. 글자로 쓰려면 \\^ · \\$로 적어 주세요.',
|
|
84
|
+
quantifier: detail => `정규식에 ${detail}는 쓸 수 없습니다. {0,2}처럼 적어 주세요.`,
|
|
85
|
+
group: detail => `정규식에 ${detail}…) 문법은 쓸 수 없습니다.`,
|
|
86
|
+
},
|
|
42
87
|
// 퀴즈 전체 정답 길이가 한도를 넘음 (가장 긴 문항에 붙여 보인다)
|
|
43
88
|
// partial_pattern: 문항 하나의 정답이 한도를 넘음
|
|
44
89
|
tooLongItem: (length, max) =>
|
|
45
|
-
`정답이 너무 깁니다 (${length}자, 최대 ${max}자). 이 문제의
|
|
90
|
+
`정답이 너무 깁니다 (${length}자, 최대 ${max}자). 이 문제의 정답을 줄여 주세요.`,
|
|
46
91
|
tooLong: (length, max) =>
|
|
47
|
-
`정답이 너무 깁니다 (퀴즈 전체 ${length}자, 최대 ${max}자). 이 문제의
|
|
92
|
+
`정답이 너무 깁니다 (퀴즈 전체 ${length}자, 최대 ${max}자). 이 문제의 정답을 줄이거나 퀴즈를 나눠 주세요.`,
|
|
48
93
|
},
|
|
49
94
|
},
|
|
50
95
|
|
|
@@ -56,15 +101,20 @@ export const texts = {
|
|
|
56
101
|
// 제출 버튼 (다시 낼 때는 키트가 "다시 제출하기")
|
|
57
102
|
submit: '제출하기',
|
|
58
103
|
// 모두 맞혀야 100점(pattern)인 여러 문제 퀴즈에서 틀린 것이 있을 때 제출 바 위 한 줄 (점수 줄은 감춤)
|
|
59
|
-
someWrong: '틀린 문제가
|
|
60
|
-
// 부분 점수(partial_pattern)
|
|
61
|
-
|
|
62
|
-
|
|
104
|
+
someWrong: '틀린 문제가 있습니다. 다시 한번 풀어보세요.',
|
|
105
|
+
// 부분 점수(partial_pattern)가 100점보다 낮을 때 제출 바 위 결과 상자 (점수 · 제목 · 안내 · 마스코트). 100점이면 상자 없음
|
|
106
|
+
scoreUnit: '점',
|
|
107
|
+
scoreTitle: '아쉬워요!',
|
|
108
|
+
scoreSub: '틀린 문제를 다시 풀어 보세요.',
|
|
109
|
+
// 올린 그림을 받지 못함 (10초 안에 받지 못함 · 서명 주소 만료). 그림 자리에 보인다
|
|
110
|
+
imageExpired: '이미지 주소가 만료되었습니다. 새로고침해 주세요.',
|
|
63
111
|
},
|
|
64
112
|
|
|
65
113
|
/** 문항 */
|
|
66
114
|
question: {
|
|
67
115
|
title: (no, title) => `${no}. ${title}`,
|
|
116
|
+
// 부분 점수 · 직접 배점일 때 문제 제목 옆 배점
|
|
117
|
+
points: (points) => `${points}점`,
|
|
68
118
|
correct: '정답입니다!',
|
|
69
119
|
wrong: '오답입니다. 다시 한번 풀어보세요.',
|
|
70
120
|
explanation: '퀴즈 해설 보기',
|
|
@@ -75,7 +125,7 @@ export const texts = {
|
|
|
75
125
|
answer: '답안',
|
|
76
126
|
// 순서 맞추기: 고를 개수(답안 칸 수)가 보기 수와 같으면 개수를 말하지 않는다
|
|
77
127
|
orderHint: (slots, total) =>
|
|
78
|
-
slots >= total ? '정답 순서대로 보기를
|
|
128
|
+
slots >= total ? '정답 순서대로 보기를 선택합니다.' : `정답 순서대로 보기를 ${slots}개 선택합니다.`,
|
|
79
129
|
orderReset: '답안 초기화',
|
|
80
130
|
// 고른 보기의 순서 (화면 읽기 프로그램용, 화면에는 번호만)
|
|
81
131
|
orderNo: (no) => `${no}번째`,
|
|
@@ -112,14 +162,8 @@ export const texts = {
|
|
|
112
162
|
answerDeleted: '정답을 삭제했습니다.',
|
|
113
163
|
fieldDeleted: name => `${name} 내용을 지웠습니다.`,
|
|
114
164
|
typeChanged: '유형을 바꿔 질문만 남기고 모두 초기화했습니다.',
|
|
115
|
-
// partial_pattern: 문제 수가 바뀌어(또는 저장된 점수가 규칙에 맞지 않아) 점수를 똑같이 나눠 저장함
|
|
116
|
-
scoresSplit: (scores) => {
|
|
117
|
-
const min = Math.min(...scores);
|
|
118
|
-
const extra = scores.filter((s) => s > min).length;
|
|
119
|
-
return `문제 수가 바뀌어 점수를 똑같이 나눠 저장합니다: 문제마다 ${min}점${extra ? `, 마지막 ${extra}문제는 ${min + 1}점` : ''}.`;
|
|
120
|
-
},
|
|
121
165
|
addQuestion: '+ 문제 추가',
|
|
122
|
-
questionLimit: '문제는 20개까지 만들 수
|
|
166
|
+
questionLimit: '문제는 20개까지 만들 수 있습니다.',
|
|
123
167
|
title: '질문',
|
|
124
168
|
description: '설명',
|
|
125
169
|
options: '보기',
|
|
@@ -142,7 +186,7 @@ export const texts = {
|
|
|
142
186
|
orderTitle: '정답 순서',
|
|
143
187
|
noneHintOrder: '정답 순서에 들어가지 않는 보기',
|
|
144
188
|
noneClose: '오답 보기 삭제',
|
|
145
|
-
noneRowMin: '오답 보기가 하나만
|
|
189
|
+
noneRowMin: '오답 보기가 하나만 남았습니다. 모두 지우려면 상자의 ✕로 닫아 주세요.',
|
|
146
190
|
noneDeleted: n => `오답 보기 ${n}개를 삭제했습니다.`,
|
|
147
191
|
answer: '정답',
|
|
148
192
|
// 정답으로 고른 보기 줄 끝에 보이는 표시
|
|
@@ -176,14 +220,30 @@ export const texts = {
|
|
|
176
220
|
imageBusy: '올리는 중…',
|
|
177
221
|
imageRemove: '이미지 지우기',
|
|
178
222
|
imageDeleted: '이미지를 삭제했습니다.',
|
|
179
|
-
imageNotImage: '이미지 파일만 넣을 수
|
|
180
|
-
imageUnreadable: '이미지를 읽지
|
|
181
|
-
imageTooBig: '이미지가 너무
|
|
182
|
-
|
|
183
|
-
|
|
223
|
+
imageNotImage: '이미지 파일만 넣을 수 있습니다.',
|
|
224
|
+
imageUnreadable: '이미지를 읽지 못했습니다. 다른 파일로 다시 시도해 주세요.',
|
|
225
|
+
imageTooBig: '이미지가 너무 큽니다. 더 작은 이미지를 올려 주세요.',
|
|
226
|
+
imageProgress: (percent) => `이미지 올리는 중… ${percent}%`,
|
|
227
|
+
imageTotal: (max) =>
|
|
228
|
+
`이미지는 퀴즈 전체에 ${max}개까지 넣을 수 있습니다. 안 쓰는 이미지는 글에서 지워 주세요.`,
|
|
184
229
|
// 코드 버튼을 글을 고르지 않고 누르면 넣는 글
|
|
185
230
|
codeSample: '코드',
|
|
186
231
|
},
|
|
232
|
+
/** 부분 채점 설정 (문제가 2개 이상일 때 맨 위) · 문제별 배점 (카드 머리) */
|
|
233
|
+
scoring: {
|
|
234
|
+
toggle: '부분 채점 허용',
|
|
235
|
+
hintOn: '일부만 맞혀도 맞힌 만큼 점수가 기록됩니다.',
|
|
236
|
+
hintOff: '하나라도 틀리면 0점이고, 모두 맞아야 100점으로 기록됩니다.',
|
|
237
|
+
points: (no) => `문제 ${no} 배점`,
|
|
238
|
+
unit: '점',
|
|
239
|
+
total: (sum) => `합계 ${sum} / 100점`,
|
|
240
|
+
over: '학생은 최대 100점까지 받을 수 있습니다.',
|
|
241
|
+
under: '합계는 100점 이상이어야 합니다.',
|
|
242
|
+
equal: '동일 점수로 적용하기',
|
|
243
|
+
equalLine: '문제마다 동일한 점수로 채점됩니다. 문제의 배점을 직접 수정할 수 있습니다.',
|
|
244
|
+
modeEqual: '자동 배점',
|
|
245
|
+
modeCustom: '직접 배점',
|
|
246
|
+
},
|
|
187
247
|
sortLabel: label => `${label} 순서 바꾸기 (끌거나 ↑ · ↓ 키)`,
|
|
188
248
|
sortTitle: '끌어서 순서 바꾸기',
|
|
189
249
|
up: '↑',
|
|
@@ -212,5 +272,8 @@ export const texts = {
|
|
|
212
272
|
groupName: '그룹 이름을 입력해 주세요.',
|
|
213
273
|
placeholderMax: max => `입력란 힌트는 ${max}자까지 입력할 수 있습니다.`,
|
|
214
274
|
explanation: '해설 내용을 입력해 주세요.',
|
|
275
|
+
// 부분 채점 배점 (문제가 2개 이상 · 부분 채점 허용일 때)
|
|
276
|
+
pointsInt: '배점은 0부터 100 사이의 정수로 입력해 주세요.',
|
|
277
|
+
pointsTotal: '배점 합계는 100점 이상이어야 합니다.',
|
|
215
278
|
},
|
|
216
279
|
};
|