mirror of
https://gitlab.com/harald.mueller/aktuelle.kurse.git
synced 2024-11-27 20:21:56 +01:00
67 lines
1.1 KiB
PHP
67 lines
1.1 KiB
PHP
<p>Das ist Ihr Ergebnis:
|
|
<br>
|
|
<br>
|
|
<?php
|
|
$frage1 = $hauptstadt;
|
|
$frage2 = $fremdwort;
|
|
$frage3 = $planet;
|
|
$frage4 = $kaiser;
|
|
$antwort1 = 2;
|
|
$antwort2 = 3;
|
|
$antwort3 = 3;
|
|
$antwort4 = 4;
|
|
$feedback1 = "Sie haben alles richtig geraten, Glückwunsch!";
|
|
$feedback2 = "3 Fragen richtig beantwortet!";
|
|
$feedback3 = "2 Fragen richtig beantwortet!";
|
|
$feedback4 = "1 Frage richtig beantwortet!";
|
|
$feedback5 = "Leider nichts richtig geraten";
|
|
$fragen = 4;
|
|
$result = 0;
|
|
if ($frage1 == $antwort1)
|
|
{
|
|
$result++;
|
|
}
|
|
else
|
|
{
|
|
}
|
|
if ($frage2 == $antwort2)
|
|
{
|
|
$result++;
|
|
}
|
|
else
|
|
{
|
|
}
|
|
if ($frage3 == $antwort3)
|
|
{
|
|
$result++;
|
|
}
|
|
else
|
|
{
|
|
}
|
|
if ($frage4 == $antwort4)
|
|
{
|
|
$result++;
|
|
}
|
|
else
|
|
{
|
|
}
|
|
echo "Score: $result","<br>";
|
|
switch ($result)
|
|
{
|
|
case $fragen:
|
|
echo "$feedback1";
|
|
break;
|
|
case $fragen-1:
|
|
echo "$feedback2";
|
|
break;
|
|
case $fragen-2:
|
|
echo "$feedback3";
|
|
break;
|
|
case $fragen-3:
|
|
echo "$feedback4";
|
|
break;
|
|
default:
|
|
echo "$feedback5";
|
|
}
|
|
?>
|