Updated the reading to a new format

This commit is contained in:
Tiago Ribeiro
2023-09-28 14:43:43 +01:00
parent a568950aa9
commit 169ae2c959
9 changed files with 100 additions and 31 deletions

View File

@@ -19,11 +19,13 @@ export default function FillBlanksSolutions({id, type, prompt, solutions, text,
const renderLines = (line: string) => {
return (
<span>
{reactStringReplace(line, /({{\d}})/g, (match) => {
{reactStringReplace(line, /({{\d+}})/g, (match) => {
const id = match.replaceAll(/[\{\}]/g, "");
const userSolution = userSolutions.find((x) => x.id === id);
const solution = solutions.find((x) => x.id === id)!;
console.log(id, match);
if (!userSolution) {
return (
<button