+
-
Jedno Pytanie
Wyświetl jedno pytanie z bazy quizu oraz natychmiastowo dostań na nie odpowiedź
+
-
Test 20 pytań
Wykonaj test 20 pytań, wynik oraz prawidłowość odpowiedzi pojawi się dopiero po oddaniu, w trakcie możesz zmieniać odpowiedzi na już rozwiązane pytania
+
@@ -39,19 +40,24 @@ include $_SERVER["DOCUMENT_ROOT"] . "/php/pages.php";
-
-
Własna długość testu
Kiedy 20 pytań to za dużo bądź za mało, zmień długość testu zależnie od swoich potrzeb
Inne
-
- Twoje wyniki
-
+
+
";
+ ?>
+ Twoje wyniki
+Rankingi
+
-
Wyloguj się
+
-
Przejdź do czem.eu
+
diff --git a/menu.css b/menu.css
index 95e1935..6f372a9 100644
--- a/menu.css
+++ b/menu.css
@@ -4,28 +4,5 @@ main {
min-width: 200px;
max-width: 90%;
}
-main article {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-evenly;
-}
-main article div {
- margin: 30px;
- padding: 20px 35px;
- width: 250px;
- background-color: var(--color-alt);
- border: 1px solid var(--border-basic);
- border-radius: 20px;
- transition: 0.2s;
- user-select: none;
-}
-main article div:hover {
- background-color: var(--color-alt-hover);
-}
-main article div:active {
- background-color: var(--color-alt-active);
-}
-main article div h3 {
- margin-bottom: 30px;
-}
+
diff --git a/php/functions.php b/php/functions.php
index 6d0bfd2..57048e6 100644
--- a/php/functions.php
+++ b/php/functions.php
@@ -15,6 +15,18 @@ function jsonMsg($messsage) {
}
function checkLogin() {
session_start();
- if (isset($_SESSION["UID"])) return true;
+ if (isset($_SESSION["UID"]))
+ return true;
return false;
+}
+function checkLogged() {
+ if (isset($_SESSION["username"]))
+ return true;
+ return false;
+}
+function redirectLogged() {
+ if (!checkLogged()) {
+ header("Location: /");
+ exit();
+ }
}
\ No newline at end of file
diff --git a/score/index.php b/score/index.php
index 71fee53..215c9ad 100644
--- a/score/index.php
+++ b/score/index.php
@@ -1,5 +1,6 @@
@@ -7,22 +8,23 @@ include $_SERVER["DOCUMENT_ROOT"] . "/php/pages.php";
- quiz.czem.eu
+ Wyniki - quiz.czem.eu
-
-
+
diff --git a/score/questions/index.php b/score/questions/index.php
new file mode 100644
index 0000000..dd56e47
--- /dev/null
+++ b/score/questions/index.php
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+ Zapisane pytania - quiz.czem.eu
+
+
+
+
+ Zapisane testy - quiz.czem.eu
+
+
+
+
+
Kod źródłowy
Twoje wyniki na testy i pytania
Przejdź do zapisanych wyników
-
-
- Zapisane Testy
-
-
+ Pojedyńcze pytania
-Przejdź do zapisanych wyników
+
+
+ Testy
+
+
+ Pojedyńcze pytania
+Wróć do strony głównej
Zapisane pytania
+
+
+ prepare("SELECT QID, answerChar, correct, questionTime FROM questionanswers WHERE UID = ?");
+ $stmt->bind_param("i", $_SESSION["UID"]);
+ $stmt->execute();
+ $stmt->store_result();
+ $stmt->bind_result($QID, $answeredChar, $correct, $questionsTime);
+ echo "
";
+ ?>
+
+
+
+
+
\ No newline at end of file
diff --git a/score/score.css b/score/score.css
deleted file mode 100644
index e69de29..0000000
diff --git a/score/tests/index.php b/score/tests/index.php
new file mode 100644
index 0000000..ea6370e
--- /dev/null
+++ b/score/tests/index.php
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Pytanie | Odpowiedzi | Twoja odpowiedź | Prawidłowa? | Prawidłowa odpowiedź | Czas zapisania odpowiedzi na pytanie |
---|---|---|---|---|---|
$content | A: $answerA | $answeredChar | $right | $answerChar | $questionsTime |
B: $answerB | |||||
C: $answerC | |||||
D: $answerD |
Powrót
+Zapisane testy
+
+
+ prepare("SELECT testLength FROM tests WHERE UID = ? AND TID = ?");
+ $stmt->bind_param("ii", $_SESSION["UID"], $_GET["TID"]);
+ $stmt->execute();
+ $stmt->bind_result($testLength);
+ if (!$stmt->fetch()) {
+ exit("ID testu nie zgadza się z ID użytkownika");
+ }
+ $stmt->close();
+ $stmt = $conn->prepare("SELECT QID, answeredChar, correct FROM testanswers WHERE TID = ?");
+ $stmt->bind_param("i", $_GET["TID"]);
+ $stmt->execute();
+ $stmt->store_result();
+ $stmt->bind_result($QID, $answeredChar, $correct);
+ echo "
+
+
+
+
\ No newline at end of file
diff --git a/styles/main.css b/styles/main.css
index c9f0c12..f848a02 100644
--- a/styles/main.css
+++ b/styles/main.css
@@ -30,9 +30,47 @@ div.wrap {
justify-content: center;
margin: 10px;
}
+
main form p#info {
text-align: center;
display: none;
color: red;
font-size: smaller;
}
+
+main article {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-evenly;
+}
+
+main article div.clickable {
+ margin: 30px;
+ padding: 20px 35px;
+ width: 250px;
+ background-color: var(--color-alt);
+ border: 1px solid var(--border-basic);
+ border-radius: 20px;
+ transition: 0.2s;
+ user-select: none;
+ cursor: pointer;
+}
+
+main article div.clickable:hover {
+ background-color: var(--color-alt-hover);
+}
+
+main article div.clickable:active {
+ background-color: var(--color-alt-active);
+}
+
+main article div.clickable h3 {
+ margin-bottom: 30px;
+}
+
+table,
+table th,
+table td {
+ border-spacing: 3px 20px;
+ border: 1px solid var(--border-basic);
+}
\ No newline at end of file
Nr | Pytanie | Odpowiedzi | Twoja odpowiedź | Prawidłowa? | Prawidłowa odpowiedź |
---|---|---|---|---|---|
$i/$testLength | $content | A: $answerA | $answeredChar | $right | $answerChar |
B: $answerB | |||||
C: $answerC | |||||
D: $answerD |
Powrót
"; + } else { + $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); + $stmt->execute(); + echo "Przejdź do opowiedzi na test | Zapisane w rankingu? | Poprawne odpowiedzi | Długość testu | Wynik testu | Czas zapisania testu |
---|---|---|---|---|---|
$rankAns | $correctAnswers | $testLength | $pr% | $testTime |