import React, { useRef, useState, useEffect } from "react"; import { ArrowDown, Check, BookOpen, AlertTriangle, Zap } from "lucide-react"; import { PracticeFromDataset } from "../../../components/lessons/LessonShell"; import { BOUNDARIES_EASY, BOUNDARIES_MEDIUM, } from "../../../data/rw/boundaries"; import ClauseBreakdownWidget, { type ClauseExample, } from "../../../components/lessons/ClauseBreakdownWidget"; import DecisionTreeWidget, { type TreeScenario, type TreeNode, } from "../../../components/lessons/DecisionTreeWidget"; interface LessonProps { onFinish?: () => void; } // ── Clause Breakdown data ────────────────────────────────────────────────── const CLAUSE_EXAMPLES: ClauseExample[] = [ { title: "Em Dash — Nonessential Phrase", segments: [ { text: "The results", type: "subject", label: "Subject" }, { text: " —", type: "punct" }, { text: " gathered over three years", type: "modifier", label: "Nonessential Info (must be paired)", }, { text: " —", type: "punct" }, { text: " confirmed the hypothesis", type: "verb", label: "Predicate" }, { text: ".", type: "punct" }, ], }, { title: "Possession: team's", segments: [ { text: "The", type: "ic", label: "" }, { text: " team's", type: "subject", label: "Add 's for possession" }, { text: " report", type: "ic", label: "" }, { text: " was submitted on time", type: "verb", label: "Predicate" }, { text: ".", type: "punct" }, ], }, { title: "Contraction: they're / it's", segments: [ { text: "They're", type: "conjunction", label: "Contraction: they + are", }, { text: " reviewing", type: "verb", label: "" }, { text: " the data", type: "ic", label: "" }, { text: " because", type: "dc", label: "" }, { text: " it's", type: "conjunction", label: "Contraction: it + is" }, { text: " inconclusive", type: "ic", label: "" }, { text: ".", type: "punct" }, ], }, ]; // ── Decision Tree data ───────────────────────────────────────────────────── const DASH_SUBTREE: TreeNode = { id: "dash", question: "Is there already an em dash somewhere else in the sentence?", hint: "Em dashes must come in PAIRS when setting off a nonessential phrase in the middle of a sentence.", yesLabel: "Yes — there's a dash elsewhere in the sentence", noLabel: "No — this is the only dash", yes: { id: "dash-pair", result: "✓ Match the punctuation. If an em dash opens a nonessential phrase, another em dash must close it.", resultType: "correct", ruleRef: "[IC] — [nonessential phrase] — [rest of IC]", }, no: { id: "dash-single", question: "Is the dash at the END of the sentence introducing an explanation or list?", yesLabel: "Yes — introducing what follows", noLabel: "No — it's in the middle of a sentence", yes: { id: "dash-end", result: "✓ A single em dash at the end correctly introduces an explanation, list, or dramatic pause.", resultType: "correct", ruleRef: "[Complete sentence] — [explanation or list]", }, no: { id: "dash-mid", result: "⚠ A single em dash in the middle of a sentence is incorrect — it must be paired with another em dash, or converted to commas.", resultType: "warning", ruleRef: "Fix: use matching dashes or commas", }, }, }; const APOSTROPHE_SUBTREE: TreeNode = { id: "apostrophe", question: "Can you substitute 'it is' or 'they are' in place of the word?", hint: "Try substituting: 'its / it is' — if 'it is' fits, use 'it\u2019s'. If not, use 'its' (possessive).", yesLabel: "Yes — contraction fits (it is / they are)", noLabel: "No — it's showing ownership", yes: { id: "contraction", result: "✓ Use the contraction form: it's (it is), they're (they are), who's (who is).", resultType: "correct", ruleRef: "Contraction: it's = it + is | they're = they + are", }, no: { id: "possession", question: "Does the noun END in -s already (plural)?", yesLabel: "Yes — plural noun ending in -s", noLabel: "No — singular noun", yes: { id: "plural-poss", result: "✓ Add only an apostrophe after the -s: students' (not students's).", resultType: "correct", ruleRef: "Plural possession: [noun]s' [thing]", }, no: { id: "singular-poss", result: "✓ Add 's to the singular noun: scientist's, team's.", resultType: "correct", ruleRef: "Singular possession: [noun]'s [thing]", }, }, }; const DASH_APOSTROPHE_TREE: TreeNode = { id: "root", question: "Is this an apostrophe or dash/punctuation question?", yesLabel: "Apostrophe (') question", noLabel: "Em dash (—) or other punctuation", yes: APOSTROPHE_SUBTREE, no: DASH_SUBTREE, }; const TREE_SCENARIOS: TreeScenario[] = [ { label: "Sentence 1", sentence: "The researchers findings, which had been collected over a decade, were finally published.", tree: DASH_APOSTROPHE_TREE, }, { label: "Sentence 2", sentence: "Each student submitted there essay before the deadline.", tree: DASH_APOSTROPHE_TREE, }, { label: "Sentence 3", sentence: "The committee — composed of three senior researchers agreed to delay the vote.", tree: DASH_APOSTROPHE_TREE, }, ]; // ── Lesson component ─────────────────────────────────────────────────────── const EBRWDashesApostrophesLesson: React.FC = ({ onFinish }) => { const [activeSection, setActiveSection] = useState(0); const sectionsRef = useRef<(HTMLElement | null)[]>([]); useEffect(() => { const observers: IntersectionObserver[] = []; sectionsRef.current.forEach((el, idx) => { if (!el) return; const obs = new IntersectionObserver( ([entry]) => { if (entry.isIntersecting) setActiveSection(idx); }, { threshold: 0.3 }, ); obs.observe(el); observers.push(obs); }); return () => observers.forEach((o) => o.disconnect()); }, []); const scrollToSection = (index: number) => { setActiveSection(index); sectionsRef.current[index]?.scrollIntoView({ behavior: "smooth" }); }; const SectionMarker = ({ index, title, icon: Icon, }: { index: number; title: string; icon: React.ElementType; }) => { const isActive = activeSection === index; const isPast = activeSection > index; return ( ); }; return (
{/* Section 0 — Concept + Clause Breakdown */}
{ sectionsRef.current[0] = el; }} className="min-h-screen flex flex-col justify-center mb-24 pt-20 lg:pt-0" >
Standard English Conventions

Dashes, Apostrophes & More

See how punctuation structures meaning — then master every SAT trap.

{/* Rule summary grid */}
{[ { num: 1, rule: "Em Dash Pairs", desc: "Use two em dashes to set off nonessential info in the middle of a sentence — one to open, one to close.", }, { num: 2, rule: "Apostrophe: Possession", desc: "Add 's to singular nouns; add ' only to plurals ending in -s (students').", }, { num: 3, rule: "It's vs. Its", desc: "it's = it is (contraction). its = possessive. Test by substituting 'it is.'", }, { num: 4, rule: "Confused Words", desc: "their (possessive), there (place), they're (contraction). who's (who is), whose (possessive).", }, ].map((r) => (
{r.num} {r.rule}

{r.desc}

))}
{/* Common Traps */}
{[ { label: "Its vs. It's", desc: "'its' is possessive (like 'his/her'). 'it's' = it is. Test: substitute 'it is' — if it works, use it's.", }, { label: "Unpaired Em Dash", desc: "Em dashes around a nonessential phrase MUST be paired. One dash in the middle of a sentence is always wrong.", }, { label: "Their / There / They're", desc: "'their' = possessive, 'there' = place or existence, 'they're' = they are. The SAT uses all three as traps.", }, ].map((t) => (

{t.label}

{t.desc}

))}
{/* Clause Breakdown */}

Sentence Anatomy

Hover over any colored span to see its label. Use the tabs to switch between examples.

Golden Rule

On the SAT, every apostrophe is either a contraction or possession — never both. Test contractions by substitution. Test possessives by checking what owns what.

{/* Section 1 — Decision Tree */}
{ sectionsRef.current[1] = el; }} className="min-h-screen flex flex-col justify-center mb-24" >

Decision Tree Lab

Work through the grammar logic one question at a time. Click your answer at each step.

{/* Trap callouts */}
{[ { label: "Mismatched Dash & Comma", desc: "Opening with a dash and closing with a comma (or vice versa) is always wrong. Em dashes must pair with em dashes.", }, { label: "it's / its Confusion", desc: "Test: can you replace it with 'it is'? If yes → it's. If no → its. This is the #1 apostrophe trap on the SAT.", }, { label: "Confused Homophones", desc: "their/there/they're and whose/who's are the most common wrong-word traps. Always ask: possession, place, or contraction?", }, ].map((t) => (

{t.label}

{t.desc}

))}
{/* Section 2 — Quiz */}
{ sectionsRef.current[2] = el; }} className="min-h-screen flex flex-col justify-center mb-24" >

Practice Questions

{BOUNDARIES_EASY.slice(4, 6).map((q) => ( ))} {BOUNDARIES_MEDIUM.slice(2, 3).map((q) => ( ))}
); }; export default EBRWDashesApostrophesLesson;