import React, { useRef, useState, useEffect } from "react"; import { ArrowDown, Check, BookOpen, AlertTriangle, Zap } from "lucide-react"; import { PracticeFromDataset } from "../../../components/lessons/LessonShell"; import { FORM_STRUCTURE_EASY, FORM_STRUCTURE_MEDIUM, } from "../../../data/rw/form-structure-sense"; 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: "Prepositional Phrase Trap", segments: [ { text: "The results", type: "subject", label: "True Subject: 'results' (plural)", }, { text: " of the study", type: "modifier", label: "Prepositional Phrase — ignore for agreement", }, { text: " were", type: "verb", label: "Plural Verb ✓" }, { text: " significant", type: "ic", label: "" }, { text: ".", type: "punct" }, ], }, { title: "Collective Noun — Singular", segments: [ { text: "The committee", type: "subject", label: "Collective Noun — singular", }, { text: " has", type: "verb", label: "Singular Verb ✓" }, { text: " reached", type: "verb", label: "" }, { text: " a decision", type: "ic", label: "" }, { text: ".", type: "punct" }, ], }, { title: "Inverted Sentence", segments: [ { text: "Among the findings", type: "modifier", label: "Introductory Phrase — not the subject", }, { text: " was", type: "verb", label: "Singular Verb — matches 'one key result'", }, { text: " one key result", type: "subject", label: "True Subject: singular", }, { text: ".", type: "punct" }, ], }, ]; // ── Decision Tree data ───────────────────────────────────────────────────── const SUBJECT_VERB_TREE: TreeNode = { id: "root", question: "What is the TRUE grammatical subject of the sentence?", hint: "Strip away all prepositional phrases (of, in, with, by...), relative clauses, and modifiers. What's left is your true subject.", yesLabel: "I found it — it's singular", noLabel: "I found it — it's plural", yes: { id: "singular-subject", question: "Is the subject a collective noun (team, committee, group, class, family) acting as one unit?", yesLabel: "Yes — collective noun", noLabel: "No — regular singular noun", yes: { id: "collective-singular", result: '✓ Use a SINGULAR verb. Collective nouns acting as a single unit take singular verbs: "The committee has decided."', resultType: "correct", ruleRef: "[Collective noun] + singular verb (has, was, decides)", }, no: { id: "regular-singular", question: "Is the subject an indefinite pronoun (everyone, each, either, neither, anyone, someone)?", yesLabel: "Yes — indefinite pronoun", noLabel: "No — regular noun", yes: { id: "indefinite-singular", result: "✓ Use a SINGULAR verb. Most indefinite pronouns (everyone, each, either, neither) are grammatically singular.", resultType: "correct", ruleRef: "Everyone/Each/Either → singular verb", }, no: { id: "regular-noun-singular", result: "✓ Use a SINGULAR verb: is, was, has, does, -s ending verbs.", resultType: "correct", ruleRef: "[Singular noun] + singular verb", }, }, }, no: { id: "plural-subject", question: "Is the subject a compound subject joined by 'and'?", yesLabel: "Yes — X and Y (compound)", noLabel: "No — regular plural", yes: { id: "compound-and", result: '✓ Use a PLURAL verb. "X and Y" joined with "and" is always plural: "The teacher and the student are ready."', resultType: "correct", ruleRef: "[Noun] and [noun] + plural verb", }, no: { id: "regular-plural", question: "Is the subject joined by 'or' or 'nor'?", yesLabel: "Yes — X or/nor Y", noLabel: "No — just a regular plural noun", yes: { id: "or-nor", result: "⚠ 'Or/Nor' rule: the verb agrees with the CLOSER subject. \"Neither the students nor the teacher IS ready\" (IS agrees with 'teacher', the closer one).", resultType: "warning", ruleRef: "Neither A nor [B] + verb matching B (the closer subject)", }, no: { id: "plain-plural", result: "✓ Use a PLURAL verb: are, were, have, do, -s removed.", resultType: "correct", ruleRef: "[Plural noun] + plural verb", }, }, }, }; const TREE_SCENARIOS: TreeScenario[] = [ { label: "Sentence 1", sentence: "The committee of senior researchers have decided to delay the publication.", tree: SUBJECT_VERB_TREE, }, { label: "Sentence 2", sentence: "Neither the students nor the professor were prepared for the final exam.", tree: SUBJECT_VERB_TREE, }, { label: "Sentence 3", sentence: "Among the most important discoveries of the decade was two breakthrough treatments.", tree: SUBJECT_VERB_TREE, }, ]; // ── Lesson component ─────────────────────────────────────────────────────── const EBRWSubjectVerbLesson: 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.ComponentType>; }) => { 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

Subject-Verb Agreement

See how sentences are built — then learn how to match the verb to the true subject.

{/* Rule summary grid */}
{[ { num: 1, rule: "Strip Prep Phrases", desc: 'Ignore "of the X, in the Y" — they hide the true subject. Find the core noun.', }, { num: 2, rule: "Collective Nouns", desc: "team, group, committee, class → singular verb when acting as one unit.", }, { num: 3, rule: "Indefinite Pronouns", desc: "each, every, either, neither, anyone, someone → always singular.", }, { num: 4, rule: "Or / Nor Rule", desc: 'Verb matches the CLOSER subject: "Neither the students nor the teacher IS."', }, ].map((r) => (
{r.num} {r.rule}

{r.desc}

))}
{/* Clause Breakdown */}

Sentence Anatomy

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

Golden Rule

The SAT hides subjects behind prepositional phrases and inverted sentences. Always identify the true subject first — strip modifiers, then match the verb.

{/* 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 agreement logic one question at a time. Click your answer at each step.

{/* Trap callouts */}
{[ { label: "Prepositional Phrase Trap", desc: 'The results of the study [was/were]? Strip "of the study"; true subject is "results" (plural) → "were".', }, { label: "Or/Nor Proximity Rule", desc: '"Neither A nor B" → verb matches B (the noun closer to the verb).', }, { label: "Inverted Sentence", desc: '"There is/are..." and "Among X was/were Y" — find the true subject after the verb.', }, ].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

{FORM_STRUCTURE_EASY.slice(0, 2).map((q) => ( ))} {FORM_STRUCTURE_MEDIUM.slice(0, 1).map((q) => ( ))}
); }; export default EBRWSubjectVerbLesson;