@thanh01.pmt/curriculum-kit 1.4.43 → 1.4.45
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/dist/ai/index.cjs +66 -470
- package/dist/ai/index.cjs.map +1 -1
- package/dist/ai/index.d.cts +77 -77
- package/dist/ai/index.d.ts +77 -77
- package/dist/ai/index.mjs +64 -469
- package/dist/ai/index.mjs.map +1 -1
- package/dist/index.cjs +478 -837
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +124 -58
- package/dist/index.d.ts +124 -58
- package/dist/index.mjs +470 -829
- package/dist/index.mjs.map +1 -1
- package/dist/pipeline/index.cjs +99 -484
- package/dist/pipeline/index.cjs.map +1 -1
- package/dist/pipeline/index.mjs +97 -483
- package/dist/pipeline/index.mjs.map +1 -1
- package/dist/schemas/index.d.cts +1064 -1064
- package/dist/schemas/index.d.ts +1064 -1064
- package/dist/standards/index.d.cts +2 -2
- package/dist/standards/index.d.ts +2 -2
- package/dist/{standardsCoverageGate-49pJq5t8.d.cts → standardsCoverageGate-CLnq0d0s.d.cts} +12 -12
- package/dist/{standardsCoverageGate-49pJq5t8.d.ts → standardsCoverageGate-CLnq0d0s.d.ts} +12 -12
- package/dist/templates/ACT_template.md +18 -9
- package/dist/templates/ALIGNMENT_MATRIX_template.md +5 -0
- package/dist/templates/ART_DIRECTION_template.md +7 -0
- package/dist/templates/ASSET_MANIFEST_template.md +5 -0
- package/dist/templates/BASELINE_STANDARD.md +5 -0
- package/dist/templates/BELL_RINGER_template.md +13 -13
- package/dist/templates/CHANGELOG_template.md +3 -0
- package/dist/templates/CHOICE_BOARD_template.md +8 -5
- package/dist/templates/CODE_template.md +5 -6
- package/dist/templates/CONTENT_CONTINUITY_template.md +6 -0
- package/dist/templates/CONTENT_STYLE_GUIDE_template.md +4 -5
- package/dist/templates/CURRICULUM_FRAMEWORK_template.md +5 -6
- package/dist/templates/DEPENDENCY_MAP_template.md +3 -4
- package/dist/templates/EXIT_TICKET_template.md +8 -8
- package/dist/templates/EXT_template.md +3 -0
- package/dist/templates/GLOSSARY_template.md +1 -2
- package/dist/templates/GRAPHIC_ORGANIZER_template.md +8 -8
- package/dist/templates/GUIDE_template.md +5 -6
- package/dist/templates/HANDOUT_template.md +5 -6
- package/dist/templates/HANDOVER_DOCUMENT_template.md +8 -0
- package/dist/templates/KNOWLEDGE_EXPOSITION_template.md +16 -6
- package/dist/templates/LAB_TEMPLATE.md +78 -0
- package/dist/templates/LEARNER_PROFILE_template.md +4 -5
- package/dist/templates/LESSONS_LEARNED_template.md +8 -0
- package/dist/templates/LESSON_5E_template.md +24 -9
- package/dist/templates/LESSON_EDP_template.md +26 -10
- package/dist/templates/LESSON_GENERAL_template.md +22 -8
- package/dist/templates/OUTPUT_CONSTRAINTS_template.md +7 -0
- package/dist/templates/PACKAGING_SPEC_template.md +8 -0
- package/dist/templates/PILOT_FEEDBACK_template.md +6 -0
- package/dist/templates/PROJECT_BRIEF_template.md +8 -0
- package/dist/templates/PROJECT_STATUS_template.md +9 -0
- package/dist/templates/QUIZ_template.md +7 -0
- package/dist/templates/QUIZ_v4.6_template.md +4 -5
- package/dist/templates/REFERENCE_PACK_template.md +4 -0
- package/dist/templates/REVIEW_GAME_template.md +11 -8
- package/dist/templates/RUBRIC_template.md +2 -3
- package/dist/templates/SCIENCE_LAB_template.md +11 -5
- package/dist/templates/SECTION_LANGUAGE_CONTRACT_template.md +44 -0
- package/dist/templates/SELF_LAB_template.md +174 -0
- package/dist/templates/SLIDE_template.md +23 -0
- package/dist/templates/STATION_ROTATION_template.md +11 -11
- package/dist/templates/TASK_CARDS_template.md +8 -8
- package/dist/templates/TIERED_PRACTICE_template.md +14 -10
- package/dist/templates/UPDATE_ROADMAP_template.md +7 -0
- package/dist/templates/WKS_template.md +5 -6
- package/dist/workflow/index.cjs +250 -672
- package/dist/workflow/index.cjs.map +1 -1
- package/dist/workflow/index.d.cts +1 -1
- package/dist/workflow/index.d.ts +1 -1
- package/dist/workflow/index.mjs +248 -670
- package/dist/workflow/index.mjs.map +1 -1
- package/docs/refs/templates/ACT_template.md +18 -9
- package/docs/refs/templates/ALIGNMENT_MATRIX_template.md +5 -0
- package/docs/refs/templates/ART_DIRECTION_template.md +7 -0
- package/docs/refs/templates/ASSET_MANIFEST_template.md +5 -0
- package/docs/refs/templates/BASELINE_STANDARD.md +5 -0
- package/docs/refs/templates/BELL_RINGER_template.md +13 -13
- package/docs/refs/templates/CHANGELOG_template.md +3 -0
- package/docs/refs/templates/CHOICE_BOARD_template.md +8 -5
- package/docs/refs/templates/CODE_template.md +5 -6
- package/docs/refs/templates/CONTENT_CONTINUITY_template.md +6 -0
- package/docs/refs/templates/CONTENT_STYLE_GUIDE_template.md +4 -5
- package/docs/refs/templates/CURRICULUM_FRAMEWORK_template.md +5 -6
- package/docs/refs/templates/DEPENDENCY_MAP_template.md +3 -4
- package/docs/refs/templates/EXIT_TICKET_template.md +8 -8
- package/docs/refs/templates/EXT_template.md +3 -0
- package/docs/refs/templates/GLOSSARY_template.md +1 -2
- package/docs/refs/templates/GRAPHIC_ORGANIZER_template.md +8 -8
- package/docs/refs/templates/GUIDE_template.md +5 -6
- package/docs/refs/templates/HANDOUT_template.md +5 -6
- package/docs/refs/templates/HANDOVER_DOCUMENT_template.md +8 -0
- package/docs/refs/templates/KNOWLEDGE_EXPOSITION_template.md +16 -6
- package/docs/refs/templates/LAB_TEMPLATE.md +78 -0
- package/docs/refs/templates/LEARNER_PROFILE_template.md +4 -5
- package/docs/refs/templates/LESSONS_LEARNED_template.md +8 -0
- package/docs/refs/templates/LESSON_5E_template.md +24 -9
- package/docs/refs/templates/LESSON_EDP_template.md +26 -10
- package/docs/refs/templates/LESSON_GENERAL_template.md +22 -8
- package/docs/refs/templates/OUTPUT_CONSTRAINTS_template.md +7 -0
- package/docs/refs/templates/PACKAGING_SPEC_template.md +8 -0
- package/docs/refs/templates/PILOT_FEEDBACK_template.md +6 -0
- package/docs/refs/templates/PROJECT_BRIEF_template.md +8 -0
- package/docs/refs/templates/PROJECT_STATUS_template.md +9 -0
- package/docs/refs/templates/QUIZ_template.md +7 -0
- package/docs/refs/templates/QUIZ_v4.6_template.md +4 -5
- package/docs/refs/templates/REFERENCE_PACK_template.md +4 -0
- package/docs/refs/templates/REVIEW_GAME_template.md +11 -8
- package/docs/refs/templates/RUBRIC_template.md +2 -3
- package/docs/refs/templates/SCIENCE_LAB_template.md +11 -5
- package/docs/refs/templates/SECTION_LANGUAGE_CONTRACT_template.md +44 -0
- package/docs/refs/templates/SELF_LAB_template.md +174 -0
- package/docs/refs/templates/SLIDE_template.md +23 -0
- package/docs/refs/templates/STATION_ROTATION_template.md +11 -11
- package/docs/refs/templates/TASK_CARDS_template.md +8 -8
- package/docs/refs/templates/TIERED_PRACTICE_template.md +14 -10
- package/docs/refs/templates/UPDATE_ROADMAP_template.md +7 -0
- package/docs/refs/templates/WKS_template.md +5 -6
- package/package.json +1 -1
package/dist/workflow/index.cjs
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var fs2 = require('fs');
|
|
4
4
|
var path = require('path');
|
|
5
5
|
var google = require('@ai-sdk/google');
|
|
6
6
|
var openai = require('@ai-sdk/openai');
|
|
7
7
|
var deepseek = require('@ai-sdk/deepseek');
|
|
8
|
+
var url = require('url');
|
|
8
9
|
var ai = require('ai');
|
|
9
10
|
var zod = require('zod');
|
|
10
11
|
var workflow = require('workflow');
|
|
11
|
-
var
|
|
12
|
+
var fs3 = require('fs/promises');
|
|
12
13
|
var rest = require('@octokit/rest');
|
|
13
14
|
var supabaseJs = require('@supabase/supabase-js');
|
|
14
15
|
require('crypto');
|
|
15
|
-
var url = require('url');
|
|
16
16
|
|
|
17
17
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
18
18
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
19
|
|
|
20
|
-
var fs5__default = /*#__PURE__*/_interopDefault(fs5);
|
|
21
|
-
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
22
20
|
var fs2__default = /*#__PURE__*/_interopDefault(fs2);
|
|
21
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
22
|
+
var fs3__default = /*#__PURE__*/_interopDefault(fs3);
|
|
23
23
|
|
|
24
24
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
25
25
|
var __esm = (fn, res) => function __init() {
|
|
@@ -160,8 +160,8 @@ function resolveApiKey(keyName, explicitKey) {
|
|
|
160
160
|
path__default.default.resolve(currentDir, "../..", ".env")
|
|
161
161
|
];
|
|
162
162
|
for (const envPath of envPaths) {
|
|
163
|
-
if (
|
|
164
|
-
const content =
|
|
163
|
+
if (fs2__default.default.existsSync(envPath)) {
|
|
164
|
+
const content = fs2__default.default.readFileSync(envPath, "utf-8");
|
|
165
165
|
for (const line of content.split("\n")) {
|
|
166
166
|
const trimmed = line.trim();
|
|
167
167
|
if (trimmed && !trimmed.startsWith("#") && trimmed.startsWith(keyName + "=")) {
|
|
@@ -1136,10 +1136,138 @@ var init_provider_factory = __esm({
|
|
|
1136
1136
|
};
|
|
1137
1137
|
}
|
|
1138
1138
|
});
|
|
1139
|
+
function stripTemplateFrontmatter(raw) {
|
|
1140
|
+
let body = raw;
|
|
1141
|
+
if (body.startsWith("---")) {
|
|
1142
|
+
const end = body.indexOf("\n---", 3);
|
|
1143
|
+
if (end !== -1) body = body.slice(end + 4);
|
|
1144
|
+
}
|
|
1145
|
+
return body.split("\n").filter((l) => l.trim() !== "<!-- INJECT_BODY -->").join("\n").replace(/^\s*\n/, "").trimEnd();
|
|
1146
|
+
}
|
|
1147
|
+
function stripHeadingKey(h) {
|
|
1148
|
+
return h.replace(/\[(REQUIRED|OPTIONAL|CONDITIONAL)\]\s*/gi, "").replace(/^\s*\d+[.)]\s+/, "").replace(/\s+/g, " ").trim();
|
|
1149
|
+
}
|
|
1150
|
+
function isVariableHeading(text) {
|
|
1151
|
+
return /\{\{[^}]*\}\}/.test(text) || /\[[^\]]+\]/.test(text);
|
|
1152
|
+
}
|
|
1153
|
+
function collectHeadings(body) {
|
|
1154
|
+
const out = [];
|
|
1155
|
+
let inFence = false;
|
|
1156
|
+
for (const line of body.split("\n")) {
|
|
1157
|
+
if (/^(```|~~~)/.test(line.trim())) {
|
|
1158
|
+
inFence = !inFence;
|
|
1159
|
+
continue;
|
|
1160
|
+
}
|
|
1161
|
+
if (inFence) continue;
|
|
1162
|
+
const m = line.match(/^(#{2,3})\s+(.*)$/);
|
|
1163
|
+
if (!m) continue;
|
|
1164
|
+
const text = m[2].trim();
|
|
1165
|
+
const optional = /^\[OPTIONAL\]/i.test(text);
|
|
1166
|
+
const name = stripHeadingKey(text);
|
|
1167
|
+
if (!name || isVariableHeading(name)) continue;
|
|
1168
|
+
out.push({ level: m[1].length, name, optional });
|
|
1169
|
+
}
|
|
1170
|
+
return out;
|
|
1171
|
+
}
|
|
1172
|
+
function extractEchoSections(raw) {
|
|
1173
|
+
const hs = collectHeadings(stripTemplateFrontmatter(raw));
|
|
1174
|
+
return {
|
|
1175
|
+
required: hs.filter((h) => !h.optional).map((h) => h.name),
|
|
1176
|
+
optional: hs.filter((h) => h.optional).map((h) => h.name)
|
|
1177
|
+
};
|
|
1178
|
+
}
|
|
1179
|
+
function extractConditionalSections(raw) {
|
|
1180
|
+
const body = stripTemplateFrontmatter(raw);
|
|
1181
|
+
return body.split("\n").filter((l) => /^#{2,3} .*\[CONDITIONAL\]/i.test(l)).map((l) => stripHeadingKey(l.replace(/^#{2,3}\s*/, "").trim())).filter((s) => s.length > 0 && !isVariableHeading(s));
|
|
1182
|
+
}
|
|
1183
|
+
function extractDeclaredLanguage(raw) {
|
|
1184
|
+
const m = raw.match(/^template_language:\s*["']?([a-zA-Z-]+)["']?\s*$/m);
|
|
1185
|
+
return m?.[1]?.toLowerCase() || "en";
|
|
1186
|
+
}
|
|
1187
|
+
function candidateDirs(explicitDir) {
|
|
1188
|
+
const dirs = [];
|
|
1189
|
+
if (process.env.CURRICULUM_TEMPLATES_DIR) dirs.push(process.env.CURRICULUM_TEMPLATES_DIR);
|
|
1190
|
+
dirs.push(path__default.default.resolve(process.cwd(), "_templates"));
|
|
1191
|
+
for (const rel of KIT_TEMPLATE_FALLBACK_DIRS) {
|
|
1192
|
+
dirs.push(path__default.default.resolve(_moduleDir, rel));
|
|
1193
|
+
dirs.push(path__default.default.resolve(process.cwd(), rel));
|
|
1194
|
+
dirs.push(path__default.default.resolve(process.cwd(), "packages/curriculum-kit", rel));
|
|
1195
|
+
}
|
|
1196
|
+
return dirs;
|
|
1197
|
+
}
|
|
1198
|
+
function findTemplatePath(templateName, explicitDir) {
|
|
1199
|
+
for (const dir of candidateDirs()) {
|
|
1200
|
+
const p = path__default.default.join(dir, templateName);
|
|
1201
|
+
if (!fs2__default.default.existsSync(p)) continue;
|
|
1202
|
+
try {
|
|
1203
|
+
fs2__default.default.accessSync(p, fs2__default.default.constants.R_OK);
|
|
1204
|
+
return p;
|
|
1205
|
+
} catch {
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
return null;
|
|
1209
|
+
}
|
|
1210
|
+
function resolveArtifactTemplate(templateName, opts) {
|
|
1211
|
+
const p = findTemplatePath(templateName);
|
|
1212
|
+
if (!p) return null;
|
|
1213
|
+
try {
|
|
1214
|
+
const raw = fs2__default.default.readFileSync(p, "utf-8");
|
|
1215
|
+
const echo = extractEchoSections(raw);
|
|
1216
|
+
return {
|
|
1217
|
+
content: stripTemplateFrontmatter(raw),
|
|
1218
|
+
sections: echo.required,
|
|
1219
|
+
optionalSections: echo.optional,
|
|
1220
|
+
sourcePath: p,
|
|
1221
|
+
conditionals: extractConditionalSections(raw),
|
|
1222
|
+
declaredLang: extractDeclaredLanguage(raw)
|
|
1223
|
+
};
|
|
1224
|
+
} catch {
|
|
1225
|
+
return null;
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
function loadCurriculumTemplate(templateName, templatesDir) {
|
|
1229
|
+
const p = findTemplatePath(templateName);
|
|
1230
|
+
if (!p) return "";
|
|
1231
|
+
try {
|
|
1232
|
+
return fs2__default.default.readFileSync(p, "utf-8");
|
|
1233
|
+
} catch {
|
|
1234
|
+
return "";
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
function loadAuthoringTemplate(templateName, templatesDir) {
|
|
1238
|
+
const p = findTemplatePath(templateName);
|
|
1239
|
+
if (!p) return "";
|
|
1240
|
+
try {
|
|
1241
|
+
return stripTemplateFrontmatter(fs2__default.default.readFileSync(p, "utf-8"));
|
|
1242
|
+
} catch {
|
|
1243
|
+
return "";
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
var KIT_TEMPLATE_FALLBACK_DIRS, _moduleDir;
|
|
1247
|
+
var init_templateLoader = __esm({
|
|
1248
|
+
"src/services/templateLoader.ts"() {
|
|
1249
|
+
KIT_TEMPLATE_FALLBACK_DIRS = [
|
|
1250
|
+
// Packaged with the npm bundle (dist/templates) — resolves from node_modules.
|
|
1251
|
+
"templates",
|
|
1252
|
+
// Repo checkout layouts.
|
|
1253
|
+
"docs/refs/templates"
|
|
1254
|
+
];
|
|
1255
|
+
_moduleDir = (() => {
|
|
1256
|
+
try {
|
|
1257
|
+
if (typeof ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)) }) !== "undefined" && typeof (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)) === "string") {
|
|
1258
|
+
return path__default.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
|
|
1259
|
+
}
|
|
1260
|
+
} catch {
|
|
1261
|
+
}
|
|
1262
|
+
return typeof __dirname !== "undefined" ? __dirname : process.cwd();
|
|
1263
|
+
})();
|
|
1264
|
+
}
|
|
1265
|
+
});
|
|
1139
1266
|
|
|
1140
1267
|
// src/parsers/lessonFlowParser.ts
|
|
1141
1268
|
var init_lessonFlowParser = __esm({
|
|
1142
1269
|
"src/parsers/lessonFlowParser.ts"() {
|
|
1270
|
+
init_templateLoader();
|
|
1143
1271
|
}
|
|
1144
1272
|
});
|
|
1145
1273
|
|
|
@@ -2754,468 +2882,8 @@ zod.z.object({
|
|
|
2754
2882
|
phases: zod.z.array(PhaseInputSchema).default([])
|
|
2755
2883
|
});
|
|
2756
2884
|
|
|
2757
|
-
// src/templates/lessonTemplate.ts
|
|
2758
|
-
var LESSON_PLAN_TEMPLATE = `
|
|
2759
|
-
---
|
|
2760
|
-
id: "{{ID}}"
|
|
2761
|
-
title: "{{TITLE}}"
|
|
2762
|
-
type: "LESSON_5E"
|
|
2763
|
-
created_by: "Curriculum OS Builder"
|
|
2764
|
-
phase: "{{PHASE}}"
|
|
2765
|
-
deliverable: "P3-T1"
|
|
2766
|
-
version: "{{VERSION}}"
|
|
2767
|
-
date: "{{DATE}}"
|
|
2768
|
-
prerequisite: []
|
|
2769
|
-
template_contract: "lesson-plan-v2"
|
|
2770
|
-
template_required_sections:
|
|
2771
|
-
- "A. Lesson Design Plan"
|
|
2772
|
-
- "Learning Objectives & Evidence"
|
|
2773
|
-
- "Activity Sequence"
|
|
2774
|
-
- "Resource Map"
|
|
2775
|
-
- "Assessment Map"
|
|
2776
|
-
- "Artifact Contract"
|
|
2777
|
-
- "B. Lesson Flow"
|
|
2778
|
-
---
|
|
2779
|
-
<!-- INJECT_BODY -->
|
|
2780
|
-
|
|
2781
|
-
# LESSON [{{LESSON_ID}}]: {{TITLE}} (5E Model)
|
|
2782
|
-
|
|
2783
|
-
## [REQUIRED] A. Lesson Design Plan
|
|
2784
|
-
|
|
2785
|
-
### 1. Learning Objectives & Evidence
|
|
2786
|
-
- **Estimated Duration:** {{DURATION}}
|
|
2787
|
-
- **Materials & Equipment:** {{MATERIALS_SUMMARY}}
|
|
2788
|
-
- **Keywords / Core Concepts:** {{KEYWORDS}}
|
|
2789
|
-
|
|
2790
|
-
| LO | Objective (Bloom's) | Student Evidence | Success Criteria |
|
|
2791
|
-
|---|---|---|---|
|
|
2792
|
-
{{LEARNING_OBJECTIVES_TABLE_ROWS}}
|
|
2793
|
-
|
|
2794
|
-
### 2. Activity Sequence
|
|
2795
|
-
> This is the canonical activity contract. Satellite artifacts must expand this sequence and must not invent a different one.
|
|
2796
|
-
|
|
2797
|
-
| Seq | 5E Phase | Activity Type | Actor | Purpose | Student Action | Teacher Move | Output/Evidence | LO | Time | Artifact Contract |
|
|
2798
|
-
|---|---|---|---|---|---|---|---|---|---|---|
|
|
2799
|
-
{{ACTIVITY_SEQUENCE_TABLE_ROWS}}
|
|
2800
|
-
|
|
2801
|
-
### 3. Resource Map
|
|
2802
|
-
| Resource | Used In Activity | Purpose | Owner Artifact |
|
|
2803
|
-
|---|---|---|---|
|
|
2804
|
-
{{RESOURCE_MAP_TABLE_ROWS}}
|
|
2805
|
-
|
|
2806
|
-
### 4. Assessment Map
|
|
2807
|
-
| Evidence | Assessed By | Criteria | Follow-up If Missing |
|
|
2808
|
-
|---|---|---|---|
|
|
2809
|
-
{{ASSESSMENT_MAP_TABLE_ROWS}}
|
|
2810
|
-
|
|
2811
|
-
### 5. Artifact Contract
|
|
2812
|
-
- **ACT must expand:** {{ACT_CONTRACT}}
|
|
2813
|
-
- **GUIDE must support:** {{GUIDE_CONTRACT}}
|
|
2814
|
-
- **SLIDE must visualize:** {{SLIDE_CONTRACT}}
|
|
2815
|
-
- **HANDOUT must provide:** {{HANDOUT_CONTRACT}}
|
|
2816
|
-
- **WKS must practice:** {{WKS_CONTRACT}}
|
|
2817
|
-
- **QUIZ must assess:** {{QUIZ_CONTRACT}}
|
|
2818
|
-
- **EXT must extend:** {{EXT_CONTRACT}}
|
|
2819
|
-
|
|
2820
|
-
---
|
|
2821
|
-
|
|
2822
|
-
## [REQUIRED] B. Lesson Flow
|
|
2823
|
-
|
|
2824
|
-
### 1. ENGAGE \u2014 {{ENGAGE_DURATION}} mins
|
|
2825
|
-
- **Hook Scenario:** {{HOOK_SCENARIO}}
|
|
2826
|
-
- **Open Question:** {{HOOK_OPEN_QUESTION}}
|
|
2827
|
-
- **Transition:** {{HOOK_TRANSITION}}
|
|
2828
|
-
|
|
2829
|
-
### 2. EXPLORE \u2014 {{EXPLORE_DURATION}} mins
|
|
2830
|
-
- **Activity Reference:** {{EXPLORE_ACTIVITY_REF}}
|
|
2831
|
-
- **Student Discovery:** {{EXPLORE_STUDENT_DISCOVERY}}
|
|
2832
|
-
|
|
2833
|
-
### 3. EXPLAIN \u2014 {{EXPLAIN_DURATION}} mins
|
|
2834
|
-
- **Definitions:**
|
|
2835
|
-
{{EXPLAIN_DEFINITIONS}}
|
|
2836
|
-
- **Visual Illustration (REQUIRED):**
|
|
2837
|
-
{{EXPLAIN_VISUAL_ILLUSTRATION}}
|
|
2838
|
-
|
|
2839
|
-
### 4. ELABORATE \u2014 {{ELABORATE_DURATION}} mins
|
|
2840
|
-
- **Tiered Scaffolding:**
|
|
2841
|
-
- \u{1F949} **Bronze:** {{DIFFERENTIATION_BRONZE}}
|
|
2842
|
-
- \u{1F948} **Silver:** {{DIFFERENTIATION_SILVER}}
|
|
2843
|
-
- \u{1F947} **Gold:** {{DIFFERENTIATION_GOLD}}
|
|
2844
|
-
|
|
2845
|
-
> **ACT Contract**: Detailed operational instructions must expand the Activity Sequence above and must not change the planned evidence target.
|
|
2846
|
-
|
|
2847
|
-
### 5. EVALUATE \u2014 {{EVALUATE_DURATION}} mins
|
|
2848
|
-
- **Exit Ticket:** {{EXIT_TICKET_CONTENT}}
|
|
2849
|
-
- **Closing:** {{CLOSING_REMARKS}}
|
|
2850
|
-
|
|
2851
|
-
> **QUIZ Contract**: Detailed assessment criteria and rubrics must assess the evidence and success criteria defined in the Lesson Design Plan.
|
|
2852
|
-
|
|
2853
|
-
---
|
|
2854
|
-
|
|
2855
|
-
## [OPTIONAL] Teacher Notes
|
|
2856
|
-
- **Common Pitfalls:**
|
|
2857
|
-
{{COMMON_PITFALLS}}
|
|
2858
|
-
- **Troubleshooting:**
|
|
2859
|
-
{{TROUBLESHOOTING_ROWS}}
|
|
2860
|
-
|
|
2861
|
-
---
|
|
2862
|
-
|
|
2863
|
-
## [REQUIRED] Artifact Linkage (Master Index)
|
|
2864
|
-
> List all satellite files used in this lesson.
|
|
2865
|
-
|
|
2866
|
-
| Artifact File | Role in the Classroom | When to Use |
|
|
2867
|
-
|---|---|---|
|
|
2868
|
-
| \`GUIDE_{{LESSON_ID}}.md\` | Detailed Teaching Script | Teacher preparation |
|
|
2869
|
-
| \`SLIDE_{{LESSON_ID}}.md\` | Presentation Content | Throughout the session |
|
|
2870
|
-
| \`HANDOUT_{{LESSON_ID}}.md\` | Theory Summary for Students | During EXPLAIN phase |
|
|
2871
|
-
| \`ACT_{{LESSON_ID}}.md\` | Detailed Learning Activity Operations | During EXPLORE / ELABORATE / checkpoint phases |
|
|
2872
|
-
| \`WKS_{{LESSON_ID}}.md\` | Individual Worksheet | Wrap-up or Homework |
|
|
2873
|
-
| \`QUIZ_{{LESSON_ID}}.md\` | Assessment Rubric | During EVALUATE phase |
|
|
2874
|
-
| \`EXT_{{LESSON_ID}}.md\` | Enrichment Materials | For "Gold" students |
|
|
2875
|
-
`.trim();
|
|
2876
|
-
|
|
2877
|
-
// src/templates/actTemplate.ts
|
|
2878
|
-
var ACT_TEMPLATE = `
|
|
2879
|
-
---
|
|
2880
|
-
id: "{{ID}}"
|
|
2881
|
-
title: "{{TITLE}}"
|
|
2882
|
-
type: "ACT"
|
|
2883
|
-
created_by: "Curriculum OS Builder"
|
|
2884
|
-
phase: "{{PHASE}}"
|
|
2885
|
-
deliverable: "P3-T2"
|
|
2886
|
-
version: "{{VERSION}}"
|
|
2887
|
-
date: "{{DATE}}"
|
|
2888
|
-
template_contract: "artifact-template-v1"
|
|
2889
|
-
template_required_sections:
|
|
2890
|
-
- "Computational Thinking Focus"
|
|
2891
|
-
- "Materials & Setup"
|
|
2892
|
-
- "Constraints & Safety"
|
|
2893
|
-
- "Active Learning Workflow"
|
|
2894
|
-
- "3-Tier Differentiation"
|
|
2895
|
-
- "Reflection"
|
|
2896
|
-
---
|
|
2897
|
-
<!-- INJECT_BODY -->
|
|
2898
|
-
|
|
2899
|
-
# INQUIRY-BASED ACTIVITY: {{TITLE}}
|
|
2900
|
-
_Milestone: {{MILESTONE_ID}} | Module: {{MODULE_NAME}} | Lesson: {{LESSON_ID}}_
|
|
2901
|
-
|
|
2902
|
-
## [REQUIRED] Computational Thinking Focus
|
|
2903
|
-
- **Problem Statement (Real-world Scenario):** {{PROBLEM_STATEMENT}}
|
|
2904
|
-
- **Decomposition:**
|
|
2905
|
-
{{DECOMPOSITION_STEPS}}
|
|
2906
|
-
- **Algorithm Design:** {{ALGORITHM_DESIGN}}
|
|
2907
|
-
|
|
2908
|
-
## [REQUIRED] Materials & Setup
|
|
2909
|
-
- **Reference Material:** Students should use the **HANDOUT** for this lesson as their primary technical reference (lifeline).
|
|
2910
|
-
- **Hardware/Software:**
|
|
2911
|
-
<!-- [HARDWARE_BOM] -->
|
|
2912
|
-
{{HARDWARE_ITEMS}}
|
|
2913
|
-
<!-- [/HARDWARE_BOM] -->
|
|
2914
|
-
- **Software:** {{SOFTWARE_ITEMS}}
|
|
2915
|
-
- **Consumables:** {{CONSUMABLES}}
|
|
2916
|
-
- **Other Resources:** {{OTHER_RESOURCES}}
|
|
2917
|
-
|
|
2918
|
-
## [REQUIRED] Constraints & Safety
|
|
2919
|
-
- \u26A0\uFE0F **Technical/Safety:** {{SAFETY_WARNING}}
|
|
2920
|
-
- \u{1F4A1} **Design Constraint:** {{DESIGN_CONSTRAINT}}
|
|
2921
|
-
|
|
2922
|
-
## [REQUIRED] Active Learning Workflow
|
|
2923
|
-
|
|
2924
|
-
### Phase 1: Planning & Design \u2014 {{PHASE1_DURATION}} mins
|
|
2925
|
-
- **Student Task:** Hand-draw (or draft in words) the algorithm flowchart or connection architecture before touching the computer/devices.
|
|
2926
|
-
- **Teacher Action:** Walk around to check the logic of each group. Ask inquiry questions:
|
|
2927
|
-
{{PHASE1_INQUIRY_QUESTIONS}}
|
|
2928
|
-
|
|
2929
|
-
### Phase 2: Implementation & Discovery \u2014 {{PHASE2_DURATION}} mins
|
|
2930
|
-
- **Student Task:** Apply the knowledge from the **HANDOUT** to realize the plan designed in Phase 1. Encourage self-inquiry and documentation lookup.
|
|
2931
|
-
- **Teacher Action:** Avoid "hand-holding." Only intervene if a group has been stuck for more than 5 minutes.
|
|
2932
|
-
{{PHASE2_GUIDANCE_BLOCK}}
|
|
2933
|
-
|
|
2934
|
-
### Phase 3: Debugging & Testing \u2014 {{PHASE3_DURATION}} mins
|
|
2935
|
-
- **Testing:** Students run their system.
|
|
2936
|
-
- **Error Analysis:** Ask students to record any error codes or unexpected behaviors and compare them with the Troubleshooting table in the Handout.
|
|
2937
|
-
{{PHASE3_TESTING_STEPS}}
|
|
2938
|
-
|
|
2939
|
-
## [REQUIRED] 3-Tier Differentiation
|
|
2940
|
-
> MUST design tasks in 3 tiers to support diverse learner groups. Bronze is the minimum requirement for all students.
|
|
2941
|
-
- \u{1F949} **Bronze (Foundational):** {{DIFFERENTIATION_BRONZE}}
|
|
2942
|
-
- \u{1F948} **Silver (Application):** {{DIFFERENTIATION_SILVER}}
|
|
2943
|
-
- \u{1F947} **Gold (Enrichment/Creative):** {{DIFFERENTIATION_GOLD}}
|
|
2944
|
-
|
|
2945
|
-
## [REQUIRED] Reflection
|
|
2946
|
-
- **Discussion Question:** {{REFLECTION_QUESTION}}
|
|
2947
|
-
`.trim();
|
|
2948
|
-
|
|
2949
|
-
// src/templates/codeLabTemplate.ts
|
|
2950
|
-
var CODE_LAB_TEMPLATE = `
|
|
2951
|
-
---
|
|
2952
|
-
id: "{{ID}}"
|
|
2953
|
-
title: "{{TITLE}}"
|
|
2954
|
-
type: "LAB"
|
|
2955
|
-
created_by: "Curriculum OS Builder"
|
|
2956
|
-
phase: "{{PHASE}}"
|
|
2957
|
-
deliverable: "P3-T2"
|
|
2958
|
-
version: "{{VERSION}}"
|
|
2959
|
-
date: "{{DATE}}"
|
|
2960
|
-
---
|
|
2961
|
-
<!-- INJECT_BODY -->
|
|
2962
|
-
|
|
2963
|
-
# \u{1F468}\u200D\u{1F4BB} CODE LAB: {{TITLE}}
|
|
2964
|
-
_Milestone: {{MILESTONE_ID}} | Tech Stack: {{TECH_STACK}}_
|
|
2965
|
-
|
|
2966
|
-
## \u{1F3AF} Overview
|
|
2967
|
-
This lab focuses on the practical implementation of core technical concepts, bridging theory into working, robust, and testable code.
|
|
2968
|
-
|
|
2969
|
-
## \u{1F6E0}\uFE0F Environment & Setup
|
|
2970
|
-
- **Language / Framework:** {{LANGUAGE_FRAMEWORK}}
|
|
2971
|
-
- **IDE / Editor:** {{IDE_EDITOR}}
|
|
2972
|
-
- **Required Libraries:** {{REQUIRED_LIBRARIES}}
|
|
2973
|
-
- **Hardware / Connection Setup:** {{HARDWARE_ENV_CONNECTION}}
|
|
2974
|
-
|
|
2975
|
-
## \u{1F4DD} Lab Tasks (3-Tier Differentiation)
|
|
2976
|
-
|
|
2977
|
-
### \u{1F949} Bronze (Foundational) \u2014 {{BRONZE_MINS}} mins
|
|
2978
|
-
**Objective:** {{BRONZE_OBJECTIVE}}
|
|
2979
|
-
- **Task:** {{BRONZE_TASK}}
|
|
2980
|
-
- **Requirement:** {{BRONZE_REQUIREMENT}}
|
|
2981
|
-
|
|
2982
|
-
### \u{1F948} Silver (Application) \u2014 {{SILVER_MINS}} mins
|
|
2983
|
-
**Objective:** {{SILVER_OBJECTIVE}}
|
|
2984
|
-
- **Task:** {{SILVER_TASK}}
|
|
2985
|
-
- **Requirement:** {{SILVER_REQUIREMENT}}
|
|
2986
|
-
|
|
2987
|
-
### \u{1F947} Gold (Enrichment/Creative) \u2014 {{GOLD_MINS}} mins
|
|
2988
|
-
**Objective:** {{GOLD_OBJECTIVE}}
|
|
2989
|
-
- **Task:** {{GOLD_TASK}}
|
|
2990
|
-
- **Requirement:** {{GOLD_REQUIREMENT}}
|
|
2991
|
-
|
|
2992
|
-
## \u{1F4BB} Technical Reference ([SME_MANDATE])
|
|
2993
|
-
<!-- [SME_MANDATE] -->
|
|
2994
|
-
> Any code provided in this section is verified for syntax accuracy and runtime execution.
|
|
2995
|
-
|
|
2996
|
-
### Starter Code Template
|
|
2997
|
-
\`\`\`{{CODE_LANGUAGE}}
|
|
2998
|
-
{{STARTER_CODE}}
|
|
2999
|
-
\`\`\`
|
|
3000
|
-
|
|
3001
|
-
### Solution Code
|
|
3002
|
-
\`\`\`{{CODE_LANGUAGE}}
|
|
3003
|
-
{{SOLUTION_CODE}}
|
|
3004
|
-
\`\`\`
|
|
3005
|
-
<!-- [/SME_MANDATE] -->
|
|
3006
|
-
|
|
3007
|
-
## \u{1F50D} Troubleshooting & Debugging Matrix
|
|
3008
|
-
| Issue | Potential Cause | Solution |
|
|
3009
|
-
| :--- | :--- | :--- |
|
|
3010
|
-
{{TROUBLESHOOTING_ROWS}}
|
|
3011
|
-
|
|
3012
|
-
## \u{1F3C1} Submission & Verification Checklist
|
|
3013
|
-
{{CHECKLIST_ITEMS}}
|
|
3014
|
-
`.trim();
|
|
3015
|
-
|
|
3016
|
-
// src/templates/quizTemplate.ts
|
|
3017
|
-
var QUIZ_TEMPLATE = `
|
|
3018
|
-
---
|
|
3019
|
-
id: "{{ID}}"
|
|
3020
|
-
title: "{{TITLE}}"
|
|
3021
|
-
type: "QUIZ"
|
|
3022
|
-
language: "{{LANGUAGE}}"
|
|
3023
|
-
total_questions: {{TOTAL_QUESTIONS}}
|
|
3024
|
-
passing_score_pct: {{PASSING_SCORE_PCT}}
|
|
3025
|
-
---
|
|
3026
|
-
|
|
3027
|
-
# \u{1F9E0} Diagnostic & Active Recall Quiz: {{TITLE}}
|
|
3028
|
-
|
|
3029
|
-
> \u23F1\uFE0F **Recommended Time:** ~10-15 mins
|
|
3030
|
-
> \u{1F3AF} **Passing Score:** {{PASSING_SCORE_PCT}}%
|
|
3031
|
-
> \u{1F4A1} **Purpose:** Test your conceptual understanding, catch hidden misconceptions, and evaluate architectural trade-offs.
|
|
3032
|
-
|
|
3033
|
-
---
|
|
3034
|
-
|
|
3035
|
-
{{QUESTIONS_SECTION}}
|
|
3036
|
-
|
|
3037
|
-
---
|
|
3038
|
-
|
|
3039
|
-
## \u{1F511} Comprehensive Answer Key & Deep Explanation (Expand after completing)
|
|
3040
|
-
<details>
|
|
3041
|
-
<summary><b>\u{1F449} Click to View Full Explanations & Common Pitfall Analysis</b></summary>
|
|
3042
|
-
|
|
3043
|
-
{{ANSWER_KEY_SECTION}}
|
|
3044
|
-
</details>
|
|
3045
|
-
`.trim();
|
|
3046
|
-
|
|
3047
|
-
// src/templates/selfLabTemplate.ts
|
|
3048
|
-
var SELF_LAB_TEMPLATE = `
|
|
3049
|
-
---
|
|
3050
|
-
id: "{{ID}}"
|
|
3051
|
-
title: "{{TITLE}}"
|
|
3052
|
-
type: "SELF_LAB"
|
|
3053
|
-
language: "{{LANGUAGE}}"
|
|
3054
|
-
difficulty: "{{DIFFICULTY}}"
|
|
3055
|
-
estimated_minutes: {{ESTIMATED_MINUTES}}
|
|
3056
|
-
tech_stack: {{TECH_STACK}}
|
|
3057
|
-
---
|
|
3058
|
-
|
|
3059
|
-
# \u{1F680} Self-Paced Hands-On Lab: {{TITLE}}
|
|
3060
|
-
|
|
3061
|
-
> \u23F1\uFE0F **Estimated Duration:** ~{{ESTIMATED_MINUTES}} mins
|
|
3062
|
-
> \u{1F3AF} **Difficulty Level:** {{DIFFICULTY_UPPER}}
|
|
3063
|
-
> \u{1F9F0} **Tech Stack:** {{TECH_STACK_STR}}
|
|
3064
|
-
> \u{1F4A1} **Self-Learner Notice:** You are in full control of this lab. Follow the progressive challenges below. If you get stuck at any point, use the **Progressive Hints System** to get unstuck without ruining the learning experience!
|
|
3065
|
-
|
|
3066
|
-
---
|
|
3067
|
-
|
|
3068
|
-
## \u{1F4CB} Mission Briefing & Environment Setup
|
|
3069
|
-
{{MISSION_BRIEFING}}
|
|
3070
|
-
|
|
3071
|
-
### \u{1F6EB} Preflight Checklist
|
|
3072
|
-
{{PREFLIGHT_CHECKLIST}}
|
|
3073
|
-
|
|
3074
|
-
---
|
|
3075
|
-
|
|
3076
|
-
## \u{1F3AF} Progressive Challenges (3-Tier Differentiation)
|
|
3077
|
-
|
|
3078
|
-
### \u{1F949} Challenge 1: Foundational Core (Bronze) \u2014 ~{{BRONZE_MINS}} mins
|
|
3079
|
-
**Objective:** {{BRONZE_OBJECTIVE}}
|
|
3080
|
-
|
|
3081
|
-
#### Tasks & Implementation Details:
|
|
3082
|
-
{{BRONZE_TASKS}}
|
|
3083
|
-
|
|
3084
|
-
#### \u{1F9EA} Self-Verification Command:
|
|
3085
|
-
\`\`\`bash
|
|
3086
|
-
{{BRONZE_VERIFY_COMMAND}}
|
|
3087
|
-
\`\`\`
|
|
3088
|
-
*Expected Terminal Output:*
|
|
3089
|
-
\`\`\`text
|
|
3090
|
-
{{BRONZE_EXPECTED_OUTPUT}}
|
|
3091
|
-
\`\`\`
|
|
3092
|
-
|
|
3093
|
-
#### \u{1F4A1} Progressive Hints (Expand only if stuck):
|
|
3094
|
-
<details>
|
|
3095
|
-
<summary><b>\u{1F4A1} Hint Level 1: Conceptual Clue (H\u01B0\u1EDBng t\u01B0 duy)</b></summary>
|
|
3096
|
-
|
|
3097
|
-
{{BRONZE_HINT_1}}
|
|
3098
|
-
</details>
|
|
3099
|
-
|
|
3100
|
-
<details>
|
|
3101
|
-
<summary><b>\u{1F50D} Hint Level 2: Structural Skeleton (Khung code m\u1EABu)</b></summary>
|
|
3102
|
-
|
|
3103
|
-
\`\`\`{{CODE_LANGUAGE}}
|
|
3104
|
-
{{BRONZE_HINT_2}}
|
|
3105
|
-
\`\`\`
|
|
3106
|
-
</details>
|
|
3107
|
-
|
|
3108
|
-
<details>
|
|
3109
|
-
<summary><b>\u{1F6A8} Hint Level 3: Full Solution & Explanation (L\u1EDDi gi\u1EA3i tr\u1ECDn v\u1EB9n)</b></summary>
|
|
3110
|
-
|
|
3111
|
-
\`\`\`{{CODE_LANGUAGE}}
|
|
3112
|
-
{{BRONZE_HINT_3_CODE}}
|
|
3113
|
-
\`\`\`
|
|
3114
|
-
|
|
3115
|
-
**Why this solution works:**
|
|
3116
|
-
{{BRONZE_HINT_3_EXPLANATION}}
|
|
3117
|
-
</details>
|
|
3118
|
-
|
|
3119
|
-
---
|
|
3120
|
-
|
|
3121
|
-
### \u{1F948} Challenge 2: Logic & Error Handling (Silver) \u2014 ~{{SILVER_MINS}} mins
|
|
3122
|
-
**Objective:** {{SILVER_OBJECTIVE}}
|
|
3123
|
-
|
|
3124
|
-
#### Tasks & Implementation Details:
|
|
3125
|
-
{{SILVER_TASKS}}
|
|
3126
|
-
|
|
3127
|
-
#### \u{1F9EA} Self-Verification Command:
|
|
3128
|
-
\`\`\`bash
|
|
3129
|
-
{{SILVER_VERIFY_COMMAND}}
|
|
3130
|
-
\`\`\`
|
|
3131
|
-
*Expected Terminal Output:*
|
|
3132
|
-
\`\`\`text
|
|
3133
|
-
{{SILVER_EXPECTED_OUTPUT}}
|
|
3134
|
-
\`\`\`
|
|
3135
|
-
|
|
3136
|
-
#### \u{1F4A1} Progressive Hints (Expand only if stuck):
|
|
3137
|
-
<details>
|
|
3138
|
-
<summary><b>\u{1F4A1} Hint Level 1: Conceptual Clue (H\u01B0\u1EDBng t\u01B0 duy)</b></summary>
|
|
3139
|
-
|
|
3140
|
-
{{SILVER_HINT_1}}
|
|
3141
|
-
</details>
|
|
3142
|
-
|
|
3143
|
-
<details>
|
|
3144
|
-
<summary><b>\u{1F50D} Hint Level 2: Structural Skeleton (Khung code m\u1EABu)</b></summary>
|
|
3145
|
-
|
|
3146
|
-
\`\`\`{{CODE_LANGUAGE}}
|
|
3147
|
-
{{SILVER_HINT_2}}
|
|
3148
|
-
\`\`\`
|
|
3149
|
-
</details>
|
|
3150
|
-
|
|
3151
|
-
<details>
|
|
3152
|
-
<summary><b>\u{1F6A8} Hint Level 3: Full Solution & Explanation (L\u1EDDi gi\u1EA3i tr\u1ECDn v\u1EB9n)</b></summary>
|
|
3153
|
-
|
|
3154
|
-
\`\`\`{{CODE_LANGUAGE}}
|
|
3155
|
-
{{SILVER_HINT_3_CODE}}
|
|
3156
|
-
\`\`\`
|
|
3157
|
-
|
|
3158
|
-
**Why this solution works:**
|
|
3159
|
-
{{SILVER_HINT_3_EXPLANATION}}
|
|
3160
|
-
</details>
|
|
3161
|
-
|
|
3162
|
-
---
|
|
3163
|
-
|
|
3164
|
-
### \u{1F947} Challenge 3: Edge Cases & Optimization (Gold) \u2014 ~{{GOLD_MINS}} mins
|
|
3165
|
-
**Objective:** {{GOLD_OBJECTIVE}}
|
|
3166
|
-
|
|
3167
|
-
#### Tasks & Implementation Details:
|
|
3168
|
-
{{GOLD_TASKS}}
|
|
3169
|
-
|
|
3170
|
-
#### \u{1F9EA} Self-Verification Command:
|
|
3171
|
-
\`\`\`bash
|
|
3172
|
-
{{GOLD_VERIFY_COMMAND}}
|
|
3173
|
-
\`\`\`
|
|
3174
|
-
*Expected Terminal Output:*
|
|
3175
|
-
\`\`\`text
|
|
3176
|
-
{{GOLD_EXPECTED_OUTPUT}}
|
|
3177
|
-
\`\`\`
|
|
3178
|
-
|
|
3179
|
-
#### \u{1F4A1} Progressive Hints (Expand only if stuck):
|
|
3180
|
-
<details>
|
|
3181
|
-
<summary><b>\u{1F4A1} Hint Level 1: Conceptual Clue (H\u01B0\u1EDBng t\u01B0 duy)</b></summary>
|
|
3182
|
-
|
|
3183
|
-
{{GOLD_HINT_1}}
|
|
3184
|
-
</details>
|
|
3185
|
-
|
|
3186
|
-
<details>
|
|
3187
|
-
<summary><b>\u{1F50D} Hint Level 2: Structural Skeleton (Khung code m\u1EABu)</b></summary>
|
|
3188
|
-
|
|
3189
|
-
\`\`\`{{CODE_LANGUAGE}}
|
|
3190
|
-
{{GOLD_HINT_2}}
|
|
3191
|
-
\`\`\`
|
|
3192
|
-
</details>
|
|
3193
|
-
|
|
3194
|
-
<details>
|
|
3195
|
-
<summary><b>\u{1F6A8} Hint Level 3: Full Solution & Explanation (L\u1EDDi gi\u1EA3i tr\u1ECDn v\u1EB9n)</b></summary>
|
|
3196
|
-
|
|
3197
|
-
\`\`\`{{CODE_LANGUAGE}}
|
|
3198
|
-
{{GOLD_HINT_3_CODE}}
|
|
3199
|
-
\`\`\`
|
|
3200
|
-
|
|
3201
|
-
**Why this solution works:**
|
|
3202
|
-
{{GOLD_HINT_3_EXPLANATION}}
|
|
3203
|
-
</details>
|
|
3204
|
-
|
|
3205
|
-
---
|
|
3206
|
-
|
|
3207
|
-
## \u{1F50D} Self-Learner Troubleshooting Matrix
|
|
3208
|
-
| Symptom / Error Message | Root Cause | Exact Fix |
|
|
3209
|
-
| :--- | :--- | :--- |
|
|
3210
|
-
{{TROUBLESHOOTING_ROWS}}
|
|
3211
|
-
|
|
3212
|
-
---
|
|
3213
|
-
|
|
3214
|
-
## \u{1F3C1} Final Lab Submission & Mastery Checklist
|
|
3215
|
-
{{FINAL_CHECKLIST}}
|
|
3216
|
-
`.trim();
|
|
3217
|
-
|
|
3218
2885
|
// src/ai/prompts/lessonMasterPrompt.ts
|
|
2886
|
+
init_templateLoader();
|
|
3219
2887
|
function buildLessonMasterPrompt(input) {
|
|
3220
2888
|
const { milestone, language, topic, targetAudience, contextContinuity, standardsContext } = input;
|
|
3221
2889
|
const learningObjectives = milestone.learning_objectives || [];
|
|
@@ -3267,7 +2935,7 @@ Build a deep, rigorous, and highly pedagogical Master Lesson Plan (LESSON) that
|
|
|
3267
2935
|
# MANDATORY TEMPLATE STRUCTURE
|
|
3268
2936
|
You MUST generate structured data that will render directly into this exact Markdown template:
|
|
3269
2937
|
---
|
|
3270
|
-
${
|
|
2938
|
+
${loadAuthoringTemplate("LESSON_5E_template.md") ?? "[TEMPLATE FILE NOT FOUND: LESSON_5E_template.md]"}
|
|
3271
2939
|
---
|
|
3272
2940
|
|
|
3273
2941
|
# INPUT PARAMETERS
|
|
@@ -3317,6 +2985,7 @@ Return a single valid JSON object matching the LessonPlanSchema with these exact
|
|
|
3317
2985
|
}
|
|
3318
2986
|
|
|
3319
2987
|
// src/ai/prompts/activityPrompt.ts
|
|
2988
|
+
init_templateLoader();
|
|
3320
2989
|
function buildActivityPrompt(input) {
|
|
3321
2990
|
const { lesson, language, hardwareBOM, softwareTools } = input;
|
|
3322
2991
|
const loList = lesson.learningObjectives.map((lo) => `- [${lo.bloomLevel}] ${lo.code}: ${lo.name || ""} \u2014 ${lo.description}${lo.successCriteria ? ` (Evidence: ${lo.successCriteria})` : ""}`).join("\n");
|
|
@@ -3345,7 +3014,7 @@ Transform the exact pedagogical flow and activities from the Master Lesson Plan
|
|
|
3345
3014
|
# MANDATORY TEMPLATE STRUCTURE
|
|
3346
3015
|
You MUST generate data aligned with this Markdown template:
|
|
3347
3016
|
---
|
|
3348
|
-
${
|
|
3017
|
+
${loadAuthoringTemplate("ACT_template.md") ?? "[TEMPLATE FILE NOT FOUND: ACT_template.md]"}
|
|
3349
3018
|
---
|
|
3350
3019
|
|
|
3351
3020
|
# CANONICAL MASTER LESSON CONTEXT (SOURCE OF TRUTH)
|
|
@@ -3416,6 +3085,7 @@ Return a single JSON object matching ActivityLabSchema with these exact keys:
|
|
|
3416
3085
|
}
|
|
3417
3086
|
|
|
3418
3087
|
// src/ai/prompts/codeLabPrompt.ts
|
|
3088
|
+
init_templateLoader();
|
|
3419
3089
|
function buildCodeLabPrompt(input) {
|
|
3420
3090
|
const { lesson, activity, language, targetTechStack } = input;
|
|
3421
3091
|
const techStackList = targetTechStack && targetTechStack.length > 0 ? targetTechStack : ["General Programming & Engineering"];
|
|
@@ -3440,7 +3110,7 @@ Generate complete, verified source code that satisfies the lesson objectives and
|
|
|
3440
3110
|
# MANDATORY TEMPLATE STRUCTURE
|
|
3441
3111
|
You MUST generate data aligned with this Markdown template:
|
|
3442
3112
|
---
|
|
3443
|
-
${
|
|
3113
|
+
${loadAuthoringTemplate("LAB_TEMPLATE.md") ?? "[TEMPLATE FILE NOT FOUND: LAB_TEMPLATE.md]"}
|
|
3444
3114
|
---
|
|
3445
3115
|
|
|
3446
3116
|
# CANONICAL LESSON CONTEXT (SOURCE OF TRUTH)
|
|
@@ -3822,6 +3492,7 @@ Please return a single JSON object matching these exact keys:
|
|
|
3822
3492
|
}
|
|
3823
3493
|
|
|
3824
3494
|
// src/ai/prompts/selfLabPrompt.ts
|
|
3495
|
+
init_templateLoader();
|
|
3825
3496
|
function buildSelfLabPrompt(input) {
|
|
3826
3497
|
const { milestone, projectGraph, language, targetTechStack, contextContinuity } = input;
|
|
3827
3498
|
const techStackList = targetTechStack && targetTechStack.length > 0 ? targetTechStack : milestone.tech_keywords && milestone.tech_keywords.length > 0 ? milestone.tech_keywords : ["General Engineering"];
|
|
@@ -3852,7 +3523,7 @@ Build a complete, engaging Self-Paced Hands-On Lab (SELF_LAB) for autonomous lea
|
|
|
3852
3523
|
# MANDATORY TEMPLATE STRUCTURE
|
|
3853
3524
|
You MUST generate data aligned with this Markdown template:
|
|
3854
3525
|
---
|
|
3855
|
-
${
|
|
3526
|
+
${loadAuthoringTemplate("SELF_LAB_template.md") ?? "[TEMPLATE FILE NOT FOUND: SELF_LAB_template.md]"}
|
|
3856
3527
|
---
|
|
3857
3528
|
|
|
3858
3529
|
# INPUT PARAMETERS
|
|
@@ -3930,6 +3601,7 @@ Return a single valid JSON object matching SelfLabSchema with these exact keys:
|
|
|
3930
3601
|
}
|
|
3931
3602
|
|
|
3932
3603
|
// src/ai/prompts/diagnosticQuizPrompt.ts
|
|
3604
|
+
init_templateLoader();
|
|
3933
3605
|
function buildDiagnosticQuizPrompt(input) {
|
|
3934
3606
|
const { milestone, language, questionCount = 4, passingScorePct = 80 } = input;
|
|
3935
3607
|
const learningObjectives = milestone.learning_objectives || [];
|
|
@@ -3989,7 +3661,7 @@ Use this mapping to determine which Bloom level each question truly targets. Mat
|
|
|
3989
3661
|
# MANDATORY TEMPLATE STRUCTURE
|
|
3990
3662
|
You MUST generate data aligned with this Markdown template:
|
|
3991
3663
|
---
|
|
3992
|
-
${
|
|
3664
|
+
${loadAuthoringTemplate("QUIZ_v4.6_template.md") ?? "[TEMPLATE FILE NOT FOUND: QUIZ_v4.6_template.md]"}
|
|
3993
3665
|
---
|
|
3994
3666
|
|
|
3995
3667
|
# INPUT PARAMETERS
|
|
@@ -4479,7 +4151,7 @@ ${cc.technicalDepth}`;
|
|
|
4479
4151
|
const dataRows = cc.comparisonTable.rows.map((r) => `| ${r.join(" | ")} |`).join("\n");
|
|
4480
4152
|
str += `
|
|
4481
4153
|
|
|
4482
|
-
|
|
4154
|
+
**Comparison & Trade-off Analysis**
|
|
4483
4155
|
${headerRow}
|
|
4484
4156
|
${dividerRow}
|
|
4485
4157
|
${dataRows}`;
|
|
@@ -4523,7 +4195,8 @@ ${learningObjectivesStr}
|
|
|
4523
4195
|
|
|
4524
4196
|
---
|
|
4525
4197
|
|
|
4526
|
-
## 1. ENGAGE (Hook & High-Stakes Scenario)
|
|
4198
|
+
## 1. ENGAGE (Hook & High-Stakes Scenario)
|
|
4199
|
+
> **Duration:** 10-15 mins
|
|
4527
4200
|
|
|
4528
4201
|
### Real-World Context: "${lesson.hookTitle || "The Incident"}"
|
|
4529
4202
|
${lesson.hookScenario}
|
|
@@ -4532,13 +4205,15 @@ ${lesson.hookQuestions && lesson.hookQuestions.length > 0 ? lesson.hookQuestions
|
|
|
4532
4205
|
|
|
4533
4206
|
---
|
|
4534
4207
|
|
|
4535
|
-
## 2. EXPLORE & EXPLAIN (Core Technical Concepts & Principles)
|
|
4208
|
+
## 2. EXPLORE & EXPLAIN (Core Technical Concepts & Principles)
|
|
4209
|
+
> **Duration:** 30-40 mins
|
|
4536
4210
|
|
|
4537
4211
|
${coreConceptsStr}
|
|
4538
4212
|
|
|
4539
4213
|
---
|
|
4540
4214
|
|
|
4541
|
-
## 3. GUIDED PRACTICE (Visual Architecture & Annotated Code)
|
|
4215
|
+
## 3. GUIDED PRACTICE (Visual Architecture & Annotated Code)
|
|
4216
|
+
> **Duration:** 20-25 mins
|
|
4542
4217
|
|
|
4543
4218
|
### System Architecture & Data Flow (Mermaid Diagram)
|
|
4544
4219
|
${mermaidBlock}
|
|
@@ -4552,7 +4227,8 @@ ${guidedPractice.codeSnippet}
|
|
|
4552
4227
|
|
|
4553
4228
|
---
|
|
4554
4229
|
|
|
4555
|
-
## 4. ELABORATE & INDEPENDENT PRACTICE (Technical Challenge & Scaffolding)
|
|
4230
|
+
## 4. ELABORATE & INDEPENDENT PRACTICE (Technical Challenge & Scaffolding)
|
|
4231
|
+
> **Duration:** 15-20 mins
|
|
4556
4232
|
|
|
4557
4233
|
### Engineering Challenge: "${lesson.independentPractice?.title || "System Optimization Challenge"}"
|
|
4558
4234
|
${lesson.independentPractice?.description || "Implement the core logic and test against simulated edge cases."}
|
|
@@ -4563,7 +4239,8 @@ ${lesson.independentPractice?.description || "Implement the core logic and test
|
|
|
4563
4239
|
|
|
4564
4240
|
---
|
|
4565
4241
|
|
|
4566
|
-
## 5. EVALUATE (Summary, Assessment & Metacognition)
|
|
4242
|
+
## 5. EVALUATE (Summary, Assessment & Metacognition)
|
|
4243
|
+
> **Duration:** 5-10 mins
|
|
4567
4244
|
|
|
4568
4245
|
### Exit Ticket (Bloom: Apply / Analyze)
|
|
4569
4246
|
> **Scenario Question:** ${lesson.exitTicket.questionStem}
|
|
@@ -4656,12 +4333,16 @@ ${hardwareItems}
|
|
|
4656
4333
|
|
|
4657
4334
|
## [REQUIRED] Active Learning Workflow
|
|
4658
4335
|
|
|
4659
|
-
### Phase 1: Planning & Design
|
|
4336
|
+
### Phase 1: Planning & Design
|
|
4337
|
+
> **Duration:** ${phase1.durationMinutes} mins
|
|
4338
|
+
|
|
4660
4339
|
- **Student Task:** ${phase1.studentTask}
|
|
4661
4340
|
- **Teacher Action:** ${phase1.teacherAction}
|
|
4662
4341
|
${phase1.inquiryQuestions.map((q) => ` - *Inquiry Question:* ${q}`).join("\n")}
|
|
4663
4342
|
|
|
4664
|
-
### Phase 2: Implementation & Discovery
|
|
4343
|
+
### Phase 2: Implementation & Discovery
|
|
4344
|
+
> **Duration:** ${phase2.durationMinutes} mins
|
|
4345
|
+
|
|
4665
4346
|
- **Student Task:** ${phase2.studentTask}
|
|
4666
4347
|
- **Teacher Action:** ${phase2.teacherAction}
|
|
4667
4348
|
|
|
@@ -4669,7 +4350,9 @@ ${phase2.codeOrCommands.map((c) => `\`\`\`text
|
|
|
4669
4350
|
${c}
|
|
4670
4351
|
\`\`\``).join("\n\n")}
|
|
4671
4352
|
|
|
4672
|
-
### Phase 3: Debugging & Testing
|
|
4353
|
+
### Phase 3: Debugging & Testing
|
|
4354
|
+
> **Duration:** ${phase3.durationMinutes} mins
|
|
4355
|
+
|
|
4673
4356
|
- **Testing:** ${phase3.testingSteps}
|
|
4674
4357
|
- **Error Analysis:** ${phase3.errorAnalysis}
|
|
4675
4358
|
|
|
@@ -4724,22 +4407,28 @@ This lab focuses on the practical implementation of core technical concepts, bri
|
|
|
4724
4407
|
|
|
4725
4408
|
## \u{1F4DD} Lab Tasks (3-Tier Differentiation)
|
|
4726
4409
|
|
|
4727
|
-
### \u{1F949} Bronze (Foundational)
|
|
4410
|
+
### \u{1F949} Bronze (Foundational)
|
|
4411
|
+
> **Duration:** ${tasks.bronze.mins} mins
|
|
4412
|
+
|
|
4728
4413
|
**Objective:** ${tasks.bronze.objective}
|
|
4729
4414
|
- **Task:** ${tasks.bronze.task}
|
|
4730
4415
|
- **Requirement:** ${tasks.bronze.requirement}
|
|
4731
4416
|
|
|
4732
|
-
### \u{1F948} Silver (Application)
|
|
4417
|
+
### \u{1F948} Silver (Application)
|
|
4418
|
+
> **Duration:** ${tasks.silver.mins} mins
|
|
4419
|
+
|
|
4733
4420
|
**Objective:** ${tasks.silver.objective}
|
|
4734
4421
|
- **Task:** ${tasks.silver.task}
|
|
4735
4422
|
- **Requirement:** ${tasks.silver.requirement}
|
|
4736
4423
|
|
|
4737
|
-
### \u{1F947} Gold (Enrichment/Creative)
|
|
4424
|
+
### \u{1F947} Gold (Enrichment/Creative)
|
|
4425
|
+
> **Duration:** ${tasks.gold.mins} mins
|
|
4426
|
+
|
|
4738
4427
|
**Objective:** ${tasks.gold.objective}
|
|
4739
4428
|
- **Task:** ${tasks.gold.task}
|
|
4740
4429
|
- **Requirement:** ${tasks.gold.requirement}
|
|
4741
4430
|
|
|
4742
|
-
## \u{1F4BB} Technical Reference
|
|
4431
|
+
## \u{1F4BB} Technical Reference
|
|
4743
4432
|
<!-- [SME_MANDATE] -->
|
|
4744
4433
|
> Any code provided in this section is verified for syntax accuracy and runtime execution.
|
|
4745
4434
|
|
|
@@ -4814,7 +4503,9 @@ ${proTipsStr}
|
|
|
4814
4503
|
function serializeSelfLabToMarkdown(lab) {
|
|
4815
4504
|
const renderChallenge = (c, label) => {
|
|
4816
4505
|
const tasksList = c.tasks.map((t) => `- ${t}`).join("\n");
|
|
4817
|
-
return `### ${label}: ${c.title}
|
|
4506
|
+
return `### ${label}: ${c.title}
|
|
4507
|
+
> **Duration:** ~${c.estimatedMinutes} mins
|
|
4508
|
+
|
|
4818
4509
|
**Objective:** ${c.objective}
|
|
4819
4510
|
|
|
4820
4511
|
#### Tasks & Implementation Details:
|
|
@@ -4972,7 +4663,7 @@ var LocalWorkspaceManager = class {
|
|
|
4972
4663
|
}
|
|
4973
4664
|
async initJobWorkspace(jobId, initialInfo) {
|
|
4974
4665
|
const jobDir = this.getJobDirectory(jobId);
|
|
4975
|
-
await
|
|
4666
|
+
await fs3__default.default.mkdir(jobDir, { recursive: true });
|
|
4976
4667
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
4977
4668
|
const manifest = {
|
|
4978
4669
|
jobId,
|
|
@@ -4992,10 +4683,10 @@ var LocalWorkspaceManager = class {
|
|
|
4992
4683
|
async saveArtifact(jobId, milestoneSlug, filename, content, artifactType) {
|
|
4993
4684
|
const jobDir = this.getJobDirectory(jobId);
|
|
4994
4685
|
const targetDir = path__default.default.join(jobDir, milestoneSlug);
|
|
4995
|
-
await
|
|
4686
|
+
await fs3__default.default.mkdir(targetDir, { recursive: true });
|
|
4996
4687
|
const filePath = path__default.default.join(targetDir, filename);
|
|
4997
|
-
await
|
|
4998
|
-
const stat = await
|
|
4688
|
+
await fs3__default.default.writeFile(filePath, content, "utf-8");
|
|
4689
|
+
const stat = await fs3__default.default.stat(filePath);
|
|
4999
4690
|
const manifest = await this.getManifest(jobId);
|
|
5000
4691
|
if (manifest) {
|
|
5001
4692
|
manifest.artifacts.push({
|
|
@@ -5013,7 +4704,7 @@ var LocalWorkspaceManager = class {
|
|
|
5013
4704
|
async getManifest(jobId) {
|
|
5014
4705
|
const manifestPath = path__default.default.join(this.getJobDirectory(jobId), "manifest.json");
|
|
5015
4706
|
try {
|
|
5016
|
-
const data = await
|
|
4707
|
+
const data = await fs3__default.default.readFile(manifestPath, "utf-8");
|
|
5017
4708
|
return JSON.parse(data);
|
|
5018
4709
|
} catch {
|
|
5019
4710
|
return null;
|
|
@@ -5022,7 +4713,7 @@ var LocalWorkspaceManager = class {
|
|
|
5022
4713
|
async saveManifest(jobId, manifest) {
|
|
5023
4714
|
const manifestPath = path__default.default.join(this.getJobDirectory(jobId), "manifest.json");
|
|
5024
4715
|
manifest.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5025
|
-
await
|
|
4716
|
+
await fs3__default.default.writeFile(manifestPath, JSON.stringify(manifest, null, 2), "utf-8");
|
|
5026
4717
|
}
|
|
5027
4718
|
async markMilestoneCompleted(jobId) {
|
|
5028
4719
|
const manifest = await this.getManifest(jobId);
|
|
@@ -5059,13 +4750,13 @@ async function publishToGitHub(options) {
|
|
|
5059
4750
|
try {
|
|
5060
4751
|
const filesToUpload = [];
|
|
5061
4752
|
async function scanDir(currentDir) {
|
|
5062
|
-
const entries = await
|
|
4753
|
+
const entries = await fs3__default.default.readdir(currentDir, { withFileTypes: true });
|
|
5063
4754
|
for (const entry of entries) {
|
|
5064
4755
|
const fullPath = path__default.default.join(currentDir, entry.name);
|
|
5065
4756
|
if (entry.isDirectory()) {
|
|
5066
4757
|
await scanDir(fullPath);
|
|
5067
4758
|
} else if (entry.isFile() && !entry.name.startsWith(".")) {
|
|
5068
|
-
const content = await
|
|
4759
|
+
const content = await fs3__default.default.readFile(fullPath, "utf-8");
|
|
5069
4760
|
const relPath = path__default.default.relative(options.localJobDir, fullPath);
|
|
5070
4761
|
filesToUpload.push({ path: relPath, content });
|
|
5071
4762
|
}
|
|
@@ -18924,6 +18615,7 @@ var LLMJudgeEngine = class {
|
|
|
18924
18615
|
init_errors();
|
|
18925
18616
|
|
|
18926
18617
|
// src/services/languageDirective.ts
|
|
18618
|
+
init_templateLoader();
|
|
18927
18619
|
function resolveTargetLanguageCode(language) {
|
|
18928
18620
|
const raw = String(language || "vi").trim().toLowerCase();
|
|
18929
18621
|
if (raw.startsWith("vi")) return "vi";
|
|
@@ -18964,137 +18656,58 @@ function matchesArtifactType(candidate, target) {
|
|
|
18964
18656
|
if ((c === "EXT" || c === "EXTENSION") && (t === "EXT" || t === "EXTENSION")) return true;
|
|
18965
18657
|
return false;
|
|
18966
18658
|
}
|
|
18967
|
-
var
|
|
18968
|
-
|
|
18969
|
-
|
|
18970
|
-
|
|
18971
|
-
|
|
18972
|
-
|
|
18973
|
-
|
|
18974
|
-
|
|
18975
|
-
|
|
18976
|
-
|
|
18977
|
-
|
|
18978
|
-
|
|
18979
|
-
|
|
18980
|
-
|
|
18981
|
-
|
|
18982
|
-
|
|
18983
|
-
|
|
18984
|
-
|
|
18985
|
-
|
|
18986
|
-
|
|
18987
|
-
|
|
18988
|
-
|
|
18989
|
-
"Examples & Context Rules": "Quy t\u1EAFc V\xED d\u1EE5 & Ng\u1EEF c\u1EA3nh",
|
|
18990
|
-
"Lesson Content Standards": "Ti\xEAu chu\u1EA9n N\u1ED9i dung B\xE0i h\u1ECDc"
|
|
18991
|
-
},
|
|
18992
|
-
SECTION_LANGUAGE_CONTRACT: {
|
|
18993
|
-
"Metadata & Scope": "Th\xF4ng tin & Ph\u1EA1m vi H\u1EE3p \u0111\u1ED3ng",
|
|
18994
|
-
"Section Translation Matrix": "Ma tr\u1EADn Ti\xEAu \u0111\u1EC1 \u0110a ng\xF4n ng\u1EEF",
|
|
18995
|
-
"Validation Rules": "Quy t\u1EAFc X\xE1c th\u1EF1c & Kh\xF3a Chu\u1EA9n"
|
|
18996
|
-
},
|
|
18997
|
-
KNOWLEDGE_EXPOSITION: {
|
|
18998
|
-
"Session Scope": "Ph\u1EA1m vi Bu\u1ED5i h\u1ECDc",
|
|
18999
|
-
"Key Terms": "Thu\u1EADt ng\u1EEF Then ch\u1ED1t",
|
|
19000
|
-
"Concept Narratives": "Di\u1EC5n gi\u1EA3i Kh\xE1i ni\u1EC7m",
|
|
19001
|
-
"Worked Micro-Examples": "V\xED d\u1EE5 M\u1EABu Chi ti\u1EBFt",
|
|
19002
|
-
"Common Mistakes": "L\u1ED7i Th\u01B0\u1EDDng g\u1EB7p & Kh\u1EAFc ph\u1EE5c",
|
|
19003
|
-
"Self-Check Questions": "C\xE2u h\u1ECFi T\u1EF1 ki\u1EC3m tra"
|
|
19004
|
-
},
|
|
19005
|
-
LESSON: {
|
|
19006
|
-
"A. Lesson Design Plan": "A. K\u1EBF ho\u1EA1ch Thi\u1EBFt k\u1EBF B\xE0i h\u1ECDc",
|
|
19007
|
-
"Learning Objectives & Evidence": "M\u1EE5c ti\xEAu H\u1ECDc t\u1EADp & B\u1EB1ng ch\u1EE9ng N\u0103ng l\u1EF1c",
|
|
19008
|
-
"Activity Sequence": "Chu\u1ED7i Ho\u1EA1t \u0111\u1ED9ng D\u1EA1y & H\u1ECDc",
|
|
19009
|
-
"Resource Map": "B\u1EA3n \u0111\u1ED3 T\xE0i nguy\xEAn & H\u1ECDc li\u1EC7u",
|
|
19010
|
-
"Assessment Map": "B\u1EA3n \u0111\u1ED3 \u0110\xE1nh gi\xE1 N\u0103ng l\u1EF1c",
|
|
19011
|
-
"Artifact Contract": "H\u1EE3p \u0111\u1ED3ng S\u1EA3n ph\u1EA9m \u0110\u1EA7u ra",
|
|
19012
|
-
"B. Lesson Flow": "B. Ti\u1EBFn tr\xECnh Gi\u1EA3ng d\u1EA1y Chi ti\u1EBFt"
|
|
19013
|
-
},
|
|
19014
|
-
ACT: {
|
|
19015
|
-
"Computational Thinking Focus": "Tr\u1ECDng t\xE2m T\u01B0 duy M\xE1y t\xEDnh",
|
|
19016
|
-
"Materials & Setup": "V\u1EADt li\u1EC7u & Chu\u1EA9n b\u1ECB Thi\u1EBFt b\u1ECB",
|
|
19017
|
-
"Constraints & Safety": "R\xE0ng bu\u1ED9c & An to\xE0n Ph\xF2ng th\u1EF1c h\xE0nh",
|
|
19018
|
-
"Active Learning Workflow": "Quy tr\xECnh Ho\u1EA1t \u0111\u1ED9ng Tr\u1EA3i nghi\u1EC7m",
|
|
19019
|
-
"3-Tier Differentiation": "Ph\xE2n h\xF3a H\u1ECDc t\u1EADp 3 T\u1EA7ng",
|
|
19020
|
-
"Reflection": "T\u1ED5ng k\u1EBFt & \u0110\xFAc k\u1EBFt Tr\u1EA3i nghi\u1EC7m"
|
|
19021
|
-
},
|
|
19022
|
-
CODE: {
|
|
19023
|
-
"Technical Overview & Architecture Blueprint": "T\u1ED5ng quan K\u1EF9 thu\u1EADt & B\u1EA3n thi\u1EBFt k\u1EBF Ki\u1EBFn tr\xFAc",
|
|
19024
|
-
"Hardware Pinout & Wiring Configuration Matrix": "S\u01A1 \u0111\u1ED3 Ch\xE2n & Ma tr\u1EADn N\u1ED1i d\xE2y Ph\u1EA7n c\u1EE9ng",
|
|
19025
|
-
"Starter Code Sandbox": "M\xE3 ngu\u1ED3n Kh\u1EDFi \u0111\u1EA7u (Starter Code)",
|
|
19026
|
-
"Verified Reference Solution Code": "M\xE3 ngu\u1ED3n L\u1EDDi gi\u1EA3i Chu\u1EA9n (Reference Solution)",
|
|
19027
|
-
"Automated Test / Verification Script": "K\u1ECBch b\u1EA3n Ki\u1EC3m th\u1EED T\u1EF1 \u0111\u1ED9ng",
|
|
19028
|
-
"Common Syntax & Runtime Pitfalls Matrix": "Ma tr\u1EADn L\u1ED7i C\xFA ph\xE1p & Th\u1EDDi gian ch\u1EA1y Th\u01B0\u1EDDng g\u1EB7p"
|
|
19029
|
-
},
|
|
19030
|
-
CODE_LAB: {
|
|
19031
|
-
"Technical Overview & Architecture Blueprint": "T\u1ED5ng quan K\u1EF9 thu\u1EADt & B\u1EA3n thi\u1EBFt k\u1EBF Ki\u1EBFn tr\xFAc",
|
|
19032
|
-
"Hardware Pinout & Wiring Configuration Matrix": "S\u01A1 \u0111\u1ED3 Ch\xE2n & Ma tr\u1EADn N\u1ED1i d\xE2y Ph\u1EA7n c\u1EE9ng",
|
|
19033
|
-
"Starter Code Sandbox": "M\xE3 ngu\u1ED3n Kh\u1EDFi \u0111\u1EA7u (Starter Code)",
|
|
19034
|
-
"Verified Reference Solution Code": "M\xE3 ngu\u1ED3n L\u1EDDi gi\u1EA3i Chu\u1EA9n (Reference Solution)",
|
|
19035
|
-
"Automated Test / Verification Script": "K\u1ECBch b\u1EA3n Ki\u1EC3m th\u1EED T\u1EF1 \u0111\u1ED9ng",
|
|
19036
|
-
"Common Syntax & Runtime Pitfalls Matrix": "Ma tr\u1EADn L\u1ED7i C\xFA ph\xE1p & Th\u1EDDi gian ch\u1EA1y Th\u01B0\u1EDDng g\u1EB7p"
|
|
19037
|
-
},
|
|
19038
|
-
QUIZ: {
|
|
19039
|
-
"Assessment Objectives": "M\u1EE5c ti\xEAu \u0110\xE1nh gi\xE1",
|
|
19040
|
-
"Multiple-Choice Question Bank": "Ng\xE2n h\xE0ng C\xE2u h\u1ECFi Tr\u1EAFc nghi\u1EC7m",
|
|
19041
|
-
"Code Analysis / Debugging Question": "C\xE2u h\u1ECFi Ph\xE2n t\xEDch M\xE3 ngu\u1ED3n & S\u1EEDa l\u1ED7i",
|
|
19042
|
-
"Competency Rubric": "Thang \u0111o \u0110\xE1nh gi\xE1 N\u0103ng l\u1EF1c (Rubric)"
|
|
19043
|
-
},
|
|
19044
|
-
GUIDE: {
|
|
19045
|
-
"Objectives & Preparation": "M\u1EE5c ti\xEAu & Chu\u1EA9n b\u1ECB Gi\u1EA3ng d\u1EA1y",
|
|
19046
|
-
"Preparation Checklist & Workstation Setup": "Danh m\u1EE5c Ki\u1EC3m tra Chu\u1EA9n b\u1ECB & Tr\u1EA1m Th\u1EF1c h\xE0nh",
|
|
19047
|
-
"Facilitation Script & Timeline": "K\u1ECBch b\u1EA3n \u0110i\u1EC1u ph\u1ED1i & Khung Th\u1EDDi gian",
|
|
19048
|
-
"Common Misconceptions & Diagnostic Remediation Matrix": "Quan ni\u1EC7m Sai l\u1EA7m Th\u01B0\u1EDDng g\u1EB7p & Ma tr\u1EADn Kh\u1EAFc ph\u1EE5c",
|
|
19049
|
-
"Differentiated Support Strategies": "Chi\u1EBFn l\u01B0\u1EE3c H\u1ED7 tr\u1EE3 Ph\xE2n h\xF3a"
|
|
19050
|
-
},
|
|
19051
|
-
HANDOUT: {
|
|
19052
|
-
"Core Concepts": "Kh\xE1i ni\u1EC7m C\u1ED1t l\xF5i",
|
|
19053
|
-
"Core Syntax & Mechanism Cheat Sheet": "B\u1EA3ng Tra c\u1EE9u C\xFA ph\xE1p & C\u01A1 ch\u1EBF Tr\u1ECDng t\xE2m",
|
|
19054
|
-
"Visual Mental Model / Architecture Diagram": "M\xF4 h\xECnh T\u01B0 duy Tr\u1EF1c quan / S\u01A1 \u0111\u1ED3 Ki\u1EBFn tr\xFAc",
|
|
19055
|
-
"Step-by-Step Practical Quick-Start Guide": "H\u01B0\u1EDBng d\u1EABn Th\u1EF1c h\xE0nh T\u1EEBng b\u01B0\u1EDBc",
|
|
19056
|
-
"Self-Check Diagnostic Checklist": "B\u1EA3ng Ki\u1EC3m tra T\u1EF1 ch\u1EA9n \u0111o\xE1n"
|
|
19057
|
-
},
|
|
19058
|
-
WKS: {
|
|
19059
|
-
"Part 1: Knowledge Check": "Ph\u1EA7n 1: Ki\u1EC3m tra Ki\u1EBFn th\u1EE9c",
|
|
19060
|
-
"Part 2: Concept Tracing & Diagram Fill-in": "Ph\u1EA7n 2: L\u1EA7n v\u1EBFt Kh\xE1i ni\u1EC7m & \u0110i\u1EC1n S\u01A1 \u0111\u1ED3",
|
|
19061
|
-
"Part 3: Code Analysis & Bug Hunting Challenge": "Ph\u1EA7n 3: Ph\xE2n t\xEDch M\xE3 & Th\u1EED th\xE1ch S\u0103n l\u1ED7i",
|
|
19062
|
-
"Part 4: Synthesis & Problem-Solving Application": "Ph\u1EA7n 4: T\u1ED5ng h\u1EE3p & \u1EE8ng d\u1EE5ng Gi\u1EA3i quy\u1EBFt V\u1EA5n \u0111\u1EC1",
|
|
19063
|
-
"Part 5: Self-Reflection & Learning Log": "Ph\u1EA7n 5: T\u1EF1 suy ng\u1EABm & Nh\u1EADt k\xFD H\u1ECDc t\u1EADp"
|
|
19064
|
-
},
|
|
19065
|
-
EXT: {
|
|
19066
|
-
"For: Advanced Students / Extra Time": "D\xE0nh cho: H\u1ECDc sinh N\xE2ng cao / Ho\xE0n th\xE0nh S\u1EDBm",
|
|
19067
|
-
"Challenge 1: Mission Briefing & Real-World High-Stakes Scenario": "Th\u1EED th\xE1ch 1: B\u1ED1i c\u1EA3nh Nhi\u1EC7m v\u1EE5 Th\u1EF1c t\u1EBF & K\u1ECBch b\u1EA3n \u1EE8ng d\u1EE5ng",
|
|
19068
|
-
"Challenge 2: Advanced Architectural Constraints & Edge Cases": "Th\u1EED th\xE1ch 2: R\xE0ng bu\u1ED9c Ki\u1EBFn tr\xFAc N\xE2ng cao & Tr\u01B0\u1EDDng h\u1EE3p Bi\xEAn",
|
|
19069
|
-
"Challenge 3: Extension Milestones": "Th\u1EED th\xE1ch 3: C\xE1c M\u1ED1c Nhi\u1EC7m v\u1EE5 N\xE2ng cao",
|
|
19070
|
-
"Metacognitive Deep Dive & Engineering Trade-offs": "Suy ng\u1EABm Si\xEAu nh\u1EADn th\u1EE9c & \u0110\xE1nh \u0111\u1ED5i K\u1EF9 thu\u1EADt"
|
|
19071
|
-
},
|
|
19072
|
-
SLIDE: {
|
|
19073
|
-
"Title & Agenda": "Ti\xEAu \u0111\u1EC1 & M\u1EE5c l\u1EE5c",
|
|
19074
|
-
"Core Concepts": "Kh\xE1i ni\u1EC7m C\u1ED1t l\xF5i",
|
|
19075
|
-
"Guided Demonstration": "H\u01B0\u1EDBng d\u1EABn Th\u1EF1c h\xE0nh & Th\u1ECB ph\u1EA1m",
|
|
19076
|
-
"Hands-on Mission": "Nhi\u1EC7m v\u1EE5 Th\u1EF1c h\xE0nh Tr\u1EA3i nghi\u1EC7m",
|
|
19077
|
-
"Summary & Next Steps": "T\u1ED5ng k\u1EBFt & \u0110\u1ECBnh h\u01B0\u1EDBng Ti\u1EBFp theo"
|
|
19078
|
-
}
|
|
18659
|
+
var TEMPLATE_BY_TYPE = {
|
|
18660
|
+
LESSON: "LESSON_5E_template.md",
|
|
18661
|
+
LESSON_5E: "LESSON_5E_template.md",
|
|
18662
|
+
LESSON_EDP: "LESSON_EDP_template.md",
|
|
18663
|
+
LESSON_GENERAL: "LESSON_GENERAL_template.md",
|
|
18664
|
+
ACT: "ACT_template.md",
|
|
18665
|
+
CODE: "CODE_template.md",
|
|
18666
|
+
// JSON-first code lab shares the CODE label set (the serializer renders its
|
|
18667
|
+
// own headings; this lookup only feeds the SLC/directive fallback path).
|
|
18668
|
+
CODE_LAB: "CODE_template.md",
|
|
18669
|
+
QUIZ: "QUIZ_v4.6_template.md",
|
|
18670
|
+
GUIDE: "GUIDE_template.md",
|
|
18671
|
+
HANDOUT: "HANDOUT_template.md",
|
|
18672
|
+
WKS: "WKS_template.md",
|
|
18673
|
+
EXT: "EXT_template.md",
|
|
18674
|
+
SLIDE: "SLIDE_template.md",
|
|
18675
|
+
KNOWLEDGE_EXPOSITION: "KNOWLEDGE_EXPOSITION_template.md",
|
|
18676
|
+
LEARNER_PROFILE: "LEARNER_PROFILE_template.md",
|
|
18677
|
+
PROJECT_BRIEF: "PROJECT_BRIEF_template.md",
|
|
18678
|
+
CURRICULUM_FRAMEWORK: "CURRICULUM_FRAMEWORK_template.md",
|
|
18679
|
+
CONTENT_STYLE_GUIDE: "CONTENT_STYLE_GUIDE_template.md",
|
|
18680
|
+
SECTION_LANGUAGE_CONTRACT: "SECTION_LANGUAGE_CONTRACT_template.md"
|
|
19079
18681
|
};
|
|
18682
|
+
function keepContractEntries(artifactType, mapping) {
|
|
18683
|
+
const templateFile = TEMPLATE_BY_TYPE[artifactType.trim().toUpperCase()];
|
|
18684
|
+
if (!templateFile) return mapping;
|
|
18685
|
+
const resolved = resolveArtifactTemplate(templateFile);
|
|
18686
|
+
if (!resolved) return mapping;
|
|
18687
|
+
const contract = new Set(resolved.sections.map(stripHeadingKey));
|
|
18688
|
+
const kept = {};
|
|
18689
|
+
for (const [k, v] of Object.entries(mapping)) {
|
|
18690
|
+
if (contract.has(stripHeadingKey(k))) kept[k] = v;
|
|
18691
|
+
}
|
|
18692
|
+
return kept;
|
|
18693
|
+
}
|
|
19080
18694
|
function extractSectionHeadingsFromSLC(slcInput, artifactType, targetLanguage = "vi") {
|
|
19081
18695
|
const upperType = artifactType.trim().toUpperCase();
|
|
19082
18696
|
const getFallback = () => {
|
|
19083
|
-
|
|
19084
|
-
|
|
19085
|
-
|
|
19086
|
-
|
|
19087
|
-
|
|
19088
|
-
}
|
|
19089
|
-
}
|
|
19090
|
-
return {};
|
|
18697
|
+
const templateFile = TEMPLATE_BY_TYPE[upperType];
|
|
18698
|
+
if (!templateFile) return {};
|
|
18699
|
+
const resolved = resolveArtifactTemplate(templateFile);
|
|
18700
|
+
if (!resolved) return {};
|
|
18701
|
+
return Object.fromEntries(resolved.sections.map((s) => [s, s]));
|
|
19091
18702
|
};
|
|
19092
18703
|
if (!slcInput) return getFallback();
|
|
19093
18704
|
if (typeof slcInput === "object") {
|
|
19094
|
-
if (slcInput[upperType] && Object.keys(slcInput[upperType]).length > 0)
|
|
18705
|
+
if (slcInput[upperType] && Object.keys(slcInput[upperType]).length > 0) {
|
|
18706
|
+
return keepContractEntries(upperType, slcInput[upperType]);
|
|
18707
|
+
}
|
|
19095
18708
|
for (const [key, mapping] of Object.entries(slcInput)) {
|
|
19096
18709
|
if (matchesArtifactType(key, upperType) && Object.keys(mapping).length > 0) {
|
|
19097
|
-
return mapping;
|
|
18710
|
+
return keepContractEntries(upperType, mapping);
|
|
19098
18711
|
}
|
|
19099
18712
|
}
|
|
19100
18713
|
return getFallback();
|
|
@@ -19122,24 +18735,33 @@ function extractSectionHeadingsFromSLC(slcInput, artifactType, targetLanguage =
|
|
|
19122
18735
|
}
|
|
19123
18736
|
}
|
|
19124
18737
|
}
|
|
19125
|
-
if (Object.keys(mapping).length > 0) return mapping;
|
|
18738
|
+
if (Object.keys(mapping).length > 0) return keepContractEntries(upperType, mapping);
|
|
19126
18739
|
}
|
|
19127
18740
|
}
|
|
19128
18741
|
return getFallback();
|
|
19129
18742
|
}
|
|
19130
|
-
function buildHeadingDirective(artifactType, slcMarkdown, targetLanguage = "vi") {
|
|
19131
|
-
const
|
|
18743
|
+
function buildHeadingDirective(artifactType, slcMarkdown, targetLanguage = "vi", opts) {
|
|
18744
|
+
const upperType = artifactType.trim().toUpperCase();
|
|
18745
|
+
const templateFile = TEMPLATE_BY_TYPE[upperType];
|
|
18746
|
+
const resolved = templateFile ? resolveArtifactTemplate(templateFile) : null;
|
|
18747
|
+
const baked = !!resolved && resolved.declaredLang !== "en";
|
|
18748
|
+
const headings = resolved ? Object.fromEntries(
|
|
18749
|
+
resolved.sections.map((s) => [
|
|
18750
|
+
s,
|
|
18751
|
+
baked ? s : extractSectionHeadingsFromSLC(slcMarkdown, upperType, targetLanguage)[s] || s
|
|
18752
|
+
])
|
|
18753
|
+
) : extractSectionHeadingsFromSLC(baked ? null : slcMarkdown, upperType, targetLanguage);
|
|
19132
18754
|
if (Object.keys(headings).length === 0) {
|
|
19133
18755
|
return "";
|
|
19134
18756
|
}
|
|
19135
18757
|
const lines = Object.entries(headings).map(
|
|
19136
|
-
([
|
|
18758
|
+
([heading, display]) => heading === display ? ` - "${display}"` : ` - "${heading}" -> Use Display Heading: "${display}"`
|
|
19137
18759
|
);
|
|
19138
|
-
return `MANDATORY SECTION HEADINGS
|
|
19139
|
-
-
|
|
19140
|
-
- In the markdown body, section headers MUST
|
|
18760
|
+
return `MANDATORY SECTION HEADINGS (SOURCE: RESOLVED ARTIFACT TEMPLATE):
|
|
18761
|
+
- Copy the template's YAML frontmatter \`template_required_sections\` list VERBATIM into the artifact frontmatter \u2014 never translate, reorder, or invent entries.
|
|
18762
|
+
- In the markdown body, section headers MUST be exactly the Display Headings below (do NOT translate, paraphrase, or re-marker them):
|
|
19141
18763
|
${lines.join("\n")}
|
|
19142
|
-
-
|
|
18764
|
+
- Example: if the resolved template's heading is "${Object.values(headings)[0]}", your body heading must be exactly "## ${Object.values(headings)[0]}".`;
|
|
19143
18765
|
}
|
|
19144
18766
|
|
|
19145
18767
|
// src/services/curriculumHorizon.ts
|
|
@@ -19786,53 +19408,9 @@ zod.z.object({
|
|
|
19786
19408
|
assessmentMap: zod.z.array(zod.z.record(zod.z.string())).default([]),
|
|
19787
19409
|
tieredScaffolding: zod.z.object({ bronze: zod.z.string().default(""), silver: zod.z.string().default(""), gold: zod.z.string().default("") }).default({ bronze: "", silver: "", gold: "" })
|
|
19788
19410
|
});
|
|
19789
|
-
|
|
19790
|
-
|
|
19791
|
-
|
|
19792
|
-
// Repo checkout layouts.
|
|
19793
|
-
"docs/refs/templates"
|
|
19794
|
-
];
|
|
19795
|
-
var _moduleDir = (() => {
|
|
19796
|
-
try {
|
|
19797
|
-
if (typeof ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)) }) !== "undefined" && typeof (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)) === "string") {
|
|
19798
|
-
return path__default.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
|
|
19799
|
-
}
|
|
19800
|
-
} catch {
|
|
19801
|
-
}
|
|
19802
|
-
return typeof __dirname !== "undefined" ? __dirname : process.cwd();
|
|
19803
|
-
})();
|
|
19804
|
-
function candidateDirs(explicitDir) {
|
|
19805
|
-
const dirs = [];
|
|
19806
|
-
if (process.env.CURRICULUM_TEMPLATES_DIR) dirs.push(process.env.CURRICULUM_TEMPLATES_DIR);
|
|
19807
|
-
dirs.push(path__default.default.resolve(process.cwd(), "_templates"));
|
|
19808
|
-
for (const rel of KIT_TEMPLATE_FALLBACK_DIRS) {
|
|
19809
|
-
dirs.push(path__default.default.resolve(_moduleDir, rel));
|
|
19810
|
-
dirs.push(path__default.default.resolve(process.cwd(), rel));
|
|
19811
|
-
dirs.push(path__default.default.resolve(process.cwd(), "packages/curriculum-kit", rel));
|
|
19812
|
-
}
|
|
19813
|
-
return dirs;
|
|
19814
|
-
}
|
|
19815
|
-
function findTemplatePath(templateName, explicitDir) {
|
|
19816
|
-
for (const dir of candidateDirs()) {
|
|
19817
|
-
const p = path__default.default.join(dir, templateName);
|
|
19818
|
-
if (!fs5__default.default.existsSync(p)) continue;
|
|
19819
|
-
try {
|
|
19820
|
-
fs5__default.default.accessSync(p, fs5__default.default.constants.R_OK);
|
|
19821
|
-
return p;
|
|
19822
|
-
} catch {
|
|
19823
|
-
}
|
|
19824
|
-
}
|
|
19825
|
-
return null;
|
|
19826
|
-
}
|
|
19827
|
-
function loadCurriculumTemplate(templateName, templatesDir) {
|
|
19828
|
-
const p = findTemplatePath(templateName);
|
|
19829
|
-
if (!p) return "";
|
|
19830
|
-
try {
|
|
19831
|
-
return fs5__default.default.readFileSync(p, "utf-8");
|
|
19832
|
-
} catch {
|
|
19833
|
-
return "";
|
|
19834
|
-
}
|
|
19835
|
-
}
|
|
19411
|
+
|
|
19412
|
+
// src/services/lessonProductionService.ts
|
|
19413
|
+
init_templateLoader();
|
|
19836
19414
|
|
|
19837
19415
|
// src/services/singleArtifactService.ts
|
|
19838
19416
|
init_errors();
|