change to quix

This commit is contained in:
Henrik Bygren 2023-08-23 08:56:08 +02:00
parent fbd1eadd07
commit cc140a8d81
2 changed files with 40 additions and 10 deletions

24
www/public/evaluate.php Normal file
View File

@ -0,0 +1,24 @@
<!doctype html>
<html>
<head lang="sv"></head>
<body>
<h1>Matematiktest</h1>
<h2>Resultat</h2>
<?php
$ans1 = $_GET['q1'];
$ans2 = $_GET['q2'];
$points = 0;
if ($ans1 == 9)
$points++;
if ($ans2 == 15)
$points++;
echo "<p>Du fick $points av 2 möjliga</p>";
?>
</body>
</html>

View File

@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="sv">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@ -7,16 +8,21 @@
</head>
<body>
<h1>Webbservern fungerar NY VERSION 3!</h1>
<p><strong>Denna sida (index.php) skall bytas ut.</strong></p>
<h1>Matematik-test</h1>
<form action="evaluate.php" method="get">
<fieldset>
<legend>Frågor</legend>
<label>4 + 5 = </label>
<input type="text" name="q1">
<br>
<label>3 x 5 = </label>
<input type="text" name="q2">
<br>
<input type="submit" value="Rätta">
</fieldset>
</form>
<?php
$date = date("Y-m-d");
$v = 3.0;
print "<p>Version $v</p>";
echo "<h2>Hej PHP dagens datum: $date</h2>";
?>
<h3>Efter PHP</h3>
<a href="evaluate.php?q1=9&q2=15">FUSK</a>
</body>
</html>