Forgot to add a key in Level

This commit is contained in:
Carlos Mesquita
2024-08-19 23:46:51 +01:00
parent abddead402
commit 3299acee36

View File

@@ -16,6 +16,7 @@ import clsx from "clsx";
import { Dispatch, Fragment, SetStateAction, use, useEffect, useMemo, useRef, useState } from "react";
import { BsChevronDown, BsChevronUp } from "react-icons/bs";
import { toast } from "react-toastify";
import { v4 } from "uuid";
interface Props {
exam: LevelExam;
@@ -142,7 +143,7 @@ function TextComponent({
<div className="flex mt-2">
<div ref={textRef} className="h-fit ml-2 flex flex-col gap-4">
{part.context!.split('\n\n').map((line, index) => {
return <p><span className="mr-6">{index + 1}</span>{line}</p>
return <p key={`line-${index}`}><span className="mr-6">{index + 1}</span>{line}</p>
})}
</div>
</div>
@@ -390,10 +391,7 @@ export default function Level({ exam, showSolutions = false, onFinish, editing =
exercisesDone +
(exerciseIndex === -1 ? 0 : exerciseIndex + 1) +
storeQuestionIndex +
multipleChoicesDone.reduce((acc, curr) => {
console.log(curr.amount);
return acc + curr.amount
}, 0)
multipleChoicesDone.reduce((acc, curr) => { return acc + curr.amount}, 0)
);
};