28 lines
771 B
JavaScript
28 lines
771 B
JavaScript
import { useEffect, useState } from "react";
|
|
import InputExo from "./InputExo.jsx";
|
|
|
|
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 (
|
|
<InputExo
|
|
inputData={inputs.filter((i) => i.order == idInput)[0]}
|
|
isCorr={isCorr}
|
|
idInput={idInput}
|
|
idExo={idExo}
|
|
idCalcul={idCalcul}
|
|
/>
|
|
);
|
|
} else return c + " ";
|
|
})}
|
|
</div>
|
|
);
|
|
}
|