Skip to content

Commit 285f144

Browse files
committed
total score on problem result screen
1 parent 18ad192 commit 285f144

3 files changed

Lines changed: 26 additions & 5 deletions

File tree

src/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,7 @@ export default function App() {
658658
problemIndex={lastResultIndex}
659659
problemCount={session.problems.length}
660660
result={session.results[lastResultIndex]}
661+
totalMistakes={totalMistakes}
661662
remainingSeconds={session.remainingSeconds}
662663
onContinue={handleContinueFromResult}
663664
onBackHome={backHome}

src/components/ProblemResultScreen.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ type ProblemResultScreenProps = {
88
problemIndex: number;
99
problemCount: number;
1010
result: ProblemScoreResult;
11+
totalMistakes: number;
1112
remainingSeconds: number;
1213
onContinue: () => void;
1314
onBackHome: () => void;
@@ -49,6 +50,7 @@ export function ProblemResultScreen({
4950
problemIndex,
5051
problemCount,
5152
result,
53+
totalMistakes,
5254
remainingSeconds,
5355
onContinue,
5456
onBackHome,
@@ -58,10 +60,15 @@ export function ProblemResultScreen({
5860
<h1>
5961
Problem {problemIndex + 1} of {problemCount} Result
6062
</h1>
61-
<Timer remainingSeconds={remainingSeconds} />
62-
<p className="score-callout">
63-
Mistake score: <strong>{result.mistakePoints}</strong>
64-
</p>
63+
<div className="status-row">
64+
<Timer remainingSeconds={remainingSeconds} />
65+
<p className="score-callout">
66+
Problem score <strong>{result.mistakePoints}</strong>
67+
</p>
68+
<p className="score-callout">
69+
Total score <strong>{totalMistakes}</strong>
70+
</p>
71+
</div>
6572

6673
<div className="result-grid">
6774
<GoBoard

src/styles.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,26 @@ button:disabled {
169169
margin-top: 2px;
170170
}
171171

172+
.status-row {
173+
display: flex;
174+
flex-wrap: wrap;
175+
gap: 10px;
176+
align-items: center;
177+
margin-bottom: 16px;
178+
}
179+
180+
.status-row .timer,
181+
.status-row .score-callout {
182+
margin: 0;
183+
}
184+
172185
.score-callout {
173186
display: flex;
174187
align-items: center;
175188
gap: 8px;
176189
width: fit-content;
177190
min-height: 34px;
178-
margin-bottom: 16px;
191+
margin: 0 0 16px;
179192
padding: 5px 10px;
180193
border: 1px solid rgba(143, 190, 255, 0.24);
181194
border-radius: 999px;

0 commit comments

Comments
 (0)