File size: 75,800 Bytes
65d68f5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ab01cae
65d68f5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ab01cae
65d68f5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
/**
 * Deterministic Physics lesson-seed system (Phase 6D).
 *
 * Seeds are short, derived, teacher-style content for the 11-step DocDoe class
 * flow. They are authored from the Kerala SSLC Class 10 Physics chapter and
 * always carry a sourceRef back to that chapter. No long textbook paragraphs,
 * no PYQ claims, no "guaranteed question" language. Static — easy to validate
 * and test.
 *
 * Current curated chapters:
 * - Sound Waves (chapterId phy-p1-c1)
 * - Lenses (chapterId phy-p1-c2)
 * - The World of Colours and Vision (chapterId phy-p1-c3)
 * - Electric Energy: Consumption and Conservation (chapterId phy-p2-c5)
 * - Electromagnetic Induction in Daily Life (chapterId phy-p2-c6)
 * - Mechanical Advantage in Action (chapterId phy-p2-c7)
 * - Magnetic Effect of Electric Current (chapterId phy-p1-c4)
 */

import { LENSES_SEEDS } from "./lensesLessonSeeds";
import { COLOURS_VISION_SEEDS } from "./coloursVisionLessonSeeds";
import { ELECTRIC_ENERGY_SEEDS } from "./electricEnergyLessonSeeds";
import { ELECTROMAGNETIC_INDUCTION_SEEDS } from "./electromagneticInductionLessonSeeds";
import { MECHANICAL_ADVANTAGE_SEEDS } from "./mechanicalAdvantageLessonSeeds";
import { MAGNETIC_EFFECT_SEEDS } from "./magneticEffectLessonSeeds";
import { CHEMISTRY_NOMENCLATURE_SEEDS } from "./chemistryNomenclatureSeeds";
// Chemistry seeds are registered only when their chapter title matches the
// canonical SCERT chapter manifest. The former C2-C5 files contain useful
// drafts, but their titles do not match the current textbook mapping and must
// not be presented as lessons under the wrong chapter.
import { CHEMISTRY_P1_C1_SEEDS } from "./chemistryP1C1Seeds";
import { BIOLOGY_P1_C1_SEEDS } from "./biologyP1C1Seeds";
import { BIOLOGY_P1_C2_SEEDS } from "./biologyP1C2Seeds";
import { BIOLOGY_P1_C3_SEEDS } from "./biologyP1C3Seeds";
import { BIOLOGY_P1_C4_SEEDS } from "./biologyP1C4Seeds";
import { BIOLOGY_P1_C5_SEEDS } from "./biologyP1C5Seeds";
import { BIOLOGY_P1_C6_SEEDS } from "./biologyP1C6Seeds";

export type LessonSeedSourceRef = {
  label: string;
  sourceBook: string;
  chapterTitle: string;
  pageRange?: string;
  url?: string | null;
  confidence: "source_backed" | "needs_review";
};

export type ExamAnswerSeed = {
  marks: 1 | 2 | 3 | 4 | 5;
  question: string;
  answerPoints: string[];
  keywords: string[];
  commonMistakes: string[];
  boardStyleRewrite: string;
};

export type CorrectionRubricSeed = {
  maxMarks: number;
  scoringPoints: Array<{
    point: string;
    marks: number;
    requiredKeywords: string[];
    minimumMatches?: number;
  }>;
  commonMissingParts: string[];
  feedbackTemplate: string;
};

export type QuizSeed = {
  id: string;
  type: "mcq" | "short" | "numerical" | "diagram";
  question: string;
  options?: string[];
  answer: string;
  explanation: string;
  difficulty: "easy" | "medium" | "exam";
  tags: string[];
  /**
   * Chapter tests may assess a concept taught in an earlier mission. These
   * fields keep each answer attached to that exact mastery node instead of a
   * vague chapter-level score.
   */
  conceptMissionId?: string;
  conceptLabel?: string;
};

export type VisualBoardSeed = {
  boardTitle: string;
  frames: Array<{
    id: string;
    title: string;
    teacherAction: string;
    boardText: string[];
    diagramDescription?: string;
    imageUrl?: string;
    studentFocus: string;
  }>;
};

export type PhysicsFormulaSeed = {
  formula: string;
  meaning: string;
  symbols: Array<{
    symbol: string;
    meaning: string;
    unit?: string;
  }>;
  commonUseCase: string;
  /** Source-backed warning rendered beside this formula when available. */
  commonMistake?: string;
  numericalPattern?: string;
};

export type LessonSeedContentType =
  | "concept"
  | "diagram"
  | "numerical"
  | "formula"
  | "exam_answer"
  | "revision"
  | "pyq_placeholder";

export type TuitionLessonSeed = {
  missionId: string;
  chapterId: string;
  subject: "Physics" | "Chemistry" | "Biology" | "Maths" | "Mathematics" | "Social Science";
  chapterTitle: string;
  missionTitle: string;
  goal: string;
  /**
   * Day 20 — one-line spoken hook that OPENS the mission (a real question a
   * teacher would ask before any definition). Optional: missions without one
   * fall back to their recall prompt when it is question-shaped.
   */
  hookLine?: string;
  estimatedMinutes: number;
  contentType: LessonSeedContentType;
  tags: string[];
  sourceRefs: LessonSeedSourceRef[];
  sourceStatus: "source_backed" | "needs_review";
  canTeach: boolean;
  pyqEvidenceStatus: "not_curated" | "curated";

  recall: {
    prompt: string;
    expectedPoints: string[];
    misconceptionCheck: string;
  };

  teach: {
    teacherIntro: string;
    explanationBlocks: Array<{
      heading: string;
      explanation: string;
      keyTerms: string[];
    }>;
    analogy?: string;
    malayalamSupport?: string;
    manglishSupport?: string;
  };

  visualBoard: VisualBoardSeed;

  docDoeTrick: {
    title: string;
    trick: string;
    whyItWorks: string;
  };

  keyNotes: string[];

  formulas: PhysicsFormulaSeed[];

  examAnswers: ExamAnswerSeed[];

  yourTurn: {
    prompt: string;
    expectedAnswerPoints: string[];
    hint: string;
  };

  correctionRubric: CorrectionRubricSeed;

  quiz: QuizSeed[];

  recap: {
    summary: string[];
    mustRemember: string[];
  };

  splitScreen?: {
    left: { title: string; imageUrl?: string; caption: string; captionHighlight?: string; };
    right: { title: string; imageUrl?: string; caption: string; captionHighlight?: string; };
  };

  quizTimer?: {
    question: string;
    answer?: string;
    options?: string[];
    countdownSeconds?: number;
  };

  hotspot?: {
    title: string;
    type: "hotspot" | "trap";
    formula?: string;
    values?: string[];
    calculation?: string;
    importantNote: string;
  };

  revisionSave: {
    flashcards: Array<{
      front: string;
      back: string;
      requiredKeywords?: string[];
    }>;
    revisionNotes: string[];
    weakAreaTags: string[];
  };

  qualityFlags: {
    needsHumanReview: boolean;
    reason?: string;
  };
};

// ---------------------------------------------------------------------------
// Source reference (Kerala SSLC Class 10 Physics — Sound Waves, pages 7-26).
// The chapter exists in outputs/sslc-physics-2025/1-sound-waves with extracted
// terms (period, frequency, compressions/rarefactions, wave motion, persistence
// of hearing). All seeds reference this chapter.
// ---------------------------------------------------------------------------
const SOUND_WAVES_SOURCE: LessonSeedSourceRef = {
  label: "Kerala SSLC Physics — Sound Waves (pp. 7-26)",
  sourceBook: "Kerala SCERT Physics, Standard X (2025)",
  chapterTitle: "Sound Waves",
  pageRange: "7-26",
  url: null,
  confidence: "source_backed",
};

const CHAPTER_ID = "phy-p1-c1";
const CHAPTER_TITLE = "Sound Waves";

function physicsSeed(seed: Omit<TuitionLessonSeed, "chapterId" | "subject" | "chapterTitle">): TuitionLessonSeed {
  return { ...seed, chapterId: CHAPTER_ID, subject: "Physics", chapterTitle: CHAPTER_TITLE };
}

// M1 — Nature of Sound Waves

