feat: se aplican varios fix a las pruebas

This commit is contained in:
2026-01-22 13:24:48 -03:00
parent 360cf520e8
commit 957539d201
15 changed files with 899 additions and 26 deletions
@@ -301,9 +301,9 @@ export default function LessonPlayerPage({ params }: { params: { id: string, les
return (
<HotspotPlayer
title={block.title}
description={block.content || ""}
imageUrl={block.url || ""}
hotspots={block.metadata?.hotspots || []}
description={block.description || ""}
imageUrl={block.imageUrl || ""}
hotspots={block.hotspots || []}
onComplete={(score) => handleBlockComplete(block.id, score)}
/>
);
@@ -311,7 +311,7 @@ export default function LessonPlayerPage({ params }: { params: { id: string, les
return (
<MemoryPlayer
title={block.title}
pairs={block.metadata?.pairs || []}
pairs={block.pairs || []}
onComplete={(score) => handleBlockComplete(block.id, score)}
/>
);
@@ -3,6 +3,7 @@
import React, { useState, useRef } from "react";
import Image from "next/image";
import { Search, CheckCircle, XCircle, MousePointer2 } from "lucide-react";
import { getImageUrl } from "@/lib/api";
interface Hotspot {
id: string;
@@ -90,7 +91,7 @@ export default function HotspotPlayer({
className="relative aspect-video rounded-3xl overflow-hidden border-4 border-white/10 bg-black cursor-crosshair group select-none shadow-2xl"
>
<Image
src={imageUrl}
src={getImageUrl(imageUrl)}
alt={title}
fill
className="object-cover transition-transform duration-700 group-hover:scale-[1.02]"
@@ -13,7 +13,7 @@ interface MemoryCard {
interface MemoryPlayerProps {
title: string;
pairs: { id: string, content: string }[];
pairs: { left: string, right: string, id?: string }[];
onComplete: (score: number) => void;
}
@@ -30,9 +30,10 @@ export default function MemoryPlayer({
const initializeGame = useCallback(() => {
const gameCards: MemoryCard[] = [];
initialPairs.forEach((pair, idx) => {
// Add two of each
gameCards.push({ id: idx * 2, content: pair.content, pairId: pair.id, isFlipped: false, isMatched: false });
gameCards.push({ id: idx * 2 + 1, content: pair.content, pairId: pair.id, isFlipped: false, isMatched: false });
const pairId = pair.id || idx.toString();
// Add two of each (Left and Right)
gameCards.push({ id: idx * 2, content: pair.left, pairId: pairId, isFlipped: false, isMatched: false });
gameCards.push({ id: idx * 2 + 1, content: pair.right, pairId: pairId, isFlipped: false, isMatched: false });
});
// Shuffle
+9
View File
@@ -74,6 +74,15 @@ export interface Block {
initialCode?: string;
keywords?: string[];
timeLimit?: number;
description?: string;
imageUrl?: string;
hotspots?: {
id: string;
x: number;
y: number;
radius: number;
label: string;
}[];
metadata?: any;
}