From ae304bb1a39f03cb34547ea2caa5ad9ad79ce8b4 Mon Sep 17 00:00:00 2001 From: Malik Piara Date: Tue, 18 Jun 2024 13:15:49 +0200 Subject: [PATCH] Conditionally rendering different wff based on different chapters. --- components/quiz/index.tsx | 57 ++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 16 deletions(-) diff --git a/components/quiz/index.tsx b/components/quiz/index.tsx index 0b508f0..22986ab 100644 --- a/components/quiz/index.tsx +++ b/components/quiz/index.tsx @@ -3,6 +3,7 @@ import React, { useCallback, useEffect, useState, useRef } from 'react'; import Button from '../button'; import Option from '../option'; import Prompt from '../prompt'; +import KatexSpan from '../katexSpan'; import { EndScreen } from './endScreen'; import { KeyboardKeys } from './keyboardKeys'; import { StartScreen } from './startScreen'; @@ -208,23 +209,47 @@ const Quiz: React.FC = ({ chapter }) => {
-
-

- What makes a well-formed formula (wff)? -

-

{`A wff must have one of these eight forms (where other capitals can replace "A" and "B" and other small letters "c" and "d"):`}

-
+ {(currentChapter.id === 1 && ( + <> +
+

+ What makes a well-formed formula (wff)? +

-
-
All A is B
-
No A is B
-
Some A is B
-
Some A is not B
-
c is A
-
c is A
-
c is not A
-
c is not D
-
+

{`A wff must have one of these eight forms (where other capitals can replace "A" and "B" and other small letters "c" and "d"):`}

+
+ +
+
All A is B
+
No A is B
+
Some A is B
+
Some A is not B
+
c is A
+
c is A
+
c is not A
+
c is not D
+
+ + )) || + (currentChapter.id === 6 && ( + <> +

+ What makes a well-formed formula (wff)? +

+

+ Use a pair of parentheses for each " + + " (AND), " + + " (OR), " + + " (IF-THEN) and " + + " (IFF).{' '} +

+

Do not use any other parentheses.

+ + ))}