// M1 — Oscillation, Amplitude, Period and Frequency
const M1: TuitionLessonSeed = physicsSeed({
  missionId: "M1",
  missionTitle: "Oscillation, Amplitude, Period and Frequency",
  goal: "Understand the basic terms of oscillatory motion using a pendulum and swing.",
  hookLine: "Why does a playground swing keep coming back to the same point, again and again?",
  estimatedMinutes: 20,
  contentType: "concept",
  tags: ["oscillation", "amplitude", "period", "frequency", "pendulum"],
  sourceRefs: [SOUND_WAVES_SOURCE],
  sourceStatus: "source_backed",
  canTeach: true,
  pyqEvidenceStatus: "not_curated",
  recall: {
    prompt: "Have you noticed how a swing moves back and forth from its resting position?",
    expectedPoints: ["Moves to and fro", "Returns to starting point"],
    misconceptionCheck: "Some think one oscillation is just going forward, but it must return.",
  },
  teach: {
    teacherIntro: "Before we study sound, we need to understand how things vibrate. Imagine a playground swing.",
    explanationBlocks: [
      {
        heading: "Oscillation",
        explanation: "When a swing sits perfectly still, that's its equilibrium position. If you pull it back and let it go—one full trip forward and all the way back is exactly one oscillation.",
        keyTerms: ["oscillation", "equilibrium position", "to and fro"],
      },
      {
        heading: "Amplitude",
        explanation: "How far you pull that swing back before letting it go? That maximum distance from the center is called the amplitude. We measure it in metres (m).",
        keyTerms: ["amplitude", "maximum displacement", "metre"],
      },
      {
        heading: "Period and Frequency",
        explanation: "The total time it takes for that one full swing (forward and back) is the Time Period (T). On the flip side, how many full swings you can squeeze into just one second is the Frequency (f). Because they are exact opposites, T = 1/f.",
        keyTerms: ["time period", "frequency", "hertz"],
      },
    ],
    analogy: "Think of Period as 'Time per swing' and Frequency as 'Swings per time'. They are exact opposites!",
    malayalamSupport: "ഒരു വസ്തു അതിന്റെ സന്തുലിതാവസ്ഥയിൽ നിന്ന് അങ്ങോട്ടും ഇങ്ങോട്ടും ചലിക്കുന്നതാണ് ഓസിലേഷൻ.",
    manglishSupport: "Equilibrium position-il ninnu to and fro move cheyyunnathaanu oscillation.",
  },
  visualBoard: {
    boardTitle: "Oscillatory Motion",
    frames: [
      {
        id: "m1-f1",
        title: "Simple Pendulum",
        teacherAction: "Look at this pendulum moving from O to A, then B, and back to O.",
        boardText: ["O = Equilibrium position", "One oscillation = O → A → B → O"],
        diagramDescription: "Pendulum swinging with O at center, A and B at extremes.",
        imageUrl: "assets/tuition/phy-p1-c1/img_13.png",
        studentFocus: "An oscillation must complete the full path.",
      },
      {
        id: "m1-f2",
        title: "Frequency vs Period",
        teacherAction: "Remember the relation: T and f are reciprocals.",
        boardText: ["Period (T) = time for 1 oscillation", "Frequency (f) = oscillations in 1 sec", "Unit of f = Hertz (Hz)"],
        studentFocus: "Frequency is per second. Period is time in seconds.",
      },
    ],
  },
  docDoeTrick: {
    title: "1-sec vs 1-osc",
    trick: "Time for 1 osc = Period (T). Osc in 1 sec = Frequency (f).",
    whyItWorks: "Contrasting '1 osc' and '1 sec' prevents you from confusing their definitions.",
  },
  keyNotes: [
    "Oscillation is the to-and-fro periodic motion of a body.",
    "Amplitude is maximum displacement from equilibrium (unit: m).",
    "Period (T) is time for one oscillation (unit: s).",
    "Frequency (f) is number of oscillations per second (unit: Hz).",
  ],
  formulas: [
    {
      formula: "f = 1 / T",
      meaning: "Frequency is the reciprocal of the period.",
      symbols: [
        { symbol: "f", meaning: "frequency", unit: "Hz" },
        { symbol: "T", meaning: "period", unit: "s" },
      ],
      commonUseCase: "Convert between frequency and period.",
    },
  ],
  examAnswers: [
    {
      marks: 2,
      question: "If a pendulum takes 1 minute to complete 30 oscillations, find its frequency.",
      answerPoints: ["Time = 60s", "f = 30/60 = 0.5 Hz"],
      keywords: ["60s", "0.5 Hz"],
      commonMistakes: ["Using 1 minute directly instead of seconds"],
      boardStyleRewrite: "Time = 1 min = 60 s. Frequency = Number of oscillations / Time = 30 / 60 = 0.5 Hz.",
    },
  ],
  yourTurn: {
    prompt: "Define amplitude. What is its SI unit? (2 marks)",
    expectedAnswerPoints: ["Maximum displacement from equilibrium position", "Unit is metre"],
    hint: "Think of the maximum distance it moves to one side.",
  },
  correctionRubric: {
    maxMarks: 2,
    scoringPoints: [
      { point: "Mentions maximum displacement", marks: 1, requiredKeywords: ["maximum", "displacement"] },
      { point: "Correct SI unit", marks: 1, requiredKeywords: ["metre", "m"], minimumMatches: 1 },
    ],
    commonMissingParts: ["'Maximum' keyword", "SI unit"],
    feedbackTemplate: "You got {covered}. Remember to include {missing}.",
  },
  quiz: [
    {
      id: "m1-q1",
      type: "mcq",
      question: "The SI unit of frequency is:",
      options: ["metre", "second", "hertz", "m/s"],
      answer: "hertz",
      explanation: "Hertz (Hz) is the unit of frequency.",
      difficulty: "easy",
      tags: ["frequency", "unit"],
    },
  ],
  recap: {
    summary: ["Oscillation is to-and-fro motion", "Amplitude is max displacement", "f = 1/T"],
    mustRemember: ["f is measured in Hz, T in seconds"],
  },
  revisionSave: {
    flashcards: [
      { front: "What is frequency?", back: "Number of oscillations per second (Hz).", requiredKeywords: ["number", "oscillations", "second"] },
      { front: "What is amplitude?", back: "Maximum displacement from equilibrium position." },
    ],
    revisionNotes: ["f = 1/T", "Amplitude determines how far it swings"],
    weakAreaTags: ["oscillation basics"],
  },
  qualityFlags: { needsHumanReview: false },
});

// M2 — Natural Frequency, Forced Vibration & Resonance
const M2: TuitionLessonSeed = physicsSeed({
  missionId: "M2",
  missionTitle: "Natural Frequency, Forced Vibration & Resonance",
  goal: "Understand natural frequency and how forced vibrations lead to resonance.",
  hookLine: "Why are soldiers told to break their marching steps while crossing a bridge?",
  estimatedMinutes: 25,
  contentType: "concept",
  tags: ["natural frequency", "forced vibration", "resonance"],
  sourceRefs: [SOUND_WAVES_SOURCE],
  sourceStatus: "source_backed",
  canTeach: true,
  pyqEvidenceStatus: "not_curated",
  recall: {
    prompt: "Have you ever felt a table vibrate when a mixie is running on it?",
    expectedPoints: ["Table shakes", "Sound becomes louder"],
    misconceptionCheck: "Students might not know the table is forced to vibrate by the mixie.",
  },
  teach: {
    teacherIntro: "Every object in the universe has its own favorite shaking speed. Let's see what happens when we force it to vibrate at a different speed.",
    explanationBlocks: [
      {
        heading: "Natural Frequency",
        explanation: "If you tap a glass, it rings at a specific pitch. That innate, favorite vibration speed is its natural frequency. It depends entirely on the object's length, size, and material.",
        keyTerms: ["natural frequency", "freely vibrates"],
      },
      {
        heading: "Forced Vibration",
        explanation: "If you turn on a heavy mixie on a table, the whole table starts shaking! The table didn't want to shake, but it was forced to by the mixie. This is a forced vibration.",
        keyTerms: ["forced vibration", "induced"],
      },
      {
        heading: "Resonance",
        explanation: "Now, what if the mixie's shaking speed perfectly matches the table's natural favorite speed? The table will shake violently with maximum amplitude! This magical match is called Resonance.",
        keyTerms: ["resonance", "equal frequency", "maximum amplitude"],
      },
    ],
    analogy: "If you push someone on a swing at random times, they barely move (forced vibration). But if you push at exactly their natural swinging rhythm, they go much higher (resonance)!",
    malayalamSupport: "രണ്ട് വസ്തുക്കളുടെ സ്വാഭാവിക ഫ്രീക്വൻസി തുല്യമാകുമ്പോൾ അവ ഉയർന്ന ആംപ്ലിറ്റ്യൂഡിൽ കമ്പനം ചെയ്യുന്നതാണ് റെസൊണൻസ്.",
    manglishSupport: "Randu objects-inte natural frequency equal aakumpol ulla maximum amplitude vibration aanu resonance.",
  },
  visualBoard: {
    boardTitle: "Resonance in Action",
    frames: [
      {
        id: "m2-f1",
        title: "Forced Vibration",
        teacherAction: "When we press a vibrating tuning fork on a table, the table vibrates too.",
        boardText: ["Vibrating object touches table", "Table is forced to vibrate → louder sound"],
        diagramDescription: "Tuning fork pressed against a table.",
        imageUrl: "assets/tuition/phy-p1-c1/img_22.png",
        studentFocus: "The table vibrates because of the external force.",
      },
      {
        id: "m2-f2",
        title: "Resonance Condition",
        teacherAction: "Notice that resonance only happens when the frequencies match perfectly.",
        boardText: ["Forcing Frequency = Natural Frequency", "Result: Maximum Amplitude"],
        studentFocus: "Equal frequency causes resonance.",
      },
    ],
  },
  docDoeTrick: {
    title: "The Matching Rule",
    trick: "Resonance = Matching Frequencies = Max Amplitude.",
    whyItWorks: "In exams, if they ask why something vibrates heavily, the answer is always that their frequencies matched.",
  },
  keyNotes: [
    "Natural frequency depends on length, size, elasticity, and material.",
    "Forced vibration is caused by an external vibrating object.",
    "Resonance occurs when forcing frequency equals natural frequency.",
    "During resonance, the object vibrates with maximum amplitude.",
    "Applications: MRI scanning, radio tuning, musical instruments.",
  ],
  formulas: [],
  examAnswers: [
    {
      marks: 2,
      question: "What is resonance?",
      answerPoints: ["When natural frequency of forcing object equals forced object.", "Vibrates with maximum amplitude."],
      keywords: ["equal", "natural frequency", "maximum amplitude"],
      commonMistakes: ["Forgetting to mention maximum amplitude"],
      boardStyleRewrite: "If the natural frequency of the forcing object and that of the forced object are equal, they are said to be in resonance. They will vibrate with maximum amplitude.",
    },
  ],
  yourTurn: {
    prompt: "Name two factors that influence the natural frequency of an object. (1 mark)",
    expectedAnswerPoints: ["Length", "Size", "Elasticity", "Nature of material"],
    hint: "Think about what changes if you use a smaller or longer tuning fork.",
  },
  correctionRubric: {
    maxMarks: 1,
    scoringPoints: [
      { point: "Mentions any two factors", marks: 1, requiredKeywords: ["length", "size", "elasticity", "material"] },
    ],
    commonMissingParts: ["Listing only one factor"],
    feedbackTemplate: "Good. You listed {covered}.",
  },
  quiz: [
    {
      id: "m2-q1",
      type: "mcq",
      question: "During resonance, the amplitude of vibration is:",
      options: ["minimum", "maximum", "zero", "constant"],
      answer: "maximum",
      explanation: "Resonance causes the objects to vibrate with maximum amplitude.",
      difficulty: "easy",
      tags: ["resonance"],
    },
  ],
  recap: {
    summary: ["Natural frequency is innate to an object", "Forced vibration is induced", "Resonance = matching frequencies & max amplitude"],
    mustRemember: ["Resonance happens when frequencies are equal"],
  },
  revisionSave: {
    flashcards: [
      { front: "What happens during resonance?", back: "Objects vibrate with maximum amplitude because frequencies match." },
    ],
    revisionNotes: ["Pitch depends on frequency", "Loudness depends on amplitude"],
    weakAreaTags: ["pitch", "loudness"],
  },
  splitScreen: {
    left: { title: "Amplitude", imageUrl: "assets/tuition/phy-p1-c1/img_30.png", caption: "Determines the loudness of sound.", captionHighlight: "Higher Amplitude = Louder Sound" },
    right: { title: "Frequency", imageUrl: "assets/tuition/phy-p1-c1/img_34.png", caption: "Determines the pitch (shrillness).", captionHighlight: "Higher Frequency = Shriller Sound" }
  },
  qualityFlags: { needsHumanReview: false },
});

