Skip to content

Commit e5373c3

Browse files
author
bhunt
committed
Fix lesson practice types to match available database problem types
- Changed decimal-to-binary, binary-to-decimal, logic-gates, truth-tables, and practical-circuits to valid types - Mapped lessons to: binary-multiplication, bitwise-operations - Fixes 400 errors when clicking 'Test Your Knowledge' in lessons
1 parent c922938 commit e5373c3

1 file changed

Lines changed: 13 additions & 14 deletions

File tree

binary-math-web/src/routes/lessons.tsx

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ In computing, binary is fundamental because computers use electrical signals tha
9595
= 5`,
9696
},
9797
],
98-
practiceType: 'decimal-to-binary',
98+
practiceType: 'binary-multiplication',
9999
},
100100
{
101101
id: 'place-values',
@@ -135,7 +135,7 @@ Example: 1011₂ = (1×8) + (0×4) + (1×2) + (1×1) = 8 + 2 + 1 = 11₁₀`,
135135
• 11010₂ = 26₁₀ (16 + 8 + 2)`,
136136
},
137137
],
138-
practiceType: 'binary-to-decimal',
138+
practiceType: 'binary-multiplication',
139139
},
140140
{
141141
id: 'conversion',
@@ -178,7 +178,7 @@ Example: Convert 25 to binary
178178
Result: 11001₂`,
179179
},
180180
],
181-
practiceType: 'decimal-to-binary',
181+
practiceType: 'binary-multiplication',
182182
},
183183
],
184184
},
@@ -219,7 +219,7 @@ Expression: Output = A AND B`,
219219
• Digital calculators and processors`,
220220
},
221221
],
222-
practiceType: 'logic-gates',
222+
practiceType: 'bitwise-operations',
223223
},
224224
{
225225
id: 'or-gate',
@@ -251,7 +251,7 @@ Expression: Output = A OR B`,
251251
• Priority encoders`,
252252
},
253253
],
254-
practiceType: 'logic-gates',
254+
practiceType: 'bitwise-operations',
255255
},
256256
{
257257
id: 'not-gate',
@@ -281,7 +281,7 @@ Expression: Output = NOT A`,
281281
• Binary arithmetic circuits`,
282282
},
283283
],
284-
practiceType: 'logic-gates',
284+
practiceType: 'bitwise-operations',
285285
},
286286
{
287287
id: 'xor-gate',
@@ -314,7 +314,7 @@ XOR is called "exclusive" because it excludes the case where both inputs are 1 (
314314
• Comparator circuits`,
315315
},
316316
],
317-
practiceType: 'logic-gates',
317+
practiceType: 'bitwise-operations',
318318
},
319319
{
320320
id: 'nand-nor',
@@ -351,7 +351,7 @@ NOR is also a "universal gate" - any logic circuit can be built using only NOR g
351351
gateType: 'NOR',
352352
},
353353
],
354-
practiceType: 'logic-gates',
354+
practiceType: 'bitwise-operations',
355355
},
356356
],
357357
},
@@ -398,7 +398,7 @@ Truth tables are essential tools for:
398398
• For 3 inputs: 8 rows (000, 001, 010, ..., 111)`,
399399
},
400400
],
401-
practiceType: 'truth-tables',
401+
practiceType: 'bitwise-operations',
402402
},
403403
{
404404
id: 'complex-expressions',
@@ -432,7 +432,7 @@ Example: (A AND B) OR (NOT C)`,
432432
• De Morgan's: NOT (A AND B) = (NOT A) OR (NOT B)`,
433433
},
434434
],
435-
practiceType: 'truth-tables',
435+
practiceType: 'bitwise-operations',
436436
},
437437
],
438438
},
@@ -484,7 +484,7 @@ Both gates receive the same two inputs (A and B). The XOR output is the sum, and
484484
This simple 2-gate circuit is used billions of times in modern processors!`,
485485
},
486486
],
487-
practiceType: 'practical-circuits',
487+
practiceType: 'binary-multiplication',
488488
},
489489
{
490490
id: 'multiplexer',
@@ -520,7 +520,7 @@ Y = (NOT S AND I₀) OR (S AND I₁)
520520
Uses: Data routing, function selection, parallel-to-serial conversion`,
521521
},
522522
],
523-
practiceType: 'practical-circuits',
523+
practiceType: 'binary-multiplication',
524524
},
525525
],
526526
},
@@ -559,8 +559,7 @@ function LessonsPage() {
559559

560560
const getLessonStatus = (lessonId: string): 'completed' | 'current' | 'locked' => {
561561
if (progress.completedLessons.has(lessonId)) return 'completed';
562-
if (lessonId === currentLessonId) return 'current';
563-
return 'locked';
562+
return 'current'; // All lessons are accessible
564563
};
565564

566565
const handleLessonSelect = (moduleId: string, lessonId: string) => {

0 commit comments

Comments
 (0)