This commit is contained in:
Yarcio 2025-06-15 22:44:20 +02:00
parent 58f73367b3
commit 7f8b539e04
2 changed files with 3 additions and 0 deletions

View file

@ -17,6 +17,7 @@ include $_SERVER["DOCUMENT_ROOT"] . "/php/pages.php";
<h1>Ranking</h1>
<div class="wrap">
<main>
<h3><a href="../">Powrót</a></h3>
<?php
$conn = connectDB();
$stmt = $conn->prepare("SELECT correctAnswers, UID, testTime FROM tests WHERE rank = 1 ORDER BY correctAnswers DESC, testTime ASC");

View file

@ -33,6 +33,7 @@ redirectLogged();
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($QID, $answeredChar, $correct);
echo "</table><h3><a href='../tests/'>Powrót</a></h3>";
echo "<table><tr><th>Nr</th><th>Pytanie</th><th>Odpowiedzi</th><th>Twoja odpowiedź</th><th>Prawidłowa?</th><th>Prawidłowa odpowiedź</th></tr>";
$i = 0;
while ($stmt->fetch()) {
@ -54,6 +55,7 @@ redirectLogged();
$stmt->close();
echo "</table><h3><a href='../tests/'>Powrót</a></h3>";
} else {
echo "</table><h3><a href='../'>Powrót</a></h3>";
$stmt = $conn->prepare("SELECT TID, rank, correctAnswers, testLength, testTime FROM tests WHERE UID = ?");
$stmt->bind_param("i", $_SESSION["UID"]);
$stmt->bind_result($TID, $rank, $correctAnswers, $testLength, $testTime);