From f1962e6f94af5786a8713e1abc7370eb489650f0 Mon Sep 17 00:00:00 2001 From: taisii Date: Thu, 22 Feb 2024 13:36:44 +0900 Subject: [PATCH] =?UTF-8?q?review=E3=82=92=E5=8F=97=E3=81=91=E3=81=A6?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../[courseId]/programs/[programId]/page.tsx | 4 +--- src/problems/problemData.ts | 16 ++++------------ 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/app/(withAuth)/courses/[courseId]/programs/[programId]/page.tsx b/src/app/(withAuth)/courses/[courseId]/programs/[programId]/page.tsx index 38e4c347..71ad4a96 100644 --- a/src/app/(withAuth)/courses/[courseId]/programs/[programId]/page.tsx +++ b/src/app/(withAuth)/courses/[courseId]/programs/[programId]/page.tsx @@ -23,7 +23,7 @@ const ProblemPage: NextPage<{ params: { courseId: string; programId: string } }> const checkPointLines = [2, 6, 8, 12]; const [selectedLanguageId, setSelectedLanguageId] = useState(''); - const [problemProgram, setProblemProgram] = useState(); + const [problemProgram, setProblemProgram] = useState({ displayProgram: '', excuteProgram: '' }); const [step, setStep] = useState('normal'); const [beforeCheckPointLine, setBeforeCheckPointLine] = useState(0); const [currentCheckPointLine, setCurrentCheckPointLine] = useState(checkPointLines[0]); @@ -43,8 +43,6 @@ const ProblemPage: NextPage<{ params: { courseId: string; programId: string } }> }; const ProblemComponent: React.FC = () => { - // problemProgramがundefinedの時の処理。どうしたらいいですか。 - if (!problemProgram) return <>; switch (step) { case 'normal': { return ( diff --git a/src/problems/problemData.ts b/src/problems/problemData.ts index 085bc88e..08d551df 100644 --- a/src/problems/problemData.ts +++ b/src/problems/problemData.ts @@ -92,25 +92,17 @@ public class Straight { curve: { js: ` const character = new Character(); -for (let i = 0; i < <3-10>; i++) { - character.moveForward(); -} +for (let i = 0; i < <3-10>; i++) { character.moveForward(); } character.turnLeft(); -for (let i = 0; i < <3-5>; i++) { - character.moveForward(); -} +for (let i = 0; i < <3-5>; i++) { character.moveForward(); } `.trim(), java: ` public class Curve { public static void main(String[] args) { var character = new Character(); - for (int i = 0; i < <3-10>; i++) { - character.moveForward(); - } + for (int i = 0; i < <3-10>; i++) { character.moveForward(); } character.turnLeft(); - for (int i = 0; i < <3-5>; i++) { - character.moveForward(); - } + for (int i = 0; i < <3-5>; i++) { character.moveForward(); } } } `.trim(),