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