Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

Commit bee67be

Browse files
committed
feat: add teacher notes functionality to lesson creation and editing
1 parent b4e1162 commit bee67be

3 files changed

Lines changed: 23 additions & 2 deletions

File tree

src/components/common/buttons/create-lesson-button.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export class CreateLessonPlanButton {
3636
gradeLevel: this.outcome.grade,
3737
date: new Date().toISOString(),
3838
timeLength: "~ 1 hour",
39+
teacherNotes: "",
3940
curricularOutcomes: [this.outcome.outcomeId],
4041
resourceLinks: [],
4142
assessmentEvidence: [],

src/models/lesson.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export interface ILesson {
1111
resourceLinks: string[];
1212
assessmentEvidence: AssessmentRow[];
1313
notes: string; // Markdown from ToastEditorField
14+
teacherNotes: string; // Markdown from ToastEditorField
1415
}
1516

1617
export class Lesson implements ILesson {
@@ -24,6 +25,7 @@ export class Lesson implements ILesson {
2425
resourceLinks: string[];
2526
assessmentEvidence: AssessmentRow[];
2627
notes: string; // Markdown from ToastEditorField
28+
teacherNotes: string; // Markdown from ToastEditorField
2729

2830
constructor(init?: Partial<Lesson>) {
2931
this.topic = init?.topic ?? "";
@@ -36,6 +38,7 @@ export class Lesson implements ILesson {
3638
this.resourceLinks = init?.resourceLinks ?? [];
3739
this.assessmentEvidence = init?.assessmentEvidence ?? [];
3840
this.notes = init?.notes ?? "";
41+
this.teacherNotes = init?.teacherNotes ?? "";
3942
}
4043

4144
/** Serialize to JSON string */

src/pages/lesson/lesson.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ class ToastEditorField implements LessonField<string> {
602602
header: HTMLHeadingElement;
603603
id: string;
604604

605-
constructor(id: string, labelText: string, helperText?: string) {
605+
constructor(id: string, labelText: string, helperText?: string, height: string = "800px") {
606606
this.id = id;
607607

608608
// wrapper
@@ -635,7 +635,7 @@ class ToastEditorField implements LessonField<string> {
635635
this.editor = new Editor({
636636
el: editorContainer,
637637
previewStyle: "vertical",
638-
height: "800px",
638+
height: height,
639639
initialEditType: "wysiwyg",
640640
usageStatistics: true,
641641
// theme: editorTheme,
@@ -726,6 +726,12 @@ class LessonNotesEditor extends ToastEditorField {
726726
}
727727
}
728728

729+
class TeacherNotesEditor extends ToastEditorField {
730+
constructor() {
731+
super("teacher-notes", "Teacher Notes", "", "250px");
732+
}
733+
}
734+
729735
class AssessmentEvidenceSection implements LessonField<AssessmentRow[]> {
730736
element: HTMLElement;
731737
header: HTMLHeadingElement;
@@ -1012,6 +1018,7 @@ class LessonBuilder {
10121018
private grade: GradeLevelSelect,
10131019
private date: DateField,
10141020
private time: TimeLengthSelect,
1021+
private teacherNotes: TeacherNotesEditor,
10151022
private outcomes: CurricularOutcomesSection,
10161023
private resources: ResourceLinksSection,
10171024
private assessment: AssessmentEvidenceSection,
@@ -1028,6 +1035,8 @@ class LessonBuilder {
10281035
**Date:** ${this.date.getValue() || ""}
10291036
**Time:** ${this.time.getValue() || ""}
10301037
1038+
${this.teacherNotes.getValue() ? `#### Teacher Notes:\n>${this.teacherNotes.getValue()}` : ""}
1039+
10311040
---
10321041
10331042
## Curricular Outcomes
@@ -1117,6 +1126,7 @@ function setupEditorPane() {
11171126
const gradeLevelSelect = new GradeLevelSelect();
11181127
const dateField = new DateField();
11191128
const timeLengthSelect = new TimeLengthSelect();
1129+
const teacherNotes = new TeacherNotesEditor();
11201130
const curricularOutcomesSection = new CurricularOutcomesSection();
11211131
const resourceLinks = new ResourceLinksSection();
11221132
const assessmentEvidence = new AssessmentEvidenceSection();
@@ -1128,6 +1138,7 @@ function setupEditorPane() {
11281138
(window as any).gradeLevelSelect = gradeLevelSelect;
11291139
(window as any).dateField = dateField;
11301140
(window as any).timeLengthSelect = timeLengthSelect;
1141+
(window as any).teacherNotes = teacherNotes;
11311142
(window as any).curricularOutcomesSection = curricularOutcomesSection;
11321143
(window as any).resourceLinks = resourceLinks;
11331144
(window as any).assessmentEvidence = assessmentEvidence;
@@ -1149,6 +1160,7 @@ function setupEditorPane() {
11491160
gradeLevelSelect,
11501161
dateField,
11511162
timeLengthSelect,
1163+
teacherNotes,
11521164
].forEach(f => grid.appendChild(f.element));
11531165

11541166
const editorPane = document.getElementById("editor-pane")!;
@@ -1170,6 +1182,7 @@ function setupEditorPane() {
11701182
gradeLevelSelect,
11711183
dateField,
11721184
timeLengthSelect,
1185+
teacherNotes,
11731186
curricularOutcomesSection,
11741187
resourceLinks,
11751188
assessmentEvidence,
@@ -1189,6 +1202,7 @@ function setupEditorPane() {
11891202
el.addEventListener("input", updatePreview)
11901203
);
11911204
lessonNotes.editor.on("change", updatePreview);
1205+
teacherNotes.editor.on("change", updatePreview);
11921206
curricularOutcomesSection.onChange = updatePreview;
11931207
resourceLinks.onChange = updatePreview;
11941208
assessmentEvidence.onChange = updatePreview;
@@ -1213,13 +1227,15 @@ async function saveLesson() {
12131227
gradeLevel: (document.getElementById("grade-level") as HTMLSelectElement)?.value || "",
12141228
date: (document.getElementById("date-time-input") as HTMLInputElement)?.value || "",
12151229
timeLength: (document.getElementById("time-length") as HTMLSelectElement)?.value || "",
1230+
teacherNotes: "",
12161231
curricularOutcomes: [],
12171232
resourceLinks: [],
12181233
assessmentEvidence: [],
12191234
notes: "",
12201235
};
12211236

12221237
// If your field instances are available globally or in scope:
1238+
data.teacherNotes = (window as any).teacherNotes.getValue();
12231239
data.notes = (window as any).lessonNotes.getValue();
12241240
data.curricularOutcomes = (window as any).curricularOutcomesSection.getValue();
12251241
data.resourceLinks = (window as any).resourceLinks.getValue();
@@ -1304,6 +1320,7 @@ async function loadLessonById() {
13041320
(window as any).gradeLevelSelect.setValue(data.gradeLevel || "");
13051321
(window as any).dateField.setValue(data.date || "");
13061322
(window as any).timeLengthSelect.setValue(data.timeLength || "");
1323+
(window as any).teacherNotes.setValue(data.teacherNotes || "");
13071324
(window as any).lessonNotes.setValue(data.notes || "");
13081325
await (window as any).curricularOutcomesSection.setValues(data.curricularOutcomes || []);
13091326
(window as any).resourceLinks.setValues(data.resourceLinks || []);

0 commit comments

Comments
 (0)