UI Refresh & Logic Updates: New answer color scheme, improved Boolean/Number handling for results, and localized formatting.

This commit is contained in:
2026-04-16 20:40:27 +02:00
parent 604d23bcdf
commit 2c352b2392
5 changed files with 41 additions and 55 deletions
+6 -3
View File
@@ -705,8 +705,11 @@ function MyResultsPage({ navigate }) {
<div className="w-full max-w-md mt-6 space-y-4">
{Object.entries(sessions).reverse().map(([sid, s]) => {
const total = s.answers.length;
const cor = s.answers.filter((a) => a['Richtig']).length;
const points = s.answers.reduce((sum, a) => sum + (a['Punkte'] || 0), 0);
const cor = s.answers.filter((a) => {
const v = a['Richtig'];
return v === true || v === 'true' || v === 1;
}).length;
const points = s.answers.reduce((sum, a) => sum + (Number(a['Punkte']) || 0), 0);
return (
<div key={sid} className="bg-gray-800 rounded-xl p-4">
<div className="flex justify-between items-start mb-2">
@@ -716,7 +719,7 @@ function MyResultsPage({ navigate }) {
</div>
<span className="text-sm text-gray-400">{s.date ? new Date(s.date).toLocaleDateString('de') : ''}</span>
</div>
<p>{cor}/{total} richtig {points} Punkte</p>
<p>{cor}/{total} richtig {points.toLocaleString('de')} Punkte</p>
</div>
);
})}