import React, { useState, useEffect } from 'react'; import { CheckCircle, XCircle, RefreshCw, ChevronRight, AlertCircle } from 'lucide-react'; const LaborComplicationsTest = () => { const [currentQuestion, setCurrentQuestion] = useState(null); const [selectedAnswer, setSelectedAnswer] = useState(null); const [showFeedback, setShowFeedback] = useState(false); const [score, setScore] = useState({ correct: 0, total: 0 }); const [usedQuestions, setUsedQuestions] = useState([]); const [dragItems, setDragItems] = useState([]); const [droppedItems, setDroppedItems] = useState({}); // Comprehensive question bank covering ALL topics const questionBank = [ // PROM Questions { id: 1, type: 'multiple-choice', topic: 'PROM', question: 'A client at 34 weeks gestation reports a sudden gush of fluid. What is the MOST important initial assessment?', options: [ 'Check for contractions', 'Assess for cervical changes/dilation', 'Monitor fetal movement', 'Take maternal temperature' ], correct: 1, rationale: 'With PROM, the priority is to assess for cervical changes/dilation to determine if labor has begun. PROM does NOT mean labor is imminent, but cervical assessment helps determine the clinical picture.' }, { id: 2, type: 'scenario', topic: 'PROM', question: 'A 28-year-old G1P0 at 35 weeks calls reporting fluid leakage that is yellow and cloudy. She denies contractions but reports mild cramping. What is your priority concern?', options: [ 'Preterm labor', 'Chorioamnionitis', 'Placental abruption', 'Normal discharge' ], correct: 1, rationale: 'Yellow/cloudy discharge is a red flag for infection (chorioamnionitis). This is a serious complication of PROM that requires immediate evaluation and treatment.' }, // Medication Questions { id: 3, type: 'multiple-choice', topic: 'Medications', question: 'Which medication should NEVER be given to send a mother home?', options: [ 'Terbutaline', 'Magnesium sulfate', 'Oxytocin', 'Nifedipine' ], correct: 2, rationale: 'Oxytocin causes strong contractions and should never be given to send a mother home. It is used for labor induction/augmentation in a monitored setting only.' }, { id: 4, type: 'prioritization', topic: 'Medications', question: 'Before administering oxytocin, what assessments must be completed? Arrange in priority order:', items: [ 'Check fetal heart rate', 'Assess contraction pattern', 'Verify IV access', 'Review maternal vital signs' ], correctOrder: [0, 1, 3, 2], rationale: 'Fetal heart rate assessment is the priority before oxytocin administration, followed by contraction pattern to ensure no tachysystole, maternal vitals for baseline, and IV access for medication administration.' }, // Emergency Situations { id: 5, type: 'scenario', topic: 'Shoulder Dystocia', question: 'During delivery, the fetal head delivers but shoulders do not follow. The physician calls out "shoulder dystocia!" What is your FIRST action?', options: [ 'Apply fundal pressure', 'Help client into McRoberts position', 'Apply suprapubic pressure', 'Call for additional help' ], correct: 1, rationale: 'McRoberts position (knees to chest) is the first-line intervention for shoulder dystocia. This widens the pelvic outlet. NEVER apply fundal pressure as it can worsen the impaction.' }, { id: 6, type: 'drag-drop', topic: 'Cord Prolapse', question: 'Arrange the priority actions for cord prolapse in the correct order:', items: [ 'Administer oxygen to mother', 'Elevate fetal head manually', 'Position in Trendelenburg/knee-chest', 'Call for immediate assistance' ], correctOrder: [0, 1, 2, 3], rationale: 'Priority sequence: 1) Oxygen to mother (improves fetal oxygenation), 2) Take pressure off cord by elevating fetal head, 3) Position to reduce cord compression, 4) Call for help while maintaining interventions.' }, // Amniotic Fluid Embolism { id: 7, type: 'critical-thinking', topic: 'Amniotic Fluid Embolism', question: 'A client suddenly becomes dyspneic, cyanotic, and hypotensive after ROM. What is your PRIORITY action?', options: [ 'Check fetal heart rate', 'Begin maternal CPR', 'Position in left lateral', 'Increase IV fluids' ], correct: 1, rationale: 'Amniotic fluid embolism is a medical emergency requiring immediate maternal resuscitation. Remember: if mom dies, baby dies. Maternal stabilization is the absolute priority.' }, // Labor Assessment { id: 8, type: 'multiple-choice', topic: 'CPD', question: 'A client has been pushing for 3 hours with no fetal descent. The baby weighs 4500g. What is the ONLY management option?', options: [ 'Continue pushing with position changes', 'Augment with oxytocin', 'Cesarean section', 'Vacuum-assisted delivery' ], correct: 2, rationale: 'Cephalopelvic disproportion (CPD) occurs when the baby is too large for the pelvis. The ONLY option is cesarean section. Continuing vaginal delivery attempts risks injury to mother and baby.' }, { id: 9, type: 'scenario', topic: 'Tachysystole', question: 'A client on oxytocin has contractions every 90 seconds lasting 80 seconds with late decelerations. What is your FIRST action?', options: [ 'Increase IV fluids', 'Turn off oxytocin', 'Reposition client', 'Administer oxygen' ], correct: 1, rationale: 'Tachysystole (incomplete uterine relaxation) is often caused by oxytocin. The first action is to stop the oxytocin to allow uterine relaxation and improve fetal oxygenation.' }, // Fetal Assessment { id: 10, type: 'multiple-choice', topic: 'Fetal Assessment', question: 'Before performing a fetal fibronectin test, the client must avoid what for 24 hours?', options: [ 'Exercise', 'Eating', 'Vaginal exams/intercourse', 'Lying on back' ], correct: 2, rationale: 'No vaginal exams or intercourse 24 hours before fetal fibronectin test as these can cause false positive results.' }, { id: 11, type: 'critical-thinking', topic: 'Fetal Assessment', question: 'During Leopold maneuvers, you hear the fetal heart rate loudest above the umbilicus. What does this indicate?', options: [ 'Normal vertex presentation', 'Breech presentation', 'Transverse lie', 'Face presentation' ], correct: 1, rationale: 'Heart rate heard above the umbilicus indicates breech presentation, as the heart is higher in the maternal abdomen when the baby is bottom-first.' }, // Phone Triage { id: 12, type: 'scenario', topic: 'Phone Triage', question: 'A term pregnant client calls reporting severe back pain. What is the ONLY appropriate response?', options: [ 'Take acetaminophen and rest', 'Apply heat to the back', 'Come to hospital for evaluation', 'Wait for regular contractions' ], correct: 2, rationale: 'NEVER diagnose over phone or recommend medications. ALWAYS instruct clients to come for evaluation. Back pain in term pregnancy could indicate labor or complications.' }, // Complex Scenarios { id: 13, type: 'bowtie', topic: 'Labor Dystocia', question: 'Complete the cause-and-effect relationship for Labor Dystocia:', causes: ['Small pelvis', 'Large baby', 'Multiple pregnancies', 'Dehydration'], effects: ['Prolonged labor', 'Fetal distress', 'Maternal exhaustion', 'Need for C-section'], rationale: 'Labor dystocia has multiple causes including anatomical (small pelvis, large baby) and physiological factors (multiple pregnancies causing uterine fatigue, dehydration affecting contractions). These lead to various complications requiring intervention.' }, // Additional Emergency Scenarios { id: 14, type: 'prioritization', topic: 'Emergency Response', question: 'A student nurse finds a client with cord prolapse. Arrange actions by priority:', items: [ 'Perform life-saving intervention', 'Check scope of practice', 'Call for help', 'Document the incident' ], correctOrder: [0, 2, 3, 1], rationale: 'Student nurses CAN perform life-saving interventions in emergencies. Act first to save lives, call for help while maintaining intervention, document after, and scope is not a concern in life-threatening situations.' }, // Medication Effects { id: 15, type: 'multiple-choice', topic: 'Medications', question: 'Which side effect is expected with terbutaline administration?', options: [ 'Bradycardia', 'Increased heart rate', 'Respiratory depression', 'Hypotension' ], correct: 1, rationale: 'Terbutaline is a beta-agonist that can increase heart rate as a side effect. Monitor maternal pulse when administering.' }, // Station Assessment { id: 16, type: 'critical-thinking', topic: 'Fetal Assessment', question: 'A fetal station of -3 indicates the presenting part is:', options: [ 'At the pelvic inlet', 'At the ischial spines', 'High above the pelvis', 'Crowning' ], correct: 2, rationale: 'Minus numbers indicate the presenting part is above the ischial spines (0 station). -3 means the baby is high above the pelvis.' }, // Complex Emergency { id: 17, type: 'scenario', topic: 'Multiple Complications', question: 'A diabetic client at 39 weeks has been pushing for 2.5 hours. Baby weighs 4200g. FHR shows variables. What complication should you anticipate MOST?', options: [ 'Cord prolapse', 'Shoulder dystocia', 'Placental abruption', 'Uterine rupture' ], correct: 1, rationale: 'With diabetes, macrosomia (4200g), and prolonged pushing, shoulder dystocia is the most likely complication. Prepare McRoberts position and suprapubic pressure techniques.' }, // Infection Recognition { id: 18, type: 'drag-drop', topic: 'PROM Complications', question: 'Match signs/symptoms with chorioamnionitis diagnosis:', items: [ 'Maternal fever', 'Yellow/cloudy fluid', 'Fetal tachycardia', 'Uterine tenderness' ], correctOrder: [0, 1, 2, 3], rationale: 'All listed items are signs of chorioamnionitis. Recognition of these signs requires immediate intervention with antibiotics and delivery planning.' }, // Position Management { id: 19, type: 'multiple-choice', topic: 'Emergency Positioning', question: 'Which position is NEVER appropriate for shoulder dystocia?', options: [ 'McRoberts position', 'Hands and knees', 'Trendelenburg', 'Lateral position' ], correct: 2, rationale: 'Trendelenburg is used for cord prolapse, NOT shoulder dystocia. McRoberts (knees to chest) is first-line for shoulder dystocia.' }, // Assessment Priorities { id: 20, type: 'bowtie', topic: 'Comprehensive Assessment', question: 'Link magnesium sulfate effects with nursing assessments:', causes: ['Stops contractions', 'CNS depression', 'Smooth muscle relaxation', 'Decreased reflexes'], effects: ['Monitor contraction pattern', 'Check deep tendon reflexes', 'Assess respiratory rate', 'Monitor for toxicity'], rationale: 'Magnesium sulfate has multiple effects requiring specific assessments. Understanding these relationships ensures safe administration and early toxicity recognition.' } ]; // Initialize with random question useEffect(() => { loadNewQuestion(); }, []); const loadNewQuestion = () => { const availableQuestions = questionBank.filter(q => !usedQuestions.includes(q.id)); if (availableQuestions.length === 0) { // Reset if all questions used setUsedQuestions([]); const randomIndex = Math.floor(Math.random() * questionBank.length); setCurrentQuestion(questionBank[randomIndex]); setUsedQuestions([questionBank[randomIndex].id]); } else { const randomIndex = Math.floor(Math.random() * availableQuestions.length); setCurrentQuestion(availableQuestions[randomIndex]); setUsedQuestions([...usedQuestions, availableQuestions[randomIndex].id]); } setSelectedAnswer(null); setShowFeedback(false); setDragItems([]); setDroppedItems({}); }; const handleAnswerSelect = (index) => { if (!showFeedback) { setSelectedAnswer(index); } }; const checkAnswer = () => { setShowFeedback(true); const isCorrect = selectedAnswer === currentQuestion.correct; setScore({ correct: score.correct + (isCorrect ? 1 : 0), total: score.total + 1 }); }; const handleDragStart = (e, item, index) => { e.dataTransfer.setData('text/plain', index); }; const handleDrop = (e, targetIndex) => { e.preventDefault(); const sourceIndex = parseInt(e.dataTransfer.getData('text/plain')); const newDropped = { ...droppedItems }; newDropped[targetIndex] = currentQuestion.items[sourceIndex]; setDroppedItems(newDropped); }; const handleDragOver = (e) => { e.preventDefault(); }; const checkDragDropAnswer = () => { setShowFeedback(true); let correct = true; currentQuestion.correctOrder.forEach((correctIndex, position) => { if (droppedItems[position] !== currentQuestion.items[correctIndex]) { correct = false; } }); setScore({ correct: score.correct + (correct ? 1 : 0), total: score.total + 1 }); }; const renderQuestion = () => { if (!currentQuestion) return null; switch (currentQuestion.type) { case 'multiple-choice': case 'scenario': case 'critical-thinking': return (
{currentQuestion.topic}

{currentQuestion.question}

{currentQuestion.options.map((option, index) => ( ))}
); case 'prioritization': case 'drag-drop': return (
{currentQuestion.topic}

{currentQuestion.question}

Items to arrange:

{currentQuestion.items.map((item, index) => (
handleDragStart(e, item, index)} className="p-3 bg-white border-2 border-gray-200 rounded cursor-move hover:border-blue-400" > {item}
))}

