442 lines
21 KiB
PHP
442 lines
21 KiB
PHP
<?php session_start();
|
|
|
|
$sitename = 'learn';
|
|
|
|
$_SESSION["redirect"] = 'index';
|
|
|
|
$folderID = $_SESSION["folderID"];
|
|
$action = $_SESSION["action"];
|
|
|
|
|
|
$entered = strip_tags(htmlentities($_POST["entered"]));
|
|
|
|
$vokGroup1 = strip_tags(htmlentities($_POST["vok-group-1"]));
|
|
$vokGroup2 = strip_tags(htmlentities($_POST["vok-group-2"]));
|
|
$vokGroup3 = strip_tags(htmlentities($_POST["vok-group-3"]));
|
|
|
|
if($vokGroup1 == '' && $vokGroup2 == '' && $vokGroup3 == '') {
|
|
$vokGroup1 = $_SESSION["vokGroup1"];
|
|
$vokGroup2 = $_SESSION["vokGroup2"];
|
|
$vokGroup3 = $_SESSION["vokGroup3"];
|
|
}
|
|
else {
|
|
$_SESSION["vokGroup1"] = $vokGroup1;
|
|
$_SESSION["vokGroup2"] = $vokGroup2;
|
|
$_SESSION["vokGroup3"] = $vokGroup3;
|
|
|
|
$startedForFirstTime = '1';
|
|
}
|
|
|
|
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Lernen | Vokabelbox</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="stylesheet" href="files/style.css" />
|
|
<script language="javascript" type="text/javascript" src="files/scripts.js"></script>
|
|
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
|
|
<link rel="apple-touch-icon" sizes="57x57" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-57x57.png">
|
|
<link rel="apple-touch-icon" sizes="60x60" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-60x60.png">
|
|
<link rel="apple-touch-icon" sizes="72x72" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-72x72.png">
|
|
<link rel="apple-touch-icon" sizes="76x76" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-76x76.png">
|
|
<link rel="apple-touch-icon" sizes="114x114" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-114x114.png">
|
|
<link rel="apple-touch-icon" sizes="120x120" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-120x120.png">
|
|
<link rel="apple-touch-icon" sizes="144x144" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-144x144.png">
|
|
<link rel="apple-touch-icon" sizes="152x152" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-152x152.png">
|
|
<link rel="apple-touch-icon" sizes="180x180" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-180x180.png">
|
|
<link rel="icon" type="image/png" sizes="192x192" href="https://www.timvandenboom.de/Favicons/VokabelBox/android-icon-192x192.png">
|
|
<link rel="icon" type="image/png" sizes="32x32" href="https://www.timvandenboom.de/Favicons/VokabelBox/favicon-32x32.png">
|
|
<link rel="icon" type="image/png" sizes="96x96" href="https://www.timvandenboom.de/Favicons/VokabelBox/favicon-96x96.png">
|
|
<link rel="icon" type="image/png" sizes="16x16" href="https://www.timvandenboom.de/Favicons/VokabelBox/favicon-16x16.png">
|
|
<meta name="msapplication-TileColor" content="#ffffff">
|
|
<meta name="msapplication-TileImage" content="https://www.timvandenboom.de/Favicons/VokabelBox/ms-icon-144x144.png">
|
|
<meta name="theme-color" content="#ffffff">
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<p onclick="window.location.href='index'"></p>
|
|
<div class="more-menu">
|
|
<button class="fas fa-ellipsis-v"></button>
|
|
<div class="more-menu-content">
|
|
<div onclick="window.location.href='index'" title="VokabelBox"><i class="fas fa-home"></i>VokabelBox</div>
|
|
<div onclick="window.location.href='myaccount'" title="Mein Account"><i class="far fa-user-circle"></i>Mein Account</div>
|
|
<div onclick="window.location.href='marks'" title="Meine Noten"><i class="fas fa-table"></i>Meine Noten</div>
|
|
<div onclick="window.location.href='search'" title="Meine VokabelBox durchsuchen"><i class="fas fa-search"></i>Suchen</div>
|
|
<div onclick="window.location.href='help'" title="Hilfecenter öffnen"><i class="fas fa-question-circle"></i>Hilfe</div>
|
|
<div onclick="window.location.href='actions/logout'" title="Von VokabelBox abmelden"><i class="fas fa-sign-out-alt"></i>Ausloggen</div>
|
|
<br>
|
|
<div onclick="window.location.href='index?folderID=<?php print("$folderID"); ?>'" title="Aktuelle Lern-Session beenden und zur Übersicht zurückkehren"><i class="fas fa-chevron-left"></i>Beenden</div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<main>
|
|
<div class="middle">
|
|
<?php
|
|
|
|
require "files/ezine_db.inc.php";
|
|
|
|
include "files/loginscript.inc.php";
|
|
|
|
include "files/errorcodesscript.inc.php";
|
|
|
|
if($LoggedIn == 'true') {
|
|
|
|
// Kombination von Rot, Gelb und Gruen bei der Auswahl in Daten umwandeln
|
|
|
|
if($vokGroup1 != '' && $vokGroup2 != '' && $vokGroup3 != '') {
|
|
$auswahl = "`Lernfortschritt` < '99'";
|
|
}
|
|
if($vokGroup1 != '' && $vokGroup2 == '' && $vokGroup3 == '') {
|
|
$auswahl = "`Lernfortschritt` <= '3'";
|
|
}
|
|
if($vokGroup2 != '' && $vokGroup1 == '' && $vokGroup3 == '') {
|
|
$auswahl = "(`Lernfortschritt` > '3') AND (`Lernfortschritt` <= '5')";
|
|
}
|
|
if($vokGroup3 != '' && $vokGroup1 == '' && $vokGroup2 == '') {
|
|
$auswahl = "`Lernfortschritt` > '5'";
|
|
}
|
|
if($vokGroup1 != '' && $vokGroup2 != '' && $vokGroup3 == '') {
|
|
$auswahl = "(`Lernfortschritt` <= '3' OR `Lernfortschritt` > '3') AND (`Lernfortschritt` <= '5')";
|
|
}
|
|
if($vokGroup1 != '' && $vokGroup3 != '' && $vokGroup2 == '') {
|
|
$auswahl = "`Lernfortschritt` <= '3' OR Lernfortschritt` > '5'";
|
|
}
|
|
if($vokGroup2 != '' && $vokGroup3 != '' && $vokGroup1 == '') {
|
|
$auswahl = "`Lernfortschritt` > '3' AND (`Lernfortschritt` <= '5' OR `Lernfortschritt` > '5')";
|
|
}
|
|
if($vokGroup1 == '' && $vokGroup2 == '' && $vokGroup3 == '') {
|
|
$_SESSION["errorCode"] = 'couldntStartLearn';
|
|
print("<meta http-equiv='refresh' content='0; URL=index?folderID=$folderID'>");
|
|
}
|
|
|
|
if($vokGroup1 == '' && $vokGroup2 == '' && $vokGroup3 == '') {
|
|
$_SESSION["errorCode"] = 'couldntStartLearn';
|
|
print("<meta http-equiv='refresh' content='0; URL=index?folderID=$folderID'>");
|
|
}
|
|
|
|
// Wenn zum ersten Mal gestartet: Eingegebene Werte werden fuer die kommenden Seiten schmackhaft gemacht
|
|
if($startedForFirstTime == '1') {
|
|
// Wenn die aktuelle Auswahl keine Vokabeln enthaelt
|
|
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Sprache1` != '') AND ($auswahl)";
|
|
$result_articles = $conn->query($sql);
|
|
$gesamt_anzahl = mysqli_num_rows($result_articles);
|
|
if(!mysqli_num_rows($result_articles))
|
|
{
|
|
$_SESSION["errorCode"] = 'couldntStartLearn';
|
|
print("<meta http-equiv='refresh' content='0; URL=index?folderID=$folderID'>");
|
|
}
|
|
$number = strip_tags(htmlentities($_POST["number"]));
|
|
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Session` = '1' WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Sprache1` != '') ORDER BY RAND() LIMIT $number");
|
|
}
|
|
|
|
// Normale Abfrage
|
|
if($action == '0') {
|
|
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Session` = '2') AND ($auswahl)";
|
|
$result_articles = $conn->query($sql);
|
|
$true = mysqli_num_rows($result_articles);
|
|
|
|
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Session` = '3') AND ($auswahl)";
|
|
$result_articles = $conn->query($sql);
|
|
$false = mysqli_num_rows($result_articles);
|
|
|
|
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Sprache1` != '') AND ($auswahl) AND (`Session` > 0)";
|
|
$result_articles = $conn->query($sql);
|
|
$total = mysqli_num_rows($result_articles);
|
|
|
|
$solved = $false + $true;
|
|
// Wenn alle Vokabeln abgearbeitet sind
|
|
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Sprache1` != '') AND ($auswahl) AND (`Session` = '1') ORDER BY RAND() LIMIT 0,1";
|
|
$result_articles = $conn->query($sql);
|
|
if(!mysqli_num_rows($result_articles))
|
|
{
|
|
print("<p>Ergebnis wird errechnet...");
|
|
print("<meta http-equiv='refresh' content='1; URL=result'>");
|
|
}
|
|
while ($articleDb = mysqli_fetch_object($result_articles)) {
|
|
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Session` = '10' WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Sprache1` = '$articleDb->Sprache1') AND (`Sprache2` = '$articleDb->Sprache2')");
|
|
print(
|
|
"<div class='live-result'><div><span class='green'>$true</span> | <span class='red'>$false</span><span> </span>
|
|
<span>$solved / $total</span></div></div>");
|
|
$_SESSION["folderID"] = $folderID;
|
|
$_SESSION["action"] = '1';
|
|
print(
|
|
"<p>$articleDb->Sprache1</p>
|
|
<form class='form' method='post' action='learn'>
|
|
<input type='text' autofocus style='text-align: center !important' name='entered'><br>
|
|
<button type='submit' class='classic-button classic-button-grey'>
|
|
Weiter
|
|
<i class='fas fa-angle-right'> </i>
|
|
</button>
|
|
</form>");
|
|
|
|
}
|
|
}
|
|
// Ueberpruefung
|
|
if($action == '1') {
|
|
$sql = "SELECT * FROM `VokabelBoxUsers` WHERE `Benutzername` = '$Benutzername'";
|
|
$result_articles = $conn->query($sql);
|
|
while ($articleDb = mysqli_fetch_object($result_articles)) {
|
|
$Zeit = $articleDb->Zeit;
|
|
$GrossKlein = $articleDb->GrossKlein;
|
|
}
|
|
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Session` = '2') AND ($auswahl)";
|
|
$result_articles = $conn->query($sql);
|
|
$true = mysqli_num_rows($result_articles);
|
|
|
|
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Session` = '3') AND ($auswahl)";
|
|
$result_articles = $conn->query($sql);
|
|
$false = mysqli_num_rows($result_articles);
|
|
|
|
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Sprache1` != '') AND ($auswahl) AND (`Session` > 0)";
|
|
$result_articles = $conn->query($sql);
|
|
$total = mysqli_num_rows($result_articles);
|
|
|
|
$solved = $false + $true + 1;
|
|
|
|
// Wenn Benutzer die Gross-Klein-Beachtung eingeschaltet hat
|
|
if($GrossKlein == 'on') {
|
|
|
|
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Session` = '10')";
|
|
$result_articles = $conn->query($sql);
|
|
while ($articleDb = mysqli_fetch_object($result_articles)) {
|
|
$Sprache1 = $articleDb->Sprache1;
|
|
$Sprache2 = $articleDb->Sprache2;
|
|
// Wenn richtig
|
|
if($entered == $articleDb->Sprache2) {
|
|
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Lernfortschritt` = `Lernfortschritt` + 1 WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Session` = '10')");
|
|
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Session` = '2' WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Session` = '10')");
|
|
$true = $true + 1;
|
|
print(
|
|
"<div class='live-result'><div><span class='green'>$true</span> | <span class='red'>$false</span> <span>$solved / $total</span></div></div>");
|
|
print(
|
|
"<p>$articleDb->Sprache1</p>
|
|
<p class='result result-true'>$articleDb->Sprache2</p>
|
|
");
|
|
}
|
|
// Wenn falsch
|
|
else {
|
|
if($entered == '') {
|
|
$entered = 'Keine Eingabe';
|
|
}
|
|
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Lernfortschritt` = `Lernfortschritt` - 1 WHERE (`Lernfortschritt` > 0) AND (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Sprache1` = '$Sprache1') AND (`Sprache2` = '$Sprache2')");
|
|
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Session` = '3' WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Sprache1` = '$Sprache1') AND (`Sprache2` = '$Sprache2')");
|
|
$false = $false + 1;
|
|
print(
|
|
"<div class='live-result'><div><span class='green'>$true</span> | <span class='red'>$false</span><span> </span>
|
|
<span>$solved / $total</span></div></div>");
|
|
print(
|
|
"<p>$articleDb->Sprache1</p>
|
|
<p class='result result-false'>$entered</p>
|
|
<p><i>$articleDb->Sprache2</i></p>
|
|
");
|
|
}
|
|
|
|
$_SESSION["folderID"] = $folderID;
|
|
$_SESSION["action"] = '0';
|
|
|
|
print("<meta http-equiv='refresh' content='$Zeit; URL=learn'>");
|
|
|
|
}
|
|
|
|
|
|
}
|
|
// Wenn Benutzer die Gross-Klein-Beachtung ausgeschaltet hat
|
|
if($GrossKlein == '') {
|
|
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Session` = '10')";
|
|
$result_articles = $conn->query($sql);
|
|
while ($articleDb = mysqli_fetch_object($result_articles)) {
|
|
$Sprache1 = $articleDb->Sprache1;
|
|
$Sprache2 = $articleDb->Sprache2;
|
|
if(strtolower($entered) == strtolower($articleDb->Sprache2)) {
|
|
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Lernfortschritt` = `Lernfortschritt` + 1 WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Session` = '10')");
|
|
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Session` = '2' WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Session` = '10')");
|
|
$true = $true + 1;
|
|
print(
|
|
"<div class='live-result'><div><span class='green'>$true</span> | <span class='red'>$false</span><span> </span><span>$solved / $total</span></div></div>");
|
|
print(
|
|
"<p>$articleDb->Sprache1</p>
|
|
<p class='result result-true'>$articleDb->Sprache2</p>
|
|
");
|
|
}
|
|
else {
|
|
if($entered == '') {
|
|
$entered = 'Keine Eingabe';
|
|
}
|
|
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Lernfortschritt` = `Lernfortschritt` - 1 WHERE (`Lernfortschritt` > 0) AND (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Sprache1` = '$Sprache1') AND (`Sprache2` = '$Sprache2')");
|
|
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Session` = '3' WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Sprache1` = '$Sprache1') AND (`Sprache2` = '$Sprache2')");
|
|
$false = $false + 1;
|
|
print(
|
|
"<div class='live-result'><div><span class='green'>$true</span> | <span class='red'>$false</span><span> </span>
|
|
<span>$solved / $total</span></div></div>");
|
|
print(
|
|
"<p>$articleDb->Sprache1</p>
|
|
<p class='result result-false'>$entered</p>
|
|
<p><i>$articleDb->Sprache2</i></p>
|
|
");
|
|
}
|
|
|
|
$_SESSION["folderID"] = $folderID;
|
|
$_SESSION["action"] = '0';
|
|
|
|
print("<meta http-equiv='refresh' content='$Zeit; URL=learn'>");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|
|
// Weitere Durchlaeufe
|
|
if($action == '2') {
|
|
|
|
$false = $_SESSION["false"];
|
|
$true = $_SESSION["true"];
|
|
$total = $_SESSION["total"];
|
|
$_SESSION["total"] = $total;
|
|
|
|
$solved = $false + $true;
|
|
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Sprache1` != '') AND (`Session` = '3') ORDER BY RAND() LIMIT 0,1";
|
|
$result_articles = $conn->query($sql);
|
|
if(!mysqli_num_rows($result_articles))
|
|
{
|
|
print("<p>Ergebnis wird errechnet...");
|
|
print("<meta http-equiv='refresh' content='1; URL=result'>");
|
|
}
|
|
while ($articleDb = mysqli_fetch_object($result_articles)) {
|
|
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Session` = '10' WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Sprache1` = '$articleDb->Sprache1') AND (`Sprache2` = '$articleDb->Sprache2')");
|
|
print(
|
|
"<div class='live-result'><div><span class='green'>$true</span> | <span class='red'>$false</span><span> </span>
|
|
<span>$solved / $total</span></div></div>");
|
|
$_SESSION["folderID"] = $folderID;
|
|
$_SESSION["action"] = '3';
|
|
print(
|
|
"<p>$articleDb->Sprache1</p>
|
|
<form class='form' method='post' action='learn'>
|
|
<input type='text' autofocus style='text-align: center !important' name='entered'><br>
|
|
<button type='submit' class='classic-button classic-button-grey'>
|
|
Weiter
|
|
<i class='fas fa-angle-right'> </i>
|
|
</button>
|
|
</form>");
|
|
|
|
}
|
|
}
|
|
// Ueberpruefen
|
|
if($action == '3') {
|
|
|
|
$sql = "SELECT * FROM `VokabelBoxUsers` WHERE `Benutzername` = '$Benutzername'";
|
|
$result_articles = $conn->query($sql);
|
|
while ($articleDb = mysqli_fetch_object($result_articles)) {
|
|
$Zeit = $articleDb->Zeit;
|
|
$GrossKlein = $articleDb->GrossKlein;
|
|
}
|
|
|
|
$false = $_SESSION["false"];
|
|
$true = $_SESSION["true"];
|
|
$total = $_SESSION["total"];
|
|
$_SESSION["total"] = $total;
|
|
|
|
$solved = $false + $true + 1;
|
|
|
|
if($GrossKlein == 'on') {
|
|
|
|
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Session` = '10')";
|
|
$result_articles = $conn->query($sql);
|
|
while ($articleDb = mysqli_fetch_object($result_articles)) {
|
|
$Sprache1 = $articleDb->Sprache1;
|
|
$Sprache2 = $articleDb->Sprache2;
|
|
if($entered == $articleDb->Sprache2) {
|
|
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Lernfortschritt` = `Lernfortschritt` + 1 WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Session` = '10')");
|
|
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Session` = '2' WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Session` = '10')");
|
|
$true = $true + 1;
|
|
print(
|
|
"<div class='live-result'><div><span class='green'>$true</span> | <span class='red'>$false</span> <span>$solved / $total</span></div></div>");
|
|
print(
|
|
"<p>$articleDb->Sprache1</p>
|
|
<p class='result result-true'>$articleDb->Sprache2</p>
|
|
");
|
|
}
|
|
else {
|
|
if($entered == '') {
|
|
$entered = 'Keine Eingabe';
|
|
}
|
|
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Lernfortschritt` = `Lernfortschritt` - 1 WHERE (`Lernfortschritt` > 0) AND (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Sprache1` = '$Sprache1') AND (`Sprache2` = '$Sprache2')");
|
|
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Session` = '4' WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Sprache1` = '$Sprache1') AND (`Sprache2` = '$Sprache2')");
|
|
$false = $false + 1;
|
|
print(
|
|
"<div class='live-result'><div><span class='green'>$true</span> | <span class='red'>$false</span><span> </span>
|
|
<span>$solved / $total</span></div></div>");
|
|
print(
|
|
"<p>$articleDb->Sprache1</p>
|
|
<p class='result result-false'>$entered</p>
|
|
<p><i>$articleDb->Sprache2</i></p>
|
|
");
|
|
}
|
|
|
|
$_SESSION["folderID"] = $folderID;
|
|
$_SESSION["action"] = '0';
|
|
|
|
print("<meta http-equiv='refresh' content='$Zeit; URL=learn'>");
|
|
|
|
}
|
|
|
|
|
|
}
|
|
if($GrossKlein == '') {
|
|
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Session` = '10')";
|
|
$result_articles = $conn->query($sql);
|
|
while ($articleDb = mysqli_fetch_object($result_articles)) {
|
|
$Sprache1 = $articleDb->Sprache1;
|
|
$Sprache2 = $articleDb->Sprache2;
|
|
if(strtolower($entered) == strtolower($articleDb->Sprache2)) {
|
|
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Lernfortschritt` = `Lernfortschritt` + 1 WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Session` = '10')");
|
|
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Session` = '2' WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Session` = '10')");
|
|
$true = $true + 1;
|
|
$_SESSION["true"] = $true;
|
|
print(
|
|
"<div class='live-result'><div><span class='green'>$true</span> | <span class='red'>$false</span><span> </span><span>$solved / $total</span></div></div>");
|
|
print(
|
|
"<p>$articleDb->Sprache1</p>
|
|
<p class='result result-true'>$articleDb->Sprache2</p>
|
|
");
|
|
}
|
|
else {
|
|
if($entered == '') {
|
|
$entered = 'Keine Eingabe';
|
|
}
|
|
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Lernfortschritt` = `Lernfortschritt` - 1 WHERE (`Lernfortschritt` > 0) AND (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Sprache1` = '$Sprache1') AND (`Sprache2` = '$Sprache2')");
|
|
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Session` = '4' WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Sprache1` = '$Sprache1') AND (`Sprache2` = '$Sprache2')");
|
|
$false = $false + 1;
|
|
$_SESSION["false"] = $false;
|
|
print(
|
|
"<div class='live-result'><div><span class='green'>$true</span> | <span class='red'>$false</span><span> </span>
|
|
<span>$solved / $total</span></div></div>");
|
|
print(
|
|
"<p>$articleDb->Sprache1</p>
|
|
<p class='result result-false'>$entered</p>
|
|
<p><i>$articleDb->Sprache2</i></p>
|
|
");
|
|
}
|
|
|
|
$_SESSION["folderID"] = $folderID;
|
|
$_SESSION["action"] = '2';
|
|
|
|
print("<meta http-equiv='refresh' content='$Zeit; URL=learn'>");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
}
|
|
?>
|
|
</div>
|
|
<a class="no-formatting impressum" href="https://www.timvandenboom.de/impressum">Impressum</a>
|
|
</main>
|
|
</body>
|
|
</html>
|