From 58f73367b37bc3c7bf1e39afbba8e7607b03b524 Mon Sep 17 00:00:00 2001 From: Yarcio Date: Sun, 15 Jun 2025 22:38:41 +0200 Subject: [PATCH] betaEnd --- rank/index.php | 49 +++++++++++++++++++++++++++++++++++++++ score/index.php | 1 + score/questions/index.php | 1 + score/tests/index.php | 1 + styles/main.css | 14 ++++++++++- styles/score.css | 8 +++++++ test/index.php | 1 + test/single/index.php | 10 +++++--- 8 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 rank/index.php create mode 100644 styles/score.css diff --git a/rank/index.php b/rank/index.php new file mode 100644 index 0000000..a90086c --- /dev/null +++ b/rank/index.php @@ -0,0 +1,49 @@ + + + + + + + + Ranking - quiz.czem.eu + + + + + + +

Ranking

+
+
+ prepare("SELECT correctAnswers, UID, testTime FROM tests WHERE rank = 1 ORDER BY correctAnswers DESC, testTime ASC"); + $stmt->execute(); + $stmt->store_result(); + $stmt->bind_result($correctAnswers, $UID, $testTime); + echo ""; + $i = 0; + while ($stmt->fetch()) { + $stmtUser = $conn->prepare("SELECT username FROM users WHERE UID = ?"); + $stmtUser->bind_param("i", $UID); + $stmtUser->execute(); + $stmtUser->bind_result($username); + if ($stmtUser->fetch()) { + $i++; + $pr = $correctAnswers/20*100; + echo ""; + } + $stmtUser->close(); + } + $stmt->close(); + $conn->close(); + echo "
MiejsceNazwa użytkownikaPoprawneWynikCzas zapisania testu
$i$username$correctAnswers/20$pr%$testTime
" + ?> +

Powrót

+
+
+ + + \ No newline at end of file diff --git a/score/index.php b/score/index.php index 215c9ad..bb7a356 100644 --- a/score/index.php +++ b/score/index.php @@ -10,6 +10,7 @@ redirectLogged(); Wyniki - quiz.czem.eu + diff --git a/score/questions/index.php b/score/questions/index.php index dd56e47..f12cf80 100644 --- a/score/questions/index.php +++ b/score/questions/index.php @@ -10,6 +10,7 @@ redirectLogged(); Zapisane pytania - quiz.czem.eu + diff --git a/score/tests/index.php b/score/tests/index.php index ea6370e..5ffa4ed 100644 --- a/score/tests/index.php +++ b/score/tests/index.php @@ -10,6 +10,7 @@ redirectLogged(); Zapisane testy - quiz.czem.eu + diff --git a/styles/main.css b/styles/main.css index f848a02..5ab88fa 100644 --- a/styles/main.css +++ b/styles/main.css @@ -71,6 +71,18 @@ main article div.clickable h3 { table, table th, table td { - border-spacing: 3px 20px; + border-spacing: 0; border: 1px solid var(--border-basic); +} +table.rank tr:nth-child(2) { + background-color: gold; +} +table.rank tr:nth-child(3) { + background-color: silver; +} +table.rank tr:nth-child(4) { + background-color: brown; +} +table.rank td{ + padding: 10px; } \ No newline at end of file diff --git a/styles/score.css b/styles/score.css new file mode 100644 index 0000000..a6cd5d0 --- /dev/null +++ b/styles/score.css @@ -0,0 +1,8 @@ +@import url("/styles/variables.css"); + +table, +table th, +table td { + border-spacing: 3px 20px; + border: 1px solid var(--border-basic); +} \ No newline at end of file diff --git a/test/index.php b/test/index.php index 2b77d11..1160dc4 100644 --- a/test/index.php +++ b/test/index.php @@ -18,6 +18,7 @@ include $_SERVER["DOCUMENT_ROOT"] . "/php/pages.php";

Rozpocznij test

+

UWAGA W PYTANIACH MOGĄ WYSTĘPOWAĆ BŁĘDY

Rozwiąż pytanie

+

UWAGA W PYTANIACH MOGĄ WYSTĘPOWAĆ BŁĘDY

Wyświetlania pytań:

- Losowo
- Wg nr pytania w bazie
- + + Losowo
+ Wg + nr pytania w bazie
+