education-mcp 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/PRIVACY.md +53 -0
- package/README.md +144 -0
- package/TERMS.md +57 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +8 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +191 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/explain-concept.d.ts +9 -0
- package/dist/tools/explain-concept.d.ts.map +1 -0
- package/dist/tools/explain-concept.js +168 -0
- package/dist/tools/explain-concept.js.map +1 -0
- package/dist/tools/generate-exercise.d.ts +8 -0
- package/dist/tools/generate-exercise.d.ts.map +1 -0
- package/dist/tools/generate-exercise.js +364 -0
- package/dist/tools/generate-exercise.js.map +1 -0
- package/dist/tools/generate-flashcards.d.ts +9 -0
- package/dist/tools/generate-flashcards.d.ts.map +1 -0
- package/dist/tools/generate-flashcards.js +131 -0
- package/dist/tools/generate-flashcards.js.map +1 -0
- package/dist/tools/generate-lesson-plan.d.ts +8 -0
- package/dist/tools/generate-lesson-plan.d.ts.map +1 -0
- package/dist/tools/generate-lesson-plan.js +169 -0
- package/dist/tools/generate-lesson-plan.js.map +1 -0
- package/dist/tools/generate-quiz.d.ts +9 -0
- package/dist/tools/generate-quiz.d.ts.map +1 -0
- package/dist/tools/generate-quiz.js +153 -0
- package/dist/tools/generate-quiz.js.map +1 -0
- package/dist/tools/grade-rubric.d.ts +8 -0
- package/dist/tools/grade-rubric.d.ts.map +1 -0
- package/dist/tools/grade-rubric.js +354 -0
- package/dist/tools/grade-rubric.js.map +1 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +7 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/types.d.ts +215 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/helpers.d.ts +41 -0
- package/dist/utils/helpers.d.ts.map +1 -0
- package/dist/utils/helpers.js +134 -0
- package/dist/utils/helpers.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* generate_flashcards — Spaced repetition flashcard decks from a topic.
|
|
3
|
+
*
|
|
4
|
+
* Cards include front/back, optional hints, difficulty-tagged SR metadata,
|
|
5
|
+
* and a study schedule following the Leitner system.
|
|
6
|
+
*/
|
|
7
|
+
import { timestamp, clamp, requireNonEmpty, initialSR, reviewSchedule, detectSubject, } from "../utils/helpers.js";
|
|
8
|
+
const CARD_TEMPLATES = [
|
|
9
|
+
{
|
|
10
|
+
front: (t) => `What is ${t}?`,
|
|
11
|
+
back: (t) => `${t} is a subject area involving the systematic study and application of its core principles, methods, and practices.`,
|
|
12
|
+
hint: (t) => `Think about the fundamental definition of ${t} as a field of study.`,
|
|
13
|
+
difficulty: "easy",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
front: (t) => `What are the key components of ${t}?`,
|
|
17
|
+
back: (t) => `The key components of ${t} include: foundational concepts, methodologies, practical applications, and the relationships between its sub-areas.`,
|
|
18
|
+
hint: (t) => `Consider what building blocks make up ${t}.`,
|
|
19
|
+
difficulty: "easy",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
front: (t) => `Why is ${t} important?`,
|
|
23
|
+
back: (t) => `${t} is important because it provides frameworks for understanding, problem-solving tools, and contributes to both academic knowledge and practical real-world applications.`,
|
|
24
|
+
hint: (t) => `Think about both academic and real-world value.`,
|
|
25
|
+
difficulty: "easy",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
front: (t) => `What are common misconceptions about ${t}?`,
|
|
29
|
+
back: (t) => `Common misconceptions include: it requires only memorization (it also requires critical thinking), it has no real-world applications (it has many), and that there is only one correct approach (multiple valid methods exist).`,
|
|
30
|
+
hint: (t) => `What do beginners often get wrong about ${t}?`,
|
|
31
|
+
difficulty: "medium",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
front: (t) => `How does ${t} connect to other subjects?`,
|
|
35
|
+
back: (t) => `${t} connects to other subjects through shared methodologies, overlapping concepts, and interdisciplinary applications. Understanding these connections deepens comprehension of all related fields.`,
|
|
36
|
+
hint: (t) => `Think about what other subjects share ideas with ${t}.`,
|
|
37
|
+
difficulty: "medium",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
front: (t) => `What skills does studying ${t} develop?`,
|
|
41
|
+
back: (t) => `Studying ${t} develops: analytical thinking, problem-solving, attention to detail, communication of complex ideas, and the ability to evaluate evidence and draw conclusions.`,
|
|
42
|
+
hint: (t) => `Consider both subject-specific and transferable skills.`,
|
|
43
|
+
difficulty: "medium",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
front: (t) => `Describe a real-world application of ${t}.`,
|
|
47
|
+
back: (t) => `${t} is applied in professional settings to solve practical problems, inform decision-making, and drive innovation. Practitioners use ${t} knowledge daily in fields like research, industry, education, and public policy.`,
|
|
48
|
+
hint: (t) => `Think about how professionals use ${t} in their daily work.`,
|
|
49
|
+
difficulty: "medium",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
front: (t) => `What are the main research methods used in ${t}?`,
|
|
53
|
+
back: (t) => `Research in ${t} employs methods including: observation and data collection, hypothesis testing, experimentation, modeling and simulation, and peer review of findings.`,
|
|
54
|
+
hint: (t) => `How do experts in ${t} discover new knowledge?`,
|
|
55
|
+
difficulty: "hard",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
front: (t) => `How has the understanding of ${t} evolved over time?`,
|
|
59
|
+
back: (t) => `Understanding of ${t} has evolved from foundational observations to sophisticated theories and applications. Key developments include the formalization of core principles, integration of technology, and expanding interdisciplinary connections.`,
|
|
60
|
+
hint: (t) => `Trace the historical development of ${t} from early ideas to modern practice.`,
|
|
61
|
+
difficulty: "hard",
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
front: (t) => `What are current challenges or open questions in ${t}?`,
|
|
65
|
+
back: (t) => `Current challenges in ${t} include: applying traditional methods to new contexts, integrating emerging technologies, addressing equity and accessibility, and resolving ongoing debates about best practices.`,
|
|
66
|
+
hint: (t) => `What problems in ${t} still need solving?`,
|
|
67
|
+
difficulty: "hard",
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
front: (t) => `Compare and contrast two major approaches within ${t}.`,
|
|
71
|
+
back: (t) => `Two major approaches in ${t} are the theoretical (abstract, principle-based) and the empirical (evidence-based, experimental). Theoretical approaches provide frameworks for understanding, while empirical approaches test and validate those frameworks through observation and data.`,
|
|
72
|
+
hint: (t) => `Think about theory vs. practice in ${t}.`,
|
|
73
|
+
difficulty: "hard",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
front: (t) => `What ethical considerations are relevant to ${t}?`,
|
|
77
|
+
back: (t) => `Ethical considerations in ${t} include: responsible use of knowledge, equity in access and participation, honest reporting of findings, respect for different perspectives, and consideration of societal impact.`,
|
|
78
|
+
hint: (t) => `How should practitioners of ${t} behave responsibly?`,
|
|
79
|
+
difficulty: "hard",
|
|
80
|
+
},
|
|
81
|
+
];
|
|
82
|
+
// ── Generator ──────────────────────────────────────────────────────────────────
|
|
83
|
+
export function generateFlashcards(input) {
|
|
84
|
+
const topic = requireNonEmpty(input.topic, "topic");
|
|
85
|
+
const cardCount = clamp(input.card_count ?? 10, 1, 100);
|
|
86
|
+
const difficulty = input.difficulty ?? "medium";
|
|
87
|
+
const includeHints = input.include_hints ?? true;
|
|
88
|
+
const tags = input.tags ?? [detectSubject(topic).toLowerCase()];
|
|
89
|
+
// Filter templates by difficulty preference (include easier ones too)
|
|
90
|
+
const difficultyOrder = ["easy", "medium", "hard"];
|
|
91
|
+
const maxDiffIdx = difficultyOrder.indexOf(difficulty);
|
|
92
|
+
const eligibleTemplates = CARD_TEMPLATES.filter((t) => difficultyOrder.indexOf(t.difficulty) <= maxDiffIdx + 1);
|
|
93
|
+
// Generate cards by cycling through templates
|
|
94
|
+
const cards = [];
|
|
95
|
+
for (let i = 0; i < cardCount; i++) {
|
|
96
|
+
const tpl = eligibleTemplates[i % eligibleTemplates.length];
|
|
97
|
+
const card = {
|
|
98
|
+
id: i + 1,
|
|
99
|
+
front: tpl.front(topic),
|
|
100
|
+
back: tpl.back(topic),
|
|
101
|
+
tags: [...tags, tpl.difficulty],
|
|
102
|
+
difficulty: tpl.difficulty,
|
|
103
|
+
sr: initialSR(tpl.difficulty),
|
|
104
|
+
};
|
|
105
|
+
if (includeHints && tpl.hint) {
|
|
106
|
+
card.hint = tpl.hint(topic);
|
|
107
|
+
}
|
|
108
|
+
cards.push(card);
|
|
109
|
+
}
|
|
110
|
+
const studyTips = [
|
|
111
|
+
"Study new cards in short sessions (15-20 minutes max) to maintain focus.",
|
|
112
|
+
"Review cards you got wrong again at the end of each session.",
|
|
113
|
+
"Space out your study sessions — daily short reviews beat weekly cramming.",
|
|
114
|
+
"Say the answer out loud before flipping the card to strengthen recall.",
|
|
115
|
+
"Create your own connections between cards to build a mental map.",
|
|
116
|
+
"Shuffle the deck regularly so you don't just memorize the order.",
|
|
117
|
+
];
|
|
118
|
+
return {
|
|
119
|
+
title: `${topic} Flashcard Deck`,
|
|
120
|
+
topic,
|
|
121
|
+
card_count: cards.length,
|
|
122
|
+
cards,
|
|
123
|
+
study_tips: studyTips.slice(0, Math.min(6, Math.max(3, Math.ceil(cardCount / 3)))),
|
|
124
|
+
metadata: {
|
|
125
|
+
generated_at: timestamp(),
|
|
126
|
+
estimated_study_minutes: Math.ceil(cardCount * 1.5),
|
|
127
|
+
review_schedule: reviewSchedule(cardCount),
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=generate-flashcards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-flashcards.js","sourceRoot":"","sources":["../../src/tools/generate-flashcards.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,EACL,SAAS,EACT,KAAK,EACL,eAAe,EACf,SAAS,EACT,cAAc,EACd,aAAa,GACd,MAAM,qBAAqB,CAAC;AAW7B,MAAM,cAAc,GAAmB;IACrC;QACE,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG;QAC7B,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,mHAAmH;QACpI,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,6CAA6C,CAAC,uBAAuB;QAClF,UAAU,EAAE,MAAM;KACnB;IACD;QACE,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,kCAAkC,CAAC,GAAG;QACpD,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,yBAAyB,CAAC,sHAAsH;QAC7J,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,yCAAyC,CAAC,GAAG;QAC1D,UAAU,EAAE,MAAM;KACnB;IACD;QACE,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,aAAa;QACtC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,0KAA0K;QAC3L,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,iDAAiD;QAC9D,UAAU,EAAE,MAAM;KACnB;IACD;QACE,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,wCAAwC,CAAC,GAAG;QAC1D,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,iOAAiO;QAC9O,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,2CAA2C,CAAC,GAAG;QAC5D,UAAU,EAAE,QAAQ;KACrB;IACD;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C,KAAK;QACL,UAAU,EAAE,KAAK,CAAC,MAAM;QACxB,KAAK;QACL,UAAU,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAClF,QAAQ,EAAE;YACR,YAAY,EAAE,SAAS,EAAE;YACzB,uBAAuB,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;YACnD,eAAe,EAAE,cAAc,CAAC,SAAS,CAAC;SAC3C;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* generate_lesson_plan — Structured lesson plans with objectives, activities, and assessment.
|
|
3
|
+
*
|
|
4
|
+
* Follows the Madeline Hunter lesson plan model with Bloom's taxonomy alignment.
|
|
5
|
+
*/
|
|
6
|
+
import type { GenerateLessonPlanInput, LessonPlanResult } from "../types.js";
|
|
7
|
+
export declare function generateLessonPlan(input: GenerateLessonPlanInput): LessonPlanResult;
|
|
8
|
+
//# sourceMappingURL=generate-lesson-plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-lesson-plan.d.ts","sourceRoot":"","sources":["../../src/tools/generate-lesson-plan.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,uBAAuB,EACvB,gBAAgB,EAIjB,MAAM,aAAa,CAAC;AAmJrB,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,gBAAgB,CA4CnF"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* generate_lesson_plan — Structured lesson plans with objectives, activities, and assessment.
|
|
3
|
+
*
|
|
4
|
+
* Follows the Madeline Hunter lesson plan model with Bloom's taxonomy alignment.
|
|
5
|
+
*/
|
|
6
|
+
import { timestamp, clamp, requireNonEmpty, } from "../utils/helpers.js";
|
|
7
|
+
// ── Generators ─────────────────────────────────────────────────────────────────
|
|
8
|
+
function generateObjectives(topic, subject, count) {
|
|
9
|
+
const templates = [
|
|
10
|
+
{ desc: (t, s) => `Students will be able to define and identify key terms related to ${t} in ${s}.`, bloom: "remember" },
|
|
11
|
+
{ desc: (t, s) => `Students will be able to explain the main concepts of ${t} in their own words.`, bloom: "understand" },
|
|
12
|
+
{ desc: (t, s) => `Students will be able to apply ${t} principles to solve new problems.`, bloom: "apply" },
|
|
13
|
+
{ desc: (t, s) => `Students will be able to analyze relationships between different aspects of ${t}.`, bloom: "analyze" },
|
|
14
|
+
{ desc: (t, s) => `Students will be able to evaluate different approaches to ${t} and justify their reasoning.`, bloom: "evaluate" },
|
|
15
|
+
{ desc: (t, s) => `Students will be able to create an original work demonstrating understanding of ${t}.`, bloom: "create" },
|
|
16
|
+
];
|
|
17
|
+
return templates.slice(0, clamp(count, 1, 6)).map((tpl) => ({
|
|
18
|
+
description: tpl.desc(topic, subject),
|
|
19
|
+
bloom_level: tpl.bloom,
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
function generateStandards(subject, gradeLevel) {
|
|
23
|
+
// Common Core / NGSS style standard codes (illustrative)
|
|
24
|
+
const standards = {
|
|
25
|
+
Mathematics: [
|
|
26
|
+
`CCSS.MATH.CONTENT.${gradeLevel.toUpperCase()}.1 — Apply concepts and procedures`,
|
|
27
|
+
`CCSS.MATH.PRACTICE.MP1 — Make sense of problems and persevere in solving them`,
|
|
28
|
+
],
|
|
29
|
+
"English Language Arts": [
|
|
30
|
+
`CCSS.ELA-LITERACY.${gradeLevel.toUpperCase()}.1 — Read closely and cite textual evidence`,
|
|
31
|
+
`CCSS.ELA-LITERACY.W.${gradeLevel.toUpperCase()}.2 — Write informative/explanatory texts`,
|
|
32
|
+
],
|
|
33
|
+
default: [
|
|
34
|
+
`Standard 1: Demonstrate understanding of core concepts in the subject area`,
|
|
35
|
+
`Standard 2: Apply critical thinking and problem-solving skills`,
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
return standards[subject] ?? standards["default"];
|
|
39
|
+
}
|
|
40
|
+
function generateActivities(topic, totalMinutes) {
|
|
41
|
+
// Time allocation: warm-up 10%, main 70%, closure 10%, buffer 10%
|
|
42
|
+
const warmUpMin = Math.max(3, Math.round(totalMinutes * 0.1));
|
|
43
|
+
const closureMin = Math.max(3, Math.round(totalMinutes * 0.1));
|
|
44
|
+
const mainMin = totalMinutes - warmUpMin - closureMin;
|
|
45
|
+
const warmUp = {
|
|
46
|
+
name: "Activation & Hook",
|
|
47
|
+
duration_minutes: warmUpMin,
|
|
48
|
+
description: `Begin with a thought-provoking question about ${topic} to activate prior knowledge. Allow students to discuss briefly with a partner before sharing with the class.`,
|
|
49
|
+
materials: ["Whiteboard", "Markers"],
|
|
50
|
+
teacher_notes: "Listen for misconceptions during pair discussions — address these during the main lesson.",
|
|
51
|
+
};
|
|
52
|
+
const activity1Min = Math.round(mainMin * 0.4);
|
|
53
|
+
const activity2Min = Math.round(mainMin * 0.35);
|
|
54
|
+
const activity3Min = mainMin - activity1Min - activity2Min;
|
|
55
|
+
const main = [
|
|
56
|
+
{
|
|
57
|
+
name: "Direct Instruction",
|
|
58
|
+
duration_minutes: activity1Min,
|
|
59
|
+
description: `Present the core concepts of ${topic} using visual aids and real-world examples. Check for understanding with targeted questions throughout.`,
|
|
60
|
+
materials: ["Presentation slides", "Handout with key vocabulary"],
|
|
61
|
+
teacher_notes: "Pause every 5 minutes for a quick comprehension check. Use cold-calling to ensure all students engage.",
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "Guided Practice",
|
|
65
|
+
duration_minutes: activity2Min,
|
|
66
|
+
description: `Students work through structured problems related to ${topic} in small groups. Teacher circulates to provide feedback and scaffolding.`,
|
|
67
|
+
materials: ["Practice worksheet", "Manipulatives (if applicable)"],
|
|
68
|
+
teacher_notes: "Group struggling students together for targeted support. Provide extension problems for advanced groups.",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "Independent Practice",
|
|
72
|
+
duration_minutes: activity3Min,
|
|
73
|
+
description: `Students independently apply what they've learned about ${topic}. This serves as a formative assessment opportunity.`,
|
|
74
|
+
materials: ["Independent practice sheet"],
|
|
75
|
+
teacher_notes: "Collect work for formative assessment data. Note which students need reteaching.",
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
const closure = {
|
|
79
|
+
name: "Closure & Reflection",
|
|
80
|
+
duration_minutes: closureMin,
|
|
81
|
+
description: `Students complete an exit ticket summarizing what they learned about ${topic}. Conduct a brief whole-class review of key takeaways.`,
|
|
82
|
+
materials: ["Exit ticket template"],
|
|
83
|
+
teacher_notes: "Review exit tickets before the next class to inform planning. Address any widespread gaps immediately.",
|
|
84
|
+
};
|
|
85
|
+
return { warmUp, main, closure };
|
|
86
|
+
}
|
|
87
|
+
function generateAssessment(topic) {
|
|
88
|
+
return [
|
|
89
|
+
{
|
|
90
|
+
type: "formative",
|
|
91
|
+
description: `Exit ticket: Students answer 2-3 questions demonstrating understanding of ${topic}.`,
|
|
92
|
+
criteria: [
|
|
93
|
+
"Correctly identifies key concepts",
|
|
94
|
+
"Uses appropriate vocabulary",
|
|
95
|
+
"Provides clear explanations",
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
type: "formative",
|
|
100
|
+
description: `Observation during guided practice: Monitor student discussions and problem-solving approaches.`,
|
|
101
|
+
criteria: [
|
|
102
|
+
"Active participation in group work",
|
|
103
|
+
"Appropriate use of strategies taught",
|
|
104
|
+
"Ability to explain reasoning to peers",
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
type: "summative",
|
|
109
|
+
description: `End-of-unit assessment on ${topic} covering all learning objectives.`,
|
|
110
|
+
criteria: [
|
|
111
|
+
"Mastery of key vocabulary and definitions",
|
|
112
|
+
"Application of concepts to novel situations",
|
|
113
|
+
"Analysis and evaluation of scenarios",
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
];
|
|
117
|
+
}
|
|
118
|
+
function generateMaterials(topic) {
|
|
119
|
+
return [
|
|
120
|
+
"Whiteboard and markers",
|
|
121
|
+
`Presentation slides on ${topic}`,
|
|
122
|
+
"Student handouts (vocabulary sheet + practice problems)",
|
|
123
|
+
"Exit ticket templates",
|
|
124
|
+
"Timer/clock for activity transitions",
|
|
125
|
+
`Visual aids related to ${topic} (diagrams, charts, or models)`,
|
|
126
|
+
];
|
|
127
|
+
}
|
|
128
|
+
// ── Main ───────────────────────────────────────────────────────────────────────
|
|
129
|
+
export function generateLessonPlan(input) {
|
|
130
|
+
const topic = requireNonEmpty(input.topic, "topic");
|
|
131
|
+
const subject = requireNonEmpty(input.subject, "subject");
|
|
132
|
+
const gradeLevel = requireNonEmpty(input.grade_level, "grade_level");
|
|
133
|
+
const duration = clamp(input.duration_minutes ?? 45, 15, 180);
|
|
134
|
+
const objectivesCount = clamp(input.objectives_count ?? 3, 1, 6);
|
|
135
|
+
const includeStandards = input.include_standards ?? true;
|
|
136
|
+
const includeHomework = input.include_homework ?? false;
|
|
137
|
+
const objectives = generateObjectives(topic, subject, objectivesCount);
|
|
138
|
+
const { warmUp, main, closure } = generateActivities(topic, duration);
|
|
139
|
+
const assessment = generateAssessment(topic);
|
|
140
|
+
const materials = generateMaterials(topic);
|
|
141
|
+
const result = {
|
|
142
|
+
title: `${topic} — ${subject} Lesson`,
|
|
143
|
+
subject,
|
|
144
|
+
grade_level: gradeLevel,
|
|
145
|
+
duration_minutes: duration,
|
|
146
|
+
objectives,
|
|
147
|
+
materials,
|
|
148
|
+
warm_up: warmUp,
|
|
149
|
+
activities: main,
|
|
150
|
+
closure,
|
|
151
|
+
assessment,
|
|
152
|
+
differentiation: {
|
|
153
|
+
struggling: `Provide graphic organizers and vocabulary word banks for ${topic}. Pair with a peer buddy. Reduce the number of independent practice problems and allow extra time.`,
|
|
154
|
+
advanced: `Offer extension activities that require deeper analysis of ${topic}. Allow students to explore connections to related topics or create their own problems for peers.`,
|
|
155
|
+
ell: `Pre-teach key vocabulary for ${topic} with visual supports. Provide bilingual glossaries where available. Use sentence frames for written and oral responses.`,
|
|
156
|
+
},
|
|
157
|
+
metadata: {
|
|
158
|
+
generated_at: timestamp(),
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
if (includeStandards) {
|
|
162
|
+
result.standards = generateStandards(subject, gradeLevel);
|
|
163
|
+
}
|
|
164
|
+
if (includeHomework) {
|
|
165
|
+
result.homework = `Review today's notes on ${topic}. Complete the homework practice sheet (problems 1-5). Write a one-paragraph reflection on what you found most challenging and why.`;
|
|
166
|
+
}
|
|
167
|
+
return result;
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=generate-lesson-plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-lesson-plan.js","sourceRoot":"","sources":["../../src/tools/generate-lesson-plan.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EACL,SAAS,EACT,KAAK,EACL,eAAe,GAEhB,MAAM,qBAAqB,CAAC;AAE7B,kFAAkF;AAElF,SAAS,kBAAkB,CAAC,KAAa,EAAE,OAAe,EAAE,KAAa;IACvE,MAAM,SAAS,GAAwF;QACrG,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,qEAAqE,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE;QACxH,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,yDAAyD,CAAC,sBAAsB,EAAE,KAAK,EAAE,YAAY,EAAE;QACzH,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,kCAAkC,CAAC,oCAAoC,EAAE,KAAK,EAAE,OAAO,EAAE;QAC3G,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC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,KAAK,qIAAqI,CAAC;IAC1L,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* generate_quiz — Create quizzes with multiple choice, true/false, and fill-in-blank questions.
|
|
3
|
+
*
|
|
4
|
+
* Uses template-based generation with topic-aware question banks.
|
|
5
|
+
* Real AI integration can be layered on top; this provides deterministic, testable output.
|
|
6
|
+
*/
|
|
7
|
+
import type { GenerateQuizInput, QuizResult } from "../types.js";
|
|
8
|
+
export declare function generateQuiz(input: GenerateQuizInput): QuizResult;
|
|
9
|
+
//# sourceMappingURL=generate-quiz.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-quiz.d.ts","sourceRoot":"","sources":["../../src/tools/generate-quiz.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EAIX,MAAM,aAAa,CAAC;AA0IrB,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,UAAU,CAyCjE"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* generate_quiz — Create quizzes with multiple choice, true/false, and fill-in-blank questions.
|
|
3
|
+
*
|
|
4
|
+
* Uses template-based generation with topic-aware question banks.
|
|
5
|
+
* Real AI integration can be layered on top; this provides deterministic, testable output.
|
|
6
|
+
*/
|
|
7
|
+
import { timestamp, clamp, shuffle, detectSubject, difficultyMultiplier, parseQuestionTypes, requireNonEmpty, } from "../utils/helpers.js";
|
|
8
|
+
function mcQuestion(topic, difficulty) {
|
|
9
|
+
const complexityWord = difficulty === "easy" ? "basic" : difficulty === "hard" ? "advanced" : "key";
|
|
10
|
+
return {
|
|
11
|
+
type: "multiple_choice",
|
|
12
|
+
question: `Which of the following best describes a ${complexityWord} concept in ${topic}?`,
|
|
13
|
+
options: [
|
|
14
|
+
`The fundamental principle underlying ${topic}`,
|
|
15
|
+
`An unrelated concept from a different field`,
|
|
16
|
+
`A common misconception about ${topic}`,
|
|
17
|
+
`A historical but outdated view of ${topic}`,
|
|
18
|
+
],
|
|
19
|
+
correct_answer: `The fundamental principle underlying ${topic}`,
|
|
20
|
+
explanation: `This answer correctly identifies the core principle of ${topic}. Understanding fundamentals is essential before exploring ${complexityWord} aspects.`,
|
|
21
|
+
difficulty,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function mcDefinition(topic, difficulty) {
|
|
25
|
+
return {
|
|
26
|
+
type: "multiple_choice",
|
|
27
|
+
question: `What is the most accurate definition of ${topic}?`,
|
|
28
|
+
options: [
|
|
29
|
+
`A systematic study and application of ${topic} principles`,
|
|
30
|
+
`A purely theoretical framework with no practical use`,
|
|
31
|
+
`An outdated concept no longer relevant today`,
|
|
32
|
+
`A simple memorization exercise`,
|
|
33
|
+
],
|
|
34
|
+
correct_answer: `A systematic study and application of ${topic} principles`,
|
|
35
|
+
explanation: `${topic} involves both theoretical understanding and practical application. The systematic approach distinguishes it from casual study.`,
|
|
36
|
+
difficulty,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function mcApplication(topic, difficulty) {
|
|
40
|
+
return {
|
|
41
|
+
type: "multiple_choice",
|
|
42
|
+
question: `In a real-world scenario involving ${topic}, which approach would be most effective?`,
|
|
43
|
+
options: [
|
|
44
|
+
`Apply the core principles of ${topic} systematically`,
|
|
45
|
+
`Ignore established methods and improvise`,
|
|
46
|
+
`Use only memorized facts without understanding`,
|
|
47
|
+
`Avoid ${topic} entirely and find alternatives`,
|
|
48
|
+
],
|
|
49
|
+
correct_answer: `Apply the core principles of ${topic} systematically`,
|
|
50
|
+
explanation: `Systematic application of ${topic} principles leads to the most reliable outcomes. Understanding why methods work is more valuable than rote memorization.`,
|
|
51
|
+
difficulty,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function tfBasic(topic, difficulty) {
|
|
55
|
+
return {
|
|
56
|
+
type: "true_false",
|
|
57
|
+
question: `${topic} is a field that requires both theoretical knowledge and practical skills.`,
|
|
58
|
+
options: ["True", "False"],
|
|
59
|
+
correct_answer: "True",
|
|
60
|
+
explanation: `Most areas of ${topic} require understanding theory and being able to apply it in practice. This dual requirement is what makes the subject both challenging and rewarding.`,
|
|
61
|
+
difficulty,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function tfMisconception(topic, difficulty) {
|
|
65
|
+
return {
|
|
66
|
+
type: "true_false",
|
|
67
|
+
question: `Understanding ${topic} requires no prerequisite knowledge from other subjects.`,
|
|
68
|
+
options: ["True", "False"],
|
|
69
|
+
correct_answer: "False",
|
|
70
|
+
explanation: `${topic} builds on concepts from related fields. Interdisciplinary connections strengthen understanding and enable deeper analysis.`,
|
|
71
|
+
difficulty,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function tfAdvanced(topic, difficulty) {
|
|
75
|
+
return {
|
|
76
|
+
type: "true_false",
|
|
77
|
+
question: `Experts in ${topic} agree that there is only one correct approach to solving problems in this area.`,
|
|
78
|
+
options: ["True", "False"],
|
|
79
|
+
correct_answer: "False",
|
|
80
|
+
explanation: `In ${topic}, multiple valid approaches often exist. Expert practitioners choose methods based on context, constraints, and goals rather than following a single rigid procedure.`,
|
|
81
|
+
difficulty,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function fibBasic(topic, difficulty) {
|
|
85
|
+
return {
|
|
86
|
+
type: "fill_in_blank",
|
|
87
|
+
question: `The study of ${topic} primarily focuses on understanding _______ and their relationships.`,
|
|
88
|
+
correct_answer: "fundamental principles",
|
|
89
|
+
explanation: `Fundamental principles form the foundation of ${topic}. Without understanding these core concepts, advanced study becomes significantly more difficult.`,
|
|
90
|
+
difficulty,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function fibTerminology(topic, difficulty) {
|
|
94
|
+
return {
|
|
95
|
+
type: "fill_in_blank",
|
|
96
|
+
question: `A person who specializes in ${topic} uses _______ to analyze and solve problems.`,
|
|
97
|
+
correct_answer: "systematic methods",
|
|
98
|
+
explanation: `Systematic methods are the hallmark of professional practice in ${topic}. These methods ensure consistency, reproducibility, and reliability of results.`,
|
|
99
|
+
difficulty,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function fibContext(topic, difficulty) {
|
|
103
|
+
return {
|
|
104
|
+
type: "fill_in_blank",
|
|
105
|
+
question: `When studying ${topic}, the ability to _______ concepts from one context to another is essential.`,
|
|
106
|
+
correct_answer: "transfer",
|
|
107
|
+
explanation: `Transfer of knowledge is a higher-order thinking skill in ${topic}. Students who can apply concepts across contexts demonstrate deep understanding.`,
|
|
108
|
+
difficulty,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
const TEMPLATES = {
|
|
112
|
+
multiple_choice: [mcQuestion, mcDefinition, mcApplication],
|
|
113
|
+
true_false: [tfBasic, tfMisconception, tfAdvanced],
|
|
114
|
+
fill_in_blank: [fibBasic, fibTerminology, fibContext],
|
|
115
|
+
};
|
|
116
|
+
// ── Generator ──────────────────────────────────────────────────────────────────
|
|
117
|
+
export function generateQuiz(input) {
|
|
118
|
+
const topic = requireNonEmpty(input.topic, "topic");
|
|
119
|
+
const questionCount = clamp(input.question_count ?? 5, 1, 50);
|
|
120
|
+
const types = parseQuestionTypes(input.question_types);
|
|
121
|
+
const difficulty = input.difficulty ?? "medium";
|
|
122
|
+
const subject = input.subject ?? detectSubject(topic);
|
|
123
|
+
// Build question pool
|
|
124
|
+
const pool = [];
|
|
125
|
+
for (const type of types) {
|
|
126
|
+
pool.push(...TEMPLATES[type]);
|
|
127
|
+
}
|
|
128
|
+
if (pool.length === 0) {
|
|
129
|
+
throw new Error("No question templates available for the specified types.");
|
|
130
|
+
}
|
|
131
|
+
// Generate questions by cycling through templates
|
|
132
|
+
const questions = [];
|
|
133
|
+
for (let i = 0; i < questionCount; i++) {
|
|
134
|
+
const templateFn = pool[i % pool.length];
|
|
135
|
+
const q = templateFn(topic, difficulty);
|
|
136
|
+
questions.push({ ...q, id: i + 1 });
|
|
137
|
+
}
|
|
138
|
+
// Shuffle to mix question types
|
|
139
|
+
shuffle(questions).forEach((q, idx) => (q.id = idx + 1));
|
|
140
|
+
const estimatedMinutes = Math.ceil(questionCount * 1.5 * difficultyMultiplier(difficulty));
|
|
141
|
+
return {
|
|
142
|
+
topic,
|
|
143
|
+
difficulty,
|
|
144
|
+
question_count: questions.length,
|
|
145
|
+
questions,
|
|
146
|
+
metadata: {
|
|
147
|
+
generated_at: timestamp(),
|
|
148
|
+
subject_area: subject,
|
|
149
|
+
estimated_duration_minutes: estimatedMinutes,
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=generate-quiz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-quiz.js","sourceRoot":"","sources":["../../src/tools/generate-quiz.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,EACL,SAAS,EACT,KAAK,EACL,OAAO,EACP,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAS7B,SAAS,UAAU,CAAC,KAAa,EAAE,UAA2B;IAC5D,MAAM,cAAc,GAAG,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC;IACpG,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,QAAQ,EAAE,2CAA2C,cAAc,eAAe,KAAK,GAAG;QAC1F,OAAO,EAAE;YACP,wCAAwC,KAAK,EAAE;YAC/C,6CAA6C;YAC7C,gCAAgC,KAAK,EAAE;YACvC,qCAAqC,KAAK,EAAE;SAC7C;QACD,cAAc,EAAE,wCAAwC,KAAK,EAAE;QAC/D,WAAW,EAAE,0DAA0D,KAAK,8DAA8D,cAAc,WAAW;QACnK,UAAU;KACX,CAA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IAEzD,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,GAAG,GAAG,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC;IAE3F,OAAO;QACL,KAAK;QACL,UAAU;QACV,cAAc,EAAE,SAAS,CAAC,MAAM;QAChC,SAAS;QACT,QAAQ,EAAE;YACR,YAAY,EAAE,SAAS,EAAE;YACzB,YAAY,EAAE,OAAO;YACrB,0BAA0B,EAAE,gBAAgB;SAC7C;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* grade_rubric — Create grading rubrics for assignments.
|
|
3
|
+
*
|
|
4
|
+
* Generates structured rubrics with criteria, weights, levels, and descriptors.
|
|
5
|
+
*/
|
|
6
|
+
import type { GradeRubricInput, GradeRubricResult } from "../types.js";
|
|
7
|
+
export declare function gradeRubric(input: GradeRubricInput): GradeRubricResult;
|
|
8
|
+
//# sourceMappingURL=grade-rubric.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grade-rubric.d.ts","sourceRoot":"","sources":["../../src/tools/grade-rubric.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EAGlB,MAAM,aAAa,CAAC;AA6TrB,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,iBAAiB,CA8DtE"}
|