2022-05-18 10:15:54 +02:00
|
|
|
import { useEffect, useState } from "react";
|
2022-06-24 13:42:16 +02:00
|
|
|
import InputExo from "./InputExo.jsx";
|
2022-05-18 10:15:54 +02:00
|
|
|
|
|
|
|
export default function ParcoursExo({ calcul, inputs, idExo, idCalcul, isCorr }) {
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
{calcul
|
|
|
|
.replace("[", " [")
|
|
|
|
.replace("]", "]")
|
|
|
|
.split(" ")
|
|
|
|
.map((c) => {
|
|
|
|
if (c.startsWith("[") && c.endsWith("]")) {
|
|
|
|
var idInput = parseInt(c.replace("[", "").replace("]", ""));
|
|
|
|
return (
|
2022-06-24 13:42:16 +02:00
|
|
|
<InputExo
|
2022-05-18 10:15:54 +02:00
|
|
|
inputData={inputs.filter((i) => i.order == idInput)[0]}
|
|
|
|
isCorr={isCorr}
|
|
|
|
idInput={idInput}
|
|
|
|
idExo={idExo}
|
|
|
|
idCalcul={idCalcul}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
} else return c + " ";
|
|
|
|
})}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|