// M3 — Wave Motion & Types of Waves
const M3: TuitionLessonSeed = physicsSeed({
  missionId: "M3",
  missionTitle: "Wave Motion & Types of Waves",
  goal: "Learn how waves transfer energy without transferring particles, and differentiate longitudinal and transverse waves.",
  hookLine: "When you drop a stone in a pond, does the water itself travel to the shore?",
  estimatedMinutes: 30,
  contentType: "concept",
  tags: ["wave motion", "mechanical waves", "electromagnetic", "longitudinal", "transverse"],
  sourceRefs: [SOUND_WAVES_SOURCE],
  sourceStatus: "source_backed",
  canTeach: true,
  pyqEvidenceStatus: "not_curated",
  recall: {
    prompt: "If you stretch a slinky and shake one end, what moves to the other end?",
    expectedPoints: ["The disturbance moves", "The coils stay in place"],
    misconceptionCheck: "People think the material moves forward, but only energy moves.",
  },
  teach: {
    teacherIntro: "Sound travels as a wave. Let's understand what a wave actually is and the different types of waves.",
    explanationBlocks: [
      {
        heading: "Wave Motion",
        explanation: "Think of a 'Mexican wave' in a cricket stadium. The people (particles) just stand up and sit down—they don't run across the stadium! But the wave itself (the energy) travels all the way around. That is wave motion: energy moves, particles just vibrate in place.",
        keyTerms: ["energy", "propagation", "no particle displacement"],
      },
      {
        heading: "Mechanical vs Electromagnetic",
        explanation: "Some waves need a physical material to travel through, like sound needing air or water. These are Mechanical waves. Others, like light or radio waves, can travel through totally empty space! These are Electromagnetic waves.",
        keyTerms: ["mechanical", "electromagnetic", "medium"],
      },
      {
        heading: "No sound in vacuum",
        explanation: "Because sound is a mechanical wave, it cannot travel through a vacuum. In the bell jar experiment, as the air is slowly pumped out, the ringing bell fades to silence even though the hammer is still striking it.",
        keyTerms: ["vacuum", "bell jar", "medium needed"],
      },
      {
        heading: "Longitudinal vs Transverse",
        explanation: "If you push and pull a slinky straight forward and back, that's a Longitudinal wave (like sound). If you shake the slinky up and down like a snake, that's a Transverse wave (like water ripples).",
        keyTerms: ["longitudinal", "transverse", "parallel", "perpendicular"],
      },
    ],
    analogy: "Wave motion is like doing 'the wave' in a stadium. People just stand up and sit down (vibrate), but the 'wave' travels across the stadium (energy transfer).",
    malayalamSupport: "മാധ്യമത്തിലെ കണികകൾ സഞ്ചരിക്കാതെ ഊർജ്ജം മാത്രം പകരുന്നതാണ് തരംഗ ചലനം.",
    manglishSupport: "Particles move cheyyathe energy maathram pass aakunnathaane wave motion.",
  },
  visualBoard: {
    boardTitle: "Types of Waves",
    frames: [
      {
        id: "m3-f1",
        title: "Longitudinal Wave",
        teacherAction: "Look at the slinky. The push is parallel to the wave direction.",
        boardText: ["Vibration is PARALLEL to direction", "Forms Compressions (C) & Rarefactions (R)", "Example: Sound"],
        diagramDescription: "Slinky with dense compressions and sparse rarefactions.",
        imageUrl: "assets/tuition/phy-p1-c1/img_30.png",
        studentFocus: "Parallel = Longitudinal.",
      },
      {
        id: "m3-f2",
        title: "Transverse Wave",
        teacherAction: "Now shake the slinky up and down. The vibration is perpendicular.",
        boardText: ["Vibration is PERPENDICULAR", "Forms Crests & Troughs", "Example: Light, Water ripples"],
        diagramDescription: "Slinky moving up and down in sine-wave shape.",
        imageUrl: "assets/tuition/phy-p1-c1/img_34.png",
        studentFocus: "Perpendicular = Transverse.",
      },
    ],
  },
  docDoeTrick: {
    title: "Para-Long, Perp-Trans",
    trick: "Parallel -> Longitudinal. Perpendicular -> Transverse.",
    whyItWorks: "Just linking the 'P' words with their wave types saves time in MCQs.",
  },
  keyNotes: [
    "Wave motion transfers energy, not particles.",
    "Mechanical waves (Sound) require a medium.",
    "Sound cannot travel through a vacuum (bell jar experiment).",
    "Electromagnetic waves (Light, Radio) do not require a medium.",
    "Longitudinal waves vibrate parallel to the direction of propagation (Compressions & Rarefactions).",
    "Transverse waves vibrate perpendicular to the direction of propagation (Crests & Troughs).",
    "Sound is a longitudinal mechanical wave.",
  ],
  formulas: [],
  examAnswers: [
    {
      marks: 2,
      question: "Distinguish between longitudinal and transverse waves.",
      answerPoints: ["Longitudinal: Particles vibrate parallel to propagation direction. Forms compressions and rarefactions.", "Transverse: Particles vibrate perpendicular to propagation direction. Forms crests and troughs."],
      keywords: ["parallel", "compressions", "perpendicular", "crests"],
      commonMistakes: ["Mixing up parallel and perpendicular"],
      boardStyleRewrite: "In longitudinal waves, particles vibrate parallel to the direction of propagation, forming compressions and rarefactions. In transverse waves, particles vibrate perpendicular to the direction of propagation, forming crests and troughs.",
    },
  ],
  yourTurn: {
    prompt: "Give one example each for a mechanical wave and an electromagnetic wave. (2 marks)",
    expectedAnswerPoints: ["Mechanical: Sound", "Electromagnetic: Light / Radio waves"],
    hint: "Which one needs a medium? Which one doesn't?",
  },
  correctionRubric: {
    maxMarks: 2,
    scoringPoints: [
      { point: "Correct mechanical example", marks: 1, requiredKeywords: ["sound", "seismic", "water"] },
      { point: "Correct electromagnetic example", marks: 1, requiredKeywords: ["light", "radio", "x-ray", "gamma"] },
    ],
    commonMissingParts: ["Matching the wrong wave to the wrong type"],
    feedbackTemplate: "Good job identifying {covered}.",
  },
  quiz: [
    {
      id: "m3-q1",
      type: "mcq",
      question: "Which of these does not require a medium for transmission?",
      options: ["Sound waves", "Seismic waves", "Radio waves", "Ripples on water"],
      answer: "Radio waves",
      explanation: "Radio waves are electromagnetic waves, which do not need a medium.",
      difficulty: "easy",
      tags: ["electromagnetic"],
    },
  ],
  recap: {
    summary: ["Waves transfer energy, not particles", "Longitudinal = parallel (C & R)", "Transverse = perpendicular (Crests & Troughs)"],
    mustRemember: ["Sound is a mechanical longitudinal wave."],
  },
  revisionSave: {
    flashcards: [
      { front: "What is a longitudinal wave?", back: "Particles vibrate parallel to wave direction (Compressions & Rarefactions)." },
      { front: "What is a transverse wave?", back: "Particles vibrate perpendicular to wave direction (Crests & Troughs)." },
    ],
    revisionNotes: ["Longitudinal = parallel (sound)", "Transverse = perpendicular (light)"],
    weakAreaTags: ["longitudinal", "transverse"],
  },
  splitScreen: {
    left: { title: "Longitudinal Wave", imageUrl: "assets/tuition/phy-p1-c1/img_41.png", caption: "Slinky moving back and forth.", captionHighlight: "Compressions and Rarefactions" },
    right: { title: "Transverse Wave", imageUrl: "assets/tuition/phy-p1-c1/img_45.png", caption: "Rope moving up and down.", captionHighlight: "Crests and Troughs" }
  },
  qualityFlags: { needsHumanReview: false },
});

// M4 — Frequency, Wavelength and Wave Speed (v = fλ)
const M4: TuitionLessonSeed = physicsSeed({
  missionId: "M4",
  // Day 20 — title names the actual quantities (a weak student searches
  // "frequency wavelength", not the textbook section heading), which also
  // lets the tuition brain route that weak topic to this mission.
  missionTitle: "Frequency, Wavelength and Wave Speed (v = fλ)",
  goal: "Define wavelength, speed of a wave, and understand the relationship v = fλ.",
  hookLine: "If a sound becomes shriller, what happens to the size of its wave?",
  estimatedMinutes: 30,
  contentType: "formula",
  tags: ["wavelength", "speed", "v=fλ"],
  sourceRefs: [SOUND_WAVES_SOURCE],
  sourceStatus: "source_backed",
  canTeach: true,
  pyqEvidenceStatus: "not_curated",
  recall: {
    prompt: "We already know frequency (f) is oscillations per second. What is wavelength?",
    expectedPoints: ["The length of one wave"],
    misconceptionCheck: "Students might confuse wavelength with amplitude.",
  },
  teach: {
    teacherIntro: "Now let's measure the physical size and speed of a wave, and see how they are connected mathematically.",
    explanationBlocks: [
      {
        heading: "Wavelength (λ)",
        explanation: "Wavelength is just the physical length of one complete wave. It's the distance between one wave peak and the exact same spot on the very next wave. We measure it in metres (m).",
        keyTerms: ["wavelength", "consecutive", "metre"],
      },
      {
        heading: "Speed of wave (v)",
        explanation: "Speed is simply how much distance the wave covers in one single second. Just like a car's speed, we measure it in metres per second (m/s).",
        keyTerms: ["speed", "distance in one second", "m/s"],
      },
      {
        heading: "The relation v = fλ",
        explanation: "If Frequency (f) is how many waves hit you per second, and Wavelength (λ) is the physical size of each wave... then Speed (v) is just (number of waves) × (size of wave)! So, v = fλ.",
        keyTerms: ["v = fλ", "inversely proportional"],
      },
    ],
    analogy: "If frequency is how many steps you take per second, and wavelength is the size of each step, then speed is how much distance you cover per second.",
    malayalamSupport: "v = fλ എന്നതാണ് പ്രധാന ഫോർമുല. വേഗത സ്ഥിരമാണെങ്കിൽ, ഫ്രീക്വൻസി കൂടുമ്പോൾ തരംഗദൈർഘ്യം (wavelength) കുറയും.",
    manglishSupport: "Speed (v) = Frequency (f) × Wavelength (λ). Speed constant aayirunnal, f koodumpol λ kurayum.",
  },
  visualBoard: {
    boardTitle: "Wavelength and Speed",
    frames: [
      {
        id: "m4-f1",
        title: "Wavelength in Longitudinal Waves",
        teacherAction: "Look at the compressions and rarefactions.",
        boardText: ["Wavelength (λ) = Distance between two consecutive compressions (C-C) or rarefactions (R-R)"],
        diagramDescription: "Longitudinal wave showing λ between two compressions.",
        imageUrl: "assets/tuition/phy-p1-c1/img_41.png",
        studentFocus: "λ is the gap between identical points.",
      },
      {
        id: "m4-f2",
        title: "The Formula v = fλ",
        teacherAction: "This is the most important formula in this chapter.",
        boardText: ["Speed (v) = Frequency (f) × Wavelength (λ)", "If v is constant, f ∝ 1/λ"],
        diagramDescription: "v = fλ triangle.",
        imageUrl: "assets/tuition/phy-p1-c1/img_45.png",
        studentFocus: "Speed relates frequency and wavelength.",
      },
    ],
  },
  docDoeTrick: {
    title: "Inverse Rule",
    trick: "High Frequency = Short Wavelength. Low Frequency = Long Wavelength.",
    whyItWorks: "Because speed is constant in a given medium, if f goes up, λ must go down to keep the product the same.",
  },
  keyNotes: [
    "Wavelength (λ) is the distance between consecutive particles in the same phase.",
    "Unit of λ is metre (m).",
    "Speed (v) is distance travelled in one second. Unit is m/s.",
    "Speed = frequency × wavelength (v = fλ).",
    "When speed is constant, frequency is inversely proportional to wavelength.",
  ],
  formulas: [
    {
      formula: "v = f × λ",
      meaning: "Speed equals frequency times wavelength.",
      symbols: [
        { symbol: "v", meaning: "speed", unit: "m/s" },
        { symbol: "f", meaning: "frequency", unit: "Hz" },
        { symbol: "λ", meaning: "wavelength", unit: "m" },
      ],
      commonUseCase: "Calculating wave speed.",
    },
  ],
  examAnswers: [
    {
      marks: 2,
      question: "Define wavelength of a longitudinal wave.",
      answerPoints: ["It is the distance between two consecutive compressions or two consecutive rarefactions."],
      keywords: ["consecutive", "compressions", "rarefactions"],
      commonMistakes: ["Just saying 'length of a wave'"],
      boardStyleRewrite: "The distance between two consecutive compressions or two consecutive rarefactions is considered as the wavelength of a longitudinal wave.",
    },
  ],
  yourTurn: {
    prompt: "If speed is constant, what happens to wavelength when frequency increases? (1 mark)",
    expectedAnswerPoints: ["Wavelength decreases"],
    hint: "They are inversely proportional.",
  },
  correctionRubric: {
    maxMarks: 1,
    scoringPoints: [
      { point: "Mentions it decreases", marks: 1, requiredKeywords: ["decreases", "reduces", "inversely"] },
    ],
    commonMissingParts: ["Not understanding inverse proportionality"],
    feedbackTemplate: "Correct. {covered}.",
  },
  quiz: [
    {
      id: "m4-q1",
      type: "mcq",
      question: "If a wave travels 700 m in 2 s, its speed is:",
      options: ["1400 m/s", "350 m/s", "700 m/s", "2 m/s"],
      answer: "350 m/s",
      explanation: "Speed = Distance / Time = 700 / 2 = 350 m/s.",
      difficulty: "medium",
      tags: ["speed"],
    },
  ],
  recap: {
    summary: ["Wavelength (λ) = distance between consecutive C-C or R-R", "v = fλ", "f is inversely proportional to λ"],
    mustRemember: ["v = fλ is the core formula."],
  },
  revisionSave: {
    flashcards: [
      { front: "What is the relation between speed, frequency, and wavelength?", back: "v = fλ" },
      { front: "Unit of wavelength?", back: "metre (m)" },
    ],
    revisionNotes: ["v = fλ", "f ∝ 1/λ when v is constant"],
    weakAreaTags: ["v=fλ"],
  },
  qualityFlags: { needsHumanReview: false },
});

// M5 — Numericals using v = fλ
const M5: TuitionLessonSeed = physicsSeed({
  missionId: "M5",
  missionTitle: "Numericals using v = fλ",
  goal: "Solve exam-style numericals step-by-step using v = fλ.",
  hookLine: "Can you find the speed of a wave from just two numbers in the question?",
  estimatedMinutes: 25,
  contentType: "numerical",
  tags: ["numerical", "v=fλ", "substitution", "cm to m"],
  sourceRefs: [SOUND_WAVES_SOURCE],
  sourceStatus: "source_backed",
  canTeach: true,
  pyqEvidenceStatus: "not_curated",
  recall: {
    prompt: "What is the formula connecting speed, frequency, and wavelength?",
    expectedPoints: ["v = fλ"],
    misconceptionCheck: "Students substitute wavelength in cm without converting to metres.",
  },
  teach: {
    teacherIntro: "Let's apply our new magic formula v = fλ to solve exam problems! The secret trick? Watch your units.",
    explanationBlocks: [
      {
        heading: "Step 1 — Choose formula",
        explanation: "Always write down the values you are given. If you have speed and frequency, and you want wavelength, just rearrange the triangle: λ = v/f.",
        keyTerms: ["formula"],
      },
      {
        heading: "Step 2 — Unit Conversion",
        explanation: "This is a trap many students fall into! If the wavelength is given in centimeters (cm), you MUST divide by 100 to change it to metres (m) before putting it into the formula.",
        keyTerms: ["cm to m"],
      },
    ],
    analogy: "Think of solving physics problems like baking a cake. Converting cm to m is like pre-heating the oven—you HAVE to do it first, or the whole recipe fails!",
    malayalamSupport: "കണക്ക് ചെയ്യുമ്പോൾ cm നെ m ആക്കാൻ മറക്കരുത് (÷100).",
    manglishSupport: "cm unit-il aanengil adyam m aakuka, divide by 100.",
  },
  visualBoard: {
    boardTitle: "Solving Numericals",
    frames: [
      {
        id: "m5-f1",
        title: "Worked Example",
        teacherAction: "Let's find frequency when v = 350 m/s and λ = 2 m.",
        boardText: ["Given: v = 350 m/s, λ = 2 m", "Formula: f = v / λ", "f = 350 / 2 = 175 Hz"],
        studentFocus: "Write the unit Hz at the end.",
      },
      {
        id: "m5-f2",
        title: "Unit Trap",
        teacherAction: "Watch out for cm!",
        boardText: ["Given: λ = 35 cm", "Convert: λ = 35 / 100 = 0.35 m", "Then substitute into v = fλ"],
        studentFocus: "Never substitute cm directly.",
      },
    ],
  },
  docDoeTrick: {
    title: "F-S-U-A",
    trick: "Formula → Substitute → Unit-check → Answer.",
    whyItWorks: "Four fixed steps prevent silly mistakes and secure method marks.",
  },
  keyNotes: [
    "Use v = fλ.",
    "Convert cm to m before substituting (÷100).",
    "Speed in m/s, frequency in Hz, wavelength in m.",
  ],
  formulas: [
    {
      formula: "v = f × λ",
      meaning: "Speed equals frequency times wavelength.",
      symbols: [
        { symbol: "v", meaning: "speed", unit: "m/s" },
        { symbol: "f", meaning: "frequency", unit: "Hz" },
        { symbol: "λ", meaning: "wavelength", unit: "m" },
      ],
      commonUseCase: "Speed from frequency and wavelength.",
    },
  ],
  examAnswers: [
    {
      marks: 3,
      question: "A wave has a frequency of 2 kHz and a wavelength of 35 cm. How far does this wave travel in 0.5 s?",
      answerPoints: ["f = 2000 Hz, λ = 0.35 m", "v = fλ = 2000 × 0.35 = 700 m/s", "Distance = v × t = 700 × 0.5 = 350 m"],
      keywords: ["2000 Hz", "0.35 m", "700 m/s", "350 m"],
      commonMistakes: ["Not converting kHz to Hz", "Not converting cm to m"],
      boardStyleRewrite: "Given f = 2 kHz = 2000 Hz. Wavelength λ = 35 cm = 0.35 m. Speed v = fλ = 2000 × 0.35 = 700 m/s. Distance travelled in 0.5 s = v × t = 700 × 0.5 = 350 m.",
    },
    {
      marks: 2,
      // Day 20 fix — this chapter uses v = 350 m/s for speed of sound in air
      // everywhere else (M2 quiz, M6 echo problems, M8); this problem had
      // drifted to 340 m/s, a real inconsistency a topper-level review
      // caught (a student could enter the exam with the wrong constant).
      question: "The speed of sound in air is 350 m/s. Find the wavelength of a sound wave whose frequency is 175 Hz.",
      answerPoints: ["Given: v = 350 m/s, f = 175 Hz", "λ = v / f = 350 / 175", "λ = 2 m"],
      keywords: ["λ = v/f", "2 m"],
      commonMistakes: ["Multiplying v × f instead of rearranging to λ = v/f"],
      boardStyleRewrite: "Given v = 350 m/s and f = 175 Hz. Wavelength λ = v/f = 350/175 = 2 m.",
    },
    {
      marks: 3,
      question: "A wave completes 250 oscillations in 5 seconds. If its wavelength is 1.2 m, find its frequency and speed.",
      answerPoints: [
        "Given: 250 oscillations in 5 s, λ = 1.2 m",
        "Frequency f = number of oscillations / time = 250 / 5 = 50 Hz",
        "v = fλ = 50 × 1.2 = 60 m/s",
      ],
      keywords: ["50 Hz", "v = fλ", "60 m/s"],
      commonMistakes: ["Taking 250 itself as the frequency without dividing by the 5 seconds"],
      boardStyleRewrite: "Given 250 oscillations in 5 s and λ = 1.2 m. Frequency f = 250/5 = 50 Hz. Speed v = fλ = 50 × 1.2 = 60 m/s.",
    },
  ],
  yourTurn: {
    prompt: "Speed of sound = 350 m/s. Frequency = 35 Hz. Find the distance between two consecutive compressions. (2 marks)",
    expectedAnswerPoints: ["λ = v/f", "λ = 350 / 35", "λ = 10 m"],
    hint: "Distance between consecutive compressions is just the wavelength.",
  },
  correctionRubric: {
    maxMarks: 2,
    scoringPoints: [
      { point: "Recognizes it's asking for wavelength", marks: 1, requiredKeywords: ["wavelength", "v/f"] },
      { point: "Calculates correct answer with unit", marks: 1, requiredKeywords: ["10", "m"] },
    ],
    commonMissingParts: ["Unit on the answer"],
    feedbackTemplate: "Good. You got {covered}.",
  },
  quiz: [
    {
      id: "m5-q1",
      type: "numerical",
      question: "If v = 20 m/s and distance between two adjacent troughs is 2 m, find frequency.",
      answer: "f = v/λ = 20 / 2 = 10 Hz",
      explanation: "Distance between troughs is wavelength (λ=2m). f=v/λ.",
      difficulty: "medium",
      tags: ["numerical"],
    },
  ],
  recap: {
    summary: ["Convert kHz to Hz", "Convert cm to m", "Use v = fλ"],
    mustRemember: ["Always check units before substituting."],
  },
  revisionSave: {
    flashcards: [
      { front: "Convert 2 kHz to Hz", back: "2000 Hz" },
      { front: "Convert 35 cm to m", back: "0.35 m" },
    ],
    revisionNotes: ["Distance between adjacent compressions or crests = Wavelength"],
    weakAreaTags: ["numericals"],
  },
  qualityFlags: { needsHumanReview: false },
});

// M6 — Reflection, Echo & Reverberation
const M6: TuitionLessonSeed = physicsSeed({
  missionId: "M6",
  missionTitle: "Reflection, Echo & Reverberation",
  goal: "Understand how sound reflects, the conditions for an echo, and reverberation.",
  hookLine: "Why do you hear your own voice come back to you in an empty hall?",
  estimatedMinutes: 30,
  contentType: "concept",
  tags: ["reflection", "echo", "persistence of hearing", "reverberation"],
  sourceRefs: [SOUND_WAVES_SOURCE],
  sourceStatus: "source_backed",
  canTeach: true,
  pyqEvidenceStatus: "not_curated",
  recall: {
    prompt: "Why don’t we hear an echo inside a small room?",
    expectedPoints: ["Walls are too close", "Sound comes back too fast"],
    misconceptionCheck: "Students think reflection doesn't happen in a small room. It does, but we can't distinguish it.",
  },
  teach: {
    teacherIntro: "Just like a rubber ball bounces off a wall, sound waves bounce off surfaces. Let's see what happens when sound bounces back to us.",
    explanationBlocks: [
      {
        heading: "Reflection of Sound",
        explanation: "When sound hits a hard, smooth surface (like a concrete wall), it bounces back perfectly. This is reflection. Rough surfaces (like carpets) tend to absorb sound instead.",
        keyTerms: ["reflection", "smooth surfaces"],
      },
      {
        heading: "Echo and Persistence of Hearing",
        explanation: "If you shout, your brain remembers that sound for exactly 0.1 seconds. If the bounced sound comes back AFTER that 0.1s gap, you hear it clearly as a second, separate sound. This is an Echo!",
        keyTerms: ["echo", "persistence of hearing", "0.1 second"],
      },
      {
        heading: "Reverberation",
        explanation: "But what if you are in a small empty room? The sound bounces back too fast and from many different walls at once! They all blend together into a long, messy 'boom' that lingers. That is Reverberation.",
        keyTerms: ["reverberation", "multiple reflections", "lingering"],
      },
    ],
    analogy: "An Echo is like catching a single tennis ball thrown against a wall. Reverberation is like having 100 ping pong balls bouncing around a small room all at once!",
    malayalamSupport: "പ്രതിധ്വനി (echo) കേൾക്കാൻ ശബ്ദം പ്രതിഫലിച്ച് കുറഞ്ഞത് 0.1 സെക്കൻഡ് കഴിഞ്ഞ് തിരിച്ചെത്തണം. ഒന്നിലധികം തവണ പ്രതിഫലിച്ച് ശബ്ദം നീണ്ടുനിൽക്കുന്നതാണ് reverberation.",
    manglishSupport: "Reflect cheytha sound 0.1s kazhinju ethumbol echo kelkkum. Multiple reflection kaaranam sound linger cheyyunnathaanu reverberation.",
  },
  visualBoard: {
    boardTitle: "Echo vs Reverberation",
    frames: [
      {
        id: "m6-f1",
        title: "Echo Condition",
        teacherAction: "Here is the calculation for the minimum distance for an echo.",
        boardText: ["Time required = 0.1 s", "Speed of sound ≈ 350 m/s", "Distance = speed × time = 35 m", "Reflecting surface must be at least 17.5 m away"],
        imageUrl: "assets/tuition/phy-p1-c1/img_54.png",
        studentFocus: "The 17.5 m minimum distance rule.",
      },
      {
        id: "m6-f2",
        title: "Reverberation",
        teacherAction: "Look at the multiple reflection paths inside an empty hall.",
        boardText: ["Multiple reflections", "Lingering of sound = Reverberation", "Walls made rough to reduce it"],
        imageUrl: "assets/tuition/phy-p1-c1/img_51.png",
        studentFocus: "Rough walls reduce reverberation.",
      },
    ],
  },
  docDoeTrick: {
    title: "17.5 m Rule",
    trick: "Distance traveled = 35m (in 0.1s). So wall distance = 35 / 2 = 17.5m.",
    whyItWorks: "Always halve the total distance to find the distance to the wall.",
  },
  keyNotes: [
    "Smooth, hard surfaces reflect sound waves very well.",
    "Persistence of hearing is 0.1 s.",
    "Echo is heard when reflected sound arrives after 0.1 s.",
    "Minimum distance for echo in air (v=350m/s) is 17.5 m.",
    "Reverberation is the lingering of sound due to multiple reflections.",
    "Walls of cinema theatres are made rough to absorb sound and reduce reverberation.",
  ],
  formulas: [
    {
      formula: "2d = v × t",
      meaning: "Total distance traveled by sound to reflecting surface and back.",
      symbols: [
        { symbol: "d", meaning: "distance to surface", unit: "m" },
        { symbol: "v", meaning: "speed", unit: "m/s" },
        { symbol: "t", meaning: "time", unit: "s" },
      ],
      commonUseCase: "Calculating distance to reflecting surface.",
    },
  ],
  examAnswers: [
    {
      marks: 3,
      question: "Why are the walls of large halls like cinema theatres made rough?",
      answerPoints: ["To prevent reverberation.", "Rough surfaces absorb sound better and reflect less.", "This prevents the lingering of sound."],
      keywords: ["reverberation", "absorb", "lingering"],
      commonMistakes: ["Confusing echo and reverberation"],
      boardStyleRewrite: "Walls of cinema theatres are made rough to reduce multiple reflections of sound. Rough surfaces absorb sound waves, thereby reducing reverberation (lingering of sound).",
    },
  ],
  yourTurn: {
    prompt: "The echo of a firecracker is heard after 1 s. Speed of sound is 350 m/s. Find the distance to the reflecting surface. (2 marks)",
    expectedAnswerPoints: ["Total distance = v × t = 350 × 1 = 350 m", "Distance to surface = 350 / 2 = 175 m"],
    hint: "The sound travels there and back. So divide the total distance by 2.",
  },
  correctionRubric: {
    maxMarks: 2,
    scoringPoints: [
      { point: "Calculates total distance 350m", marks: 1, requiredKeywords: ["350"] },
      { point: "Divides by 2 to get 175m", marks: 1, requiredKeywords: ["175", "m"] },
    ],
    commonMissingParts: ["Forgetting to divide by 2"],
    feedbackTemplate: "Good. {covered}.",
  },
  quiz: [
    {
      id: "m6-q1",
      type: "mcq",
      question: "The lingering of sound due to multiple reflection is called:",
      options: ["Echo", "Reverberation", "Refraction", "Resonance"],
      answer: "Reverberation",
      explanation: "Multiple reflection causes the sound to linger, which is reverberation.",
      difficulty: "easy",
      tags: ["reverberation"],
    },
  ],
  recap: {
    summary: ["Persistence of hearing = 0.1s", "Echo needs minimum 17.5m distance", "Reverberation is lingering sound"],
    mustRemember: ["Divide distance by 2 for echo problems."],
  },
  revisionSave: {
    flashcards: [
      { front: "What is persistence of hearing?", back: "The auditory experience persists for 1/10 of a second." },
      { front: "What is reverberation?", back: "Lingering of sound due to multiple reflections." },
    ],
    revisionNotes: ["Echo requires 0.1s gap", "Rough surfaces reduce reverberation"],
    weakAreaTags: ["echo", "reverberation"],
  },
  hotspot: {
    title: "Echo Calculation",
    type: "hotspot",
    formula: "v = 2d / t",
    values: ["v = velocity of sound", "d = distance to obstacle", "t = total time taken"],
    calculation: "d = (v × t) / 2",
    importantNote: "Total distance is 2d because sound travels to the obstacle AND back!"
  },
  qualityFlags: { needsHumanReview: false },
});