Drop in order:

{currentQuestion.items.map((_, index) => (
handleDrop(e, index)} onDragOver={handleDragOver} className={`p-3 border-2 border-dashed rounded min-h-[50px] ${ droppedItems[index] ? 'border-blue-500 bg-blue-50' : 'border-gray-300' }`} > {droppedItems[index] || `Position ${index + 1}`}
))}
); case 'bowtie': return (
{currentQuestion.topic}

{currentQuestion.question}

Causes:

{currentQuestion.causes.map((cause, index) => (
{cause}
))}

Effects:

{currentQuestion.effects.map((effect, index) => (
{effect}
))}
); default: return null; } }; return (

Labor Complications Testing Environment

Score: {score.correct}/{score.total}
Question Type: {currentQuestion?.type.replace('-', ' ')}

{usedQuestions.length} of {questionBank.length} questions completed

{renderQuestion()} {!showFeedback && currentQuestion && (currentQuestion.type === 'multiple-choice' || currentQuestion.type === 'scenario' || currentQuestion.type === 'critical-thinking') && ( )} {!showFeedback && currentQuestion && (currentQuestion.type === 'prioritization' || currentQuestion.type === 'drag-drop') && ( )} {!showFeedback && currentQuestion && currentQuestion.type === 'bowtie' && ( )} {showFeedback && currentQuestion && (

Rationale:

{currentQuestion.rationale}

)}

Study Tips:

  • • Remember: Maternal stability = Fetal stability
  • • Never delay life-saving interventions due to scope concerns
  • • Position changes are often first-line interventions
  • • When in doubt with phone triage, bring the client in
  • • Stop oxytocin when complications arise
); }; export default LaborComplicationsTest;