Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfb0dacf

Browse files
committed
Message for one wrong answer
1 parentcd4137a commitfb0dacf

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

‎frontend/src/OutputPrediction.js‎

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,19 @@ export class OutputPrediction extends Component {
7474
height
7575
}=this.props.prediction;
7676
constconfettiActive=state==="showingResult"&&answer===userChoice;
77+
letmessage;
78+
if(state==="waiting"){
79+
if(wrongAnswers.length===0){
80+
message="What do you think the result will be?";
81+
}else{
82+
message="Oops, that's not right. You can try one more time!";
83+
}
84+
}elseif(userChoice===answer){
85+
message="Correct!";
86+
}else{
87+
message="Sorry, wrong answer. Try again next time!";
88+
}
89+
7790
return<div
7891
className="output-prediction"
7992
style={{
@@ -82,19 +95,7 @@ export class OutputPrediction extends Component {
8295
}}
8396
>
8497
<div>
85-
<strong>
86-
{
87-
state==="waiting" ?
88-
"What do you think the result will be?"
89-
:
90-
(
91-
userChoice===answer ?
92-
"Correct!"
93-
:
94-
"Sorry, wrong answer. Try again next time!"
95-
)
96-
}
97-
</strong>
98+
<strong>{message}</strong>
9899
<CorrectConfettiactive={confettiActive}/>
99100
</div>
100101
<RadioGroup

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp