Compare commits

...

3 Commits
dev ... main

Author SHA1 Message Date
a54b3e9109 Update docker-compose.yml 2023-09-07 12:12:55 +00:00
d2794d4c71 remove cheat 2023-08-23 09:06:29 +02:00
cc140a8d81 change to quix 2023-08-23 08:56:08 +02:00
3 changed files with 40 additions and 12 deletions

View File

@ -5,7 +5,7 @@ services:
container_name: nginx container_name: nginx
restart: always restart: always
ports: ports:
- 80:80 - 1001:80
volumes: volumes:
- ./www/public:/var/www/public - ./www/public:/var/www/public
- ./config/nginx/nginx.conf:/etc/nginx/nginx.conf - ./config/nginx/nginx.conf:/etc/nginx/nginx.conf

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