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