// M7 — Limits of Audibility & Ultrasonic Uses
const M7: TuitionLessonSeed = physicsSeed({
  missionId: "M7",
  missionTitle: "Limits of Audibility & Ultrasonic Uses",
  goal: "Understand audible range, infrasonic and ultrasonic sounds, and their applications.",
  hookLine: "Why can a dog hear a whistle that you cannot hear at all?",
  estimatedMinutes: 20,
  contentType: "concept",
  tags: ["audibility", "infrasonic", "ultrasonic", "SONAR"],
  sourceRefs: [SOUND_WAVES_SOURCE],
  sourceStatus: "source_backed",
  canTeach: true,
  pyqEvidenceStatus: "not_curated",
  recall: {
    prompt: "Can a person with normal hearing hear all sounds?",
    expectedPoints: ["No", "Only a certain range"],
    misconceptionCheck: "Some think we can hear everything, but dogs and bats can hear higher frequencies than us.",
  },
  teach: {
    teacherIntro: "Did you know there are thousands of sounds in the room right now that you literally cannot hear? Human ears are only built to tune into a specific range of sounds.",
    explanationBlocks: [
      {
        heading: "Limits of Audibility",
        explanation: "For a person with normal hearing, we can only hear sounds between 20 Hz and 20,000 Hz. That is our 'Audible Range'.",
        keyTerms: ["20 Hz", "20000 Hz", "audible"],
      },
      {
        heading: "Infrasonic and Ultrasonic",
        explanation: "Anything vibrating slower than 20 Hz is Infrasonic (like massive earthquake waves, or elephants whispering). Anything faster than 20,000 Hz is Ultrasonic (like dogs or bats communicating). We can't hear either of them!",
        keyTerms: ["infrasonic", "ultrasonic"],
      },
      {
        heading: "Uses of Ultrasonic Waves",
        explanation: "Because Ultrasonic waves vibrate so incredibly fast, they pack a lot of energy. We use them in medicine to safely take images of babies (ultrasound), crush kidney stones, and in submarines (SONAR) to map the ocean floor.",
        keyTerms: ["ultrasonography", "SONAR", "cleaning"],
      },
    ],
    analogy: "Think of your ears like a radio that only tunes into certain stations. The Infrasonic and Ultrasonic stations are still playing, but your ears just can't tune into them!",
    malayalamSupport: "20 Hz നും 20000 Hz നും ഇടയിലുള്ള ശബ്ദം മാത്രമേ മനുഷ്യന് കേൾക്കാനാകൂ. അതിനു മുകളിലുള്ളത് ultrasonic ഉം താഴെയുള്ളത് infrasonic ഉം ആണ്.",
    manglishSupport: "20 Hz to 20 kHz aanu audible range. 20000 Hz mukalil ultrasonic, 20 Hz thaazhe infrasonic.",
  },
  visualBoard: {
    boardTitle: "Sound Frequencies",
    frames: [
      {
        id: "m7-f1",
        title: "Audible Range",
        teacherAction: "Look at the spectrum. Humans are limited to the middle band.",
        boardText: ["< 20 Hz : Infrasonic (Elephants, seismic)", "20 Hz - 20000 Hz : Audible to humans", "> 20000 Hz : Ultrasonic (Bats, Dogs)"],
        imageUrl: "assets/tuition/phy-p1-c1/img_57.png",
        studentFocus: "Memorize the 20 to 20,000 Hz limit.",
      },
      {
        id: "m7-f2",
        title: "SONAR",
        teacherAction: "SONAR uses ultrasonic waves to find distance to the sea bottom.",
        boardText: ["SONAR", "Emits ultrasonic waves", "Calculates depth using reflection"],
        diagramDescription: "Ship sending waves to sea bottom and receiving reflection.",
        imageUrl: "assets/tuition/phy-p1-c1/img_60.png",
        studentFocus: "SONAR uses reflection of ultrasonic waves.",
      },
    ],
  },
  docDoeTrick: {
    title: "Ultra means Above",
    trick: "Ultra = Above 20k. Infra = Below 20.",
    whyItWorks: "Simple prefix association helps remember which is which.",
  },
  keyNotes: [
    "Audible range for humans: 20 Hz to 20000 Hz.",
    "Infrasonic: Below 20 Hz.",
    "Ultrasonic: Above 20000 Hz.",
    "Ultrasonic uses: Ultrasonography, crushing kidney stones, SONAR, cleaning irregular parts.",
  ],
  formulas: [],
  examAnswers: [
    {
      marks: 2,
      question: "Write two uses of ultrasonic waves in the medical field.",
      answerPoints: ["To crush small stones in the kidneys.", "In ultrasonography to take images of internal organs."],
      keywords: ["kidney stones", "ultrasonography"],
      commonMistakes: ["Writing SONAR (which is not medical)"],
      boardStyleRewrite: "Ultrasonic waves are used in the medical field to crush small stones in the kidneys and for ultrasonography (to take images of internal organs).",
    },
  ],
  yourTurn: {
    prompt: "What is the frequency of sound that a bat produces to catch prey? Is it infrasonic or ultrasonic? (2 marks)",
    expectedAnswerPoints: ["Above 20000 Hz", "Ultrasonic"],
    hint: "Bats use very high frequency sound.",
  },
  correctionRubric: {
    maxMarks: 2,
    scoringPoints: [
      { point: "Mentions above 20000 Hz", marks: 1, requiredKeywords: ["20000", "above"] },
      { point: "Identifies as ultrasonic", marks: 1, requiredKeywords: ["ultrasonic"] },
    ],
    commonMissingParts: ["Mentioning the exact frequency range"],
    feedbackTemplate: "Correct. {covered}.",
  },
  quiz: [
    {
      id: "m7-q1",
      type: "mcq",
      question: "Which of the following frequency can be heard by humans?",
      options: ["5 Hz", "2000 Hz", "200 kHz", "50 kHz"],
      answer: "2000 Hz",
      explanation: "2000 Hz falls within the 20 Hz to 20,000 Hz audible range.",
      difficulty: "easy",
      tags: ["audibility"],
    },
  ],
  recap: {
    summary: ["Audible range: 20 Hz to 20 kHz", "Infra < 20 Hz, Ultra > 20 kHz", "Ultrasonic used in SONAR and medicine"],
    mustRemember: ["SONAR uses ultrasonic waves."],
  },
  revisionSave: {
    flashcards: [
      { front: "What is the audible range for humans?", back: "20 Hz to 20,000 Hz." },
      { front: "What type of wave is used in SONAR?", back: "Ultrasonic waves." },
    ],
    revisionNotes: ["Infra = below 20 Hz", "Ultra = above 20 kHz"],
    weakAreaTags: ["ultrasonic"],
  },
  hotspot: {
    title: "Unit Trap Warning!",
    type: "trap",
    importantNote: "Always convert kHz to Hz before calculating! Example: 2 kHz = 2000 Hz."
  },
  quizTimer: {
    question: "What is the audible range of frequency for humans?",
    options: ["20 Hz to 20,000 Hz", "2 Hz to 2000 Hz", "200 Hz to 20 kHz", "20 kHz to 200 kHz"],
    answer: "20 Hz to 20,000 Hz",
    countdownSeconds: 1.5
  },
  qualityFlags: { needsHumanReview: false },
});

// M8 — Seismic Waves and Tsunami
const M8: TuitionLessonSeed = physicsSeed({
  missionId: "M8",
  missionTitle: "Seismic Waves and Tsunami",
  goal: "Understand the destructive power of seismic waves and tsunamis.",
  hookLine: "How can a wave under the ground shake an entire city?",
  estimatedMinutes: 10,
  contentType: "concept",
  tags: ["seismic waves", "earthquake", "tsunami"],
  sourceRefs: [SOUND_WAVES_SOURCE],
  sourceStatus: "source_backed",
  canTeach: true,
  pyqEvidenceStatus: "not_curated",
  recall: {
    prompt: "Can waves travelling under the ground cause real harm?",
    expectedPoints: ["Yes, high intensity waves can cause disaster", "Like earthquakes or tsunamis"],
    misconceptionCheck: "Waves are not just sound or light, they can carry massive destructive energy.",
  },
  teach: {
    teacherIntro: "We end the chapter by looking at the most powerful, terrifying, and destructive mechanical waves on Planet Earth.",
    explanationBlocks: [
      {
        heading: "Seismic Waves",
        explanation: "When massive tectonic plates under the ground snap or volcanic explosions happen, they release unimaginable energy. This energy travels through the solid Earth crust as Seismic Waves—what we call an Earthquake.",
        keyTerms: ["seismic waves", "earthquake", "seismology"],
      },
      {
        heading: "Tsunami",
        explanation: "If one of these massive earthquakes happens at the bottom of the ocean, it acts like a giant paddle. It displaces millions of tons of water upward, creating a devastatingly fast ocean wave called a Tsunami.",
        keyTerms: ["tsunami", "ocean waves", "displacement of water"],
      },
    ],
    analogy: "A tsunami is NOT just a tall wave on the surface. It is the entire depth of the ocean—from the sea floor to the surface—being violently shoved forward by the earthquake.",
    malayalamSupport: "ഭൂകമ്പം ഉണ്ടാകുമ്പോൾ ഉണ്ടാകുന്ന തരംഗങ്ങളാണ് seismic waves. സമുദ്രത്തിനടിയിൽ ഭൂകമ്പം ഉണ്ടാകുമ്പോഴാണ് സുനാമി ഉണ്ടാകുന്നത്.",
    manglishSupport: "Earthquake kaaranam undaakunna waves aanu seismic waves. Ocean bottom-il earthquake undaakumpol Tsunami varum.",
  },
  visualBoard: {
    boardTitle: "Destructive Waves",
    frames: [
      {
        id: "m8-f1",
        title: "Seismic Waves & Tsunami",
        teacherAction: "The intensity of an earthquake is measured by the Richter scale.",
        boardText: ["Seismic waves = Earthquake waves", "Measured on Richter scale", "Tsunami = Gigantic ocean waves due to underwater earthquake"],
        studentFocus: "Earthquakes at ocean bottom trigger tsunamis.",
      },
    ],
  },
  docDoeTrick: {
    title: "Seismo = Earth",
    trick: "Seismic relates to the Earth's crust vibrating.",
    whyItWorks: "Helps connect seismology directly to earthquakes.",
  },
  keyNotes: [
    "Seismic waves are caused by earthquakes or massive explosions in the Earth's crust.",
    "Intensity of earthquakes is determined by the Richter scale.",
    "Tsunami is a series of gigantic ocean waves triggered by underwater earthquakes.",
  ],
  formulas: [],
  examAnswers: [
    {
      marks: 1,
      question: "Which scale is used to determine the intensity of earthquakes?",
      answerPoints: ["Richter scale"],
      keywords: ["Richter"],
      commonMistakes: ["Writing seismograph (which is the instrument, not the scale)"],
      boardStyleRewrite: "The intensity of earthquakes is determined by the Richter scale.",
    },
  ],
  yourTurn: {
    prompt: "What causes a tsunami? (1 mark)",
    expectedAnswerPoints: ["Earthquakes at the bottom of oceans", "Displacement of large volumes of water"],
    hint: "Think about what happens under the ocean.",
  },
  correctionRubric: {
    maxMarks: 1,
    scoringPoints: [
      { point: "Mentions underwater earthquakes", marks: 1, requiredKeywords: ["earthquake", "ocean", "bottom"] },
    ],
    commonMissingParts: ["Not specifying it happens underwater"],
    feedbackTemplate: "Correct. {covered}.",
  },
  quiz: [
    {
      id: "m8-q1",
      type: "mcq",
      question: "The study of seismic waves is called:",
      options: ["Astrology", "Seismology", "Cosmology", "Oceanography"],
      answer: "Seismology",
      explanation: "Seismology is the study of earthquakes and seismic waves.",
      difficulty: "easy",
      tags: ["seismic"],
    },
  ],
  recap: {
    summary: ["Seismic waves = earthquake waves", "Tsunami = gigantic ocean waves from underwater earthquakes"],
    mustRemember: ["Richter scale measures earthquake intensity."],
  },
  revisionSave: {
    flashcards: [
      { front: "What is a tsunami?", back: "Gigantic ocean waves caused by underwater earthquakes." },
    ],
    revisionNotes: ["Richter scale = intensity of earthquakes"],
    weakAreaTags: ["seismic"],
  },
  qualityFlags: { needsHumanReview: false },
});

// M9 — full-chapter revision and final assessment. Each quiz item points back
// to the mission it actually assesses, so one wrong answer repairs that exact
// concept instead of creating a vague chapter-level weakness.
const M9: TuitionLessonSeed = physicsSeed({
  missionId: "M9",
  missionTitle: "Sound Waves Chapter Test & Revision",
  goal: "Revise the full chapter, complete a concept-linked final test, and turn every mistake into the next revision task.",
  hookLine: "Can you connect every Sound Waves idea without opening the textbook?",
  estimatedMinutes: 40,
  contentType: "revision",
  tags: ["chapter test", "revision", "oscillation", "resonance", "wave speed", "echo", "audibility", "seismic waves"],
  sourceRefs: [SOUND_WAVES_SOURCE],
  sourceStatus: "source_backed",
  canTeach: true,
  pyqEvidenceStatus: "not_curated",
  recall: {
    prompt: "From memory, write the wave equation and name two chapter ideas that do not use it.",
    expectedPoints: ["v = fλ", "Examples include resonance, echo, audibility, seismic waves or tsunami"],
    misconceptionCheck: "The chapter is more than one formula: the test also checks definitions, applications and common traps.",
  },
  teach: {
    teacherIntro: "This is your chapter finish line. First rebuild the full map; then every test answer updates the exact concept it checks.",
    explanationBlocks: [
      {
        heading: "Motion and vibration",
        explanation: "Oscillation gives amplitude, period and frequency. Natural frequency and forced vibration explain resonance.",
        keyTerms: ["oscillation", "period", "frequency", "resonance"],
      },
      {
        heading: "Wave motion and calculations",
        explanation: "Mechanical waves transfer energy without carrying particles forward. For calculations use v = fλ and SI units.",
        keyTerms: ["energy transfer", "longitudinal", "transverse", "v = fλ"],
      },
      {
        heading: "Reflection, hearing and destructive waves",
        explanation: "Reflection explains echo and reverberation. Hearing has limits, ultrasonic sound has applications, and seismic waves can produce tsunamis.",
        keyTerms: ["echo", "reverberation", "20 Hz to 20 kHz", "ultrasonic", "seismic"],
      },
    ],
    analogy: "Treat the chapter like one route map: vibration starts the journey, waves carry energy, formulas measure them, and applications show what they do.",
    malayalamSupport: "അധ്യായ മാപ്പ്: ദോലനം → തരംഗചലനം → v = fλ → പ്രതിധ്വനി → ശ്രവണപരിധി → ഭൂകമ്പ തരംഗങ്ങൾ. ഓരോ തെറ്റും അതത് ആശയത്തിന്റെ റിവിഷൻ ടാസ്ക് ആവും.",
    manglishSupport: "Full map: oscillation → wave motion → v = fλ → echo → hearing range → seismic waves. Oro mistake-um exact revision task aavum.",
  },
  visualBoard: {
    boardTitle: "Sound Waves — one-board chapter map",
    frames: [
      {
        id: "m9-f1",
        title: "The complete chapter path",
        teacherAction: "Connect oscillation to wave applications, with v = fλ and the echo relation in the centre.",
        boardText: [
          "Oscillation → natural frequency → resonance",
          "Wave motion → longitudinal/transverse → v = fλ",
          "Reflection → echo | Hearing → infra/ultra | Earth → seismic/tsunami",
        ],
        studentFocus: "Definition, formula, condition and application must stay connected.",
      },
    ],
  },
  docDoeTrick: {
    title: "D-F-C-A check",
    trick: "For every answer check Definition, Formula, Condition and Application.",
    whyItWorks: "It catches the most common chapter-test omissions before you submit.",
  },
  keyNotes: [
    "Frequency f = 1/T and wave speed v = fλ; use seconds, hertz and metres.",
    "A mechanical wave transfers energy, not matter; particles vibrate parallel or perpendicular to wave travel.",
    "Resonance occurs when forcing frequency matches natural frequency and amplitude becomes maximum.",
    "For an echo, sound travels to the reflector and back, so distance to the reflector is vt/2.",
    "Human audible range is about 20 Hz to 20 kHz; ultrasonic sound is above 20 kHz.",
    "An underwater earthquake can displace a large volume of water and produce a tsunami.",
  ],
  formulas: [
    {
      formula: "f = 1 / T",
      meaning: "Frequency is the reciprocal of time period.",
      symbols: [
        { symbol: "f", meaning: "frequency", unit: "Hz" },
        { symbol: "T", meaning: "time period", unit: "s" },
      ],
      commonUseCase: "Converting between time period and frequency.",
    },
    {
      formula: "v = fλ",
      meaning: "Wave speed equals frequency multiplied by wavelength.",
      symbols: [
        { symbol: "v", meaning: "wave speed", unit: "m/s" },
        { symbol: "f", meaning: "frequency", unit: "Hz" },
        { symbol: "λ", meaning: "wavelength", unit: "m" },
      ],
      commonUseCase: "Finding wave speed, frequency or wavelength.",
    },
    {
      formula: "d = vt / 2",
      meaning: "Echo distance is half the total distance travelled by sound.",
      symbols: [
        { symbol: "d", meaning: "distance to reflector", unit: "m" },
        { symbol: "v", meaning: "speed of sound", unit: "m/s" },
        { symbol: "t", meaning: "echo time", unit: "s" },
      ],
      commonUseCase: "Finding reflector distance from echo time.",
    },
  ],
  examAnswers: [
    {
      marks: 4,
      question: "Write the key relations and conditions you would revise before a Sound Waves chapter test.",
      answerPoints: [
        "f = 1/T and v = fλ with SI units",
        "Resonance needs forcing frequency equal to natural frequency",
        "Echo distance uses d = vt/2 because sound travels to the reflector and back",
        "Human audible range is 20 Hz to 20 kHz",
      ],
      keywords: ["f = 1/T", "v = fλ", "natural frequency", "vt/2", "20 Hz", "20 kHz"],
      commonMistakes: ["Forgetting the factor 2 in echo distance", "Using centimetres without converting to metres", "Swapping infrasonic and ultrasonic ranges"],
      boardStyleRewrite: "Use f = 1/T and v = fλ in SI units. Resonance occurs at matching frequencies. Echo distance is vt/2. Humans hear about 20 Hz to 20 kHz.",
    },
  ],
  yourTurn: {
    prompt: "Build a four-line last-minute card using one definition, one formula, one condition and one application.",
    expectedAnswerPoints: ["A correct wave definition", "v = fλ or f = 1/T", "A resonance or echo condition", "An ultrasonic or seismic application"],
    hint: "Use the D-F-C-A check shown above.",
  },
  correctionRubric: {
    maxMarks: 4,
    scoringPoints: [
      { point: "Correct definition", marks: 1, requiredKeywords: ["wave", "energy"] },
      { point: "Correct formula", marks: 1, requiredKeywords: ["v", "f", "λ"] },
      { point: "Correct condition", marks: 1, requiredKeywords: ["frequency", "echo"] },
      { point: "Correct application", marks: 1, requiredKeywords: ["ultrasonic", "tsunami"] },
    ],
    commonMissingParts: ["A formula with units", "A clear condition", "A real application"],
    feedbackTemplate: "Your revision card covers {covered}. Add {missing} before the test.",
  },
  quiz: [
    {
      id: "m9-q1", type: "numerical",
      question: "An oscillator makes 5 oscillations each second. What is its time period?",
      answer: "0.2 s", explanation: "T = 1/f = 1/5 = 0.2 s.", difficulty: "medium", tags: ["period", "frequency"],
      conceptMissionId: "M1", conceptLabel: "Oscillation, Amplitude, Period and Frequency",
    },
    {
      id: "m9-q2", type: "short", question: "State the condition for resonance.",
      answer: "Resonance occurs when the forcing frequency equals the natural frequency.",
      explanation: "Matching frequencies produce maximum-amplitude vibration.", difficulty: "medium", tags: ["resonance"],
      conceptMissionId: "M2", conceptLabel: "Natural Frequency, Forced Vibration & Resonance",
    },
    {
      id: "m9-q3", type: "mcq", question: "In a longitudinal wave, particles vibrate",
      options: ["parallel to wave travel", "perpendicular to wave travel", "only upward", "with the wave from source to receiver"],
      answer: "parallel to wave travel", explanation: "Particles vibrate parallel to the direction of wave travel.",
      difficulty: "easy", tags: ["longitudinal wave"], conceptMissionId: "M3", conceptLabel: "Wave Motion & Types of Waves",
    },
    {
      id: "m9-q4", type: "numerical", question: "Sound travels at 340 m/s with frequency 400 Hz. Find its wavelength.",
      answer: "0.85 m", explanation: "λ = v/f = 340/400 = 0.85 m.", difficulty: "exam", tags: ["v = fλ", "wavelength"],
      conceptMissionId: "M4", conceptLabel: "Frequency, Wavelength and Wave Speed (v = fλ)",
    },
    {
      id: "m9-q5", type: "numerical", question: "A wave has frequency 500 Hz and wavelength 0.68 m. Find its speed.",
      answer: "340 m/s", explanation: "v = fλ = 500 × 0.68 = 340 m/s.", difficulty: "exam", tags: ["numerical", "wave speed"],
      conceptMissionId: "M5", conceptLabel: "Numericals using v = fλ",
    },
    {
      id: "m9-q6", type: "numerical", question: "An echo returns after 0.1 s. At 340 m/s, how far away is the reflector?",
      answer: "17 m", explanation: "d = vt/2 = 340 × 0.1 / 2 = 17 m.", difficulty: "exam", tags: ["echo", "reflection"],
      conceptMissionId: "M6", conceptLabel: "Reflection, Echo & Reverberation",
    },
    {
      id: "m9-q7", type: "mcq", question: "Which frequency is ultrasonic for humans?",
      options: ["10 Hz", "200 Hz", "2 kHz", "25 kHz"], answer: "25 kHz",
      explanation: "Ultrasonic sound is above about 20 kHz.", difficulty: "easy", tags: ["ultrasonic", "audibility"],
      conceptMissionId: "M7", conceptLabel: "Limits of Audibility & Ultrasonic Uses",
    },
    {
      id: "m9-q8", type: "short", question: "How can an underwater earthquake produce a tsunami?",
      answer: "It displaces a large volume of ocean water and generates gigantic waves.",
      explanation: "Sea-floor movement displaces the water column and starts tsunami waves.", difficulty: "medium", tags: ["tsunami", "seismic waves"],
      conceptMissionId: "M8", conceptLabel: "Seismic Waves and Tsunami",
    },
  ],
  recap: {
    summary: [
      "The full chapter map is connected from oscillation to seismic waves.",
      "Every final-test answer updates its exact concept; only mistakes become revision work.",
      "The saved result now decides the next lesson and spaced-revision task.",
    ],
    mustRemember: ["D-F-C-A; use v = fλ in SI units and vt/2 for echo distance"],
  },
  revisionSave: {
    flashcards: [
      { front: "Wave speed relation?", back: "v = fλ." },
      { front: "Resonance condition?", back: "Forcing frequency equals natural frequency." },
      { front: "Echo distance relation?", back: "d = vt/2." },
      { front: "Human audible range?", back: "About 20 Hz to 20 kHz." },
    ],
    revisionNotes: ["D-F-C-A, formula units and the echo factor 2"],
    weakAreaTags: ["chapter test corrections", "formula units", "exam conditions"],
  },
  qualityFlags: { needsHumanReview: false },
});

const SOUND_WAVES_SEEDS: TuitionLessonSeed[] = [M1, M2, M3, M4, M5, M6, M7, M8, M9];

const ALL_PHYSICS_SEEDS: TuitionLessonSeed[] = [
  ...SOUND_WAVES_SEEDS,
  ...LENSES_SEEDS,
  ...COLOURS_VISION_SEEDS,
  ...ELECTRIC_ENERGY_SEEDS,
  ...ELECTROMAGNETIC_INDUCTION_SEEDS,
  ...MECHANICAL_ADVANTAGE_SEEDS,
  ...MAGNETIC_EFFECT_SEEDS,
  ...CHEMISTRY_NOMENCLATURE_SEEDS,
  ...CHEMISTRY_P1_C1_SEEDS,
  ...BIOLOGY_P1_C1_SEEDS,
  ...BIOLOGY_P1_C2_SEEDS,
  ...BIOLOGY_P1_C3_SEEDS,
  ...BIOLOGY_P1_C4_SEEDS,
  ...BIOLOGY_P1_C5_SEEDS,
  ...BIOLOGY_P1_C6_SEEDS,
];

const SEED_INDEX = new Map<string, TuitionLessonSeed>(
  ALL_PHYSICS_SEEDS.map((seed) => [`${seed.chapterId}|${seed.missionId}`, seed]),
);

/** All curated lesson seeds. */
export function getAllLessonSeeds(): TuitionLessonSeed[] {
  return [...ALL_PHYSICS_SEEDS];
}

export function getSoundWavesSeeds(): TuitionLessonSeed[] {
  return [...SOUND_WAVES_SEEDS];
}

export function getLensesSeeds(): TuitionLessonSeed[] {
  return [...LENSES_SEEDS];
}

export function getColoursVisionSeeds(): TuitionLessonSeed[] {
  return [...COLOURS_VISION_SEEDS];
}

export function getElectricEnergySeeds(): TuitionLessonSeed[] {
  return [...ELECTRIC_ENERGY_SEEDS];
}

export function getElectromagneticInductionSeeds(): TuitionLessonSeed[] {
  return [...ELECTROMAGNETIC_INDUCTION_SEEDS];
}

export function getMechanicalAdvantageSeeds(): TuitionLessonSeed[] {
  return [...MECHANICAL_ADVANTAGE_SEEDS];
}

export function getMagneticEffectSeeds(): TuitionLessonSeed[] {
  return [...MAGNETIC_EFFECT_SEEDS];
}

/** Lookup a lesson seed by chapter + mission. Returns null when not curated. */
export function getPhysicsLessonSeed(
  chapterId: string | null | undefined,
  missionId: string | null | undefined,
): TuitionLessonSeed | null {
  if (!chapterId || !missionId) return null;
  return SEED_INDEX.get(`${chapterId}|${missionId}`) ?? null;
}

export function hasPhysicsLessonSeed(chapterId: string | null | undefined, missionId: string | null | undefined): boolean {
  return getPhysicsLessonSeed(chapterId, missionId) !== null;
}

export type PhysicsSeedCatalogMission = {
  mission_id: string;
  mission_title: string;
  contentType: LessonSeedContentType;
  canTeach: boolean;
  tags: string[];
};

/**
 * Catalog missions (selectable units) defined by the seeds for a chapter.
 * PYQ-placeholder content is excluded so it is never picked as a daily class.
 */
export function getPhysicsSeedCatalogMissions(chapterId: string): PhysicsSeedCatalogMission[] {
  return ALL_PHYSICS_SEEDS.filter((seed) => seed.chapterId === chapterId && seed.contentType !== "pyq_placeholder").map(
    (seed) => ({
      mission_id: seed.missionId,
      mission_title: seed.missionTitle,
      contentType: seed.contentType,
      canTeach: seed.canTeach,
      tags: seed.tags,
    }),
  );
}

/** Chapter ids that have at least one curated, teachable seed. */
export function chaptersWithPhysicsSeeds(): string[] {
  return Array.from(new Set(ALL_PHYSICS_SEEDS.filter((seed) => seed.canTeach).map((seed) => seed.chapterId)));
}

export type CuratedChapter = {
  chapterId: string;
  subject: TuitionLessonSeed["subject"];
  chapterTitle: string;
  /** Teachable (non-PYQ) missions available in this chapter. */
  missionCount: number;
};

/**
 * Every chapter with at least one teachable seed, in authored order. This is
 * the registry the daily-tuition picker walks so a student's real subject and
 * progress choose today's chapter — instead of one hardcoded chapter. Physics,
 * Chemistry and Biology all live in one seed index, so all are returned here.
 */
export function getCuratedChapters(): CuratedChapter[] {
  const order: string[] = [];
  const byId = new Map<string, CuratedChapter>();
  for (const seed of ALL_PHYSICS_SEEDS) {
    if (!seed.canTeach || seed.contentType === "pyq_placeholder") continue;
    const existing = byId.get(seed.chapterId);
    if (existing) {
      existing.missionCount += 1;
    } else {
      order.push(seed.chapterId);
      byId.set(seed.chapterId, {
        chapterId: seed.chapterId,
        subject: seed.subject,
        chapterTitle: seed.chapterTitle,
        missionCount: 1,
      });
    }
  }
  return order.map((id) => byId.get(id) as CuratedChapter);
}

export const NOT_CURATED_MESSAGE =
  "This lesson is source-backed but its guided content is not curated yet for this mission.";