Skip to content

Commit 9f7a233

Browse files
authored
Merge pull request #17 from ut-code/fix/Lv1
Lv1の判定を緩くした
2 parents 06daa77 + e2a5e13 commit 9f7a233

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

src/sidepanel/App.tsx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,21 @@ function App() {
5050
const currentStep = stepRef.current
5151

5252
if (currentStep === 1) {
53-
if (baselineRef.current.p1 === null) { baselineRef.current.p1 = p1; return }
53+
// 初回メッセージでベースラインを記録
54+
if (baselineRef.current.p1 === null) {
55+
baselineRef.current.p1 = p1
56+
return
57+
}
58+
// ベースライン(初期値)から値が変更されたかチェック
5459
if (p1 !== baselineRef.current.p1) {
55-
const isCorrect = p1 === ANSWERS.p1
56-
setResult({ ok: isCorrect, details: isCorrect ? `一致: "${p1}"` : `不一致: "${p1}"` })
57-
if (isCorrect) {
58-
setTimeout(() => {
59-
setStep(2)
60-
setResult(null)
61-
baselineRef.current.p2 = p2
62-
}, 4000)
63-
}
60+
// 変更されていれば、それだけで正解とする
61+
const isCorrect = true
62+
setResult({ ok: isCorrect, details: `値が変更されました: "${p1}"` })
63+
setTimeout(() => {
64+
setStep(2)
65+
setResult(null)
66+
baselineRef.current.p2 = p2
67+
}, 4000)
6468
}
6569
}
6670

@@ -131,7 +135,7 @@ function App() {
131135
{step === 1 && (
132136
<div>
133137
<h2>問題1</h2>
134-
<p>レビューの「とにかくひどい。」を「すばらしい。」に書き換えてみよう!</p>
138+
<p>レビューの「とにかくひどい。」をほかの言葉に書き換えてみよう。</p>
135139
{result && <div className={result.ok ? "result-ok" : "result-ng"}><h3>判定: {result.ok ? '正解!' : '不正解'}</h3><p>{result.details}</p>{result.ok && <p>次の問題へ進みます...</p>}</div>}
136140
{!result && <p className="hint">ヒント:開発者ツールを使って、レビューに当たる要素を探してみよう。</p>}
137141
</div>

0 commit comments

Comments
 (0)