WebServ/www/public/M0/02/evaluate.php

34 lines
689 B
PHP
Raw Permalink Normal View History

2024-08-22 10:58:09 +00:00
<!doctype html>
<html>
<head lang="sv"></head>
<body>
<h1>Matematiktest</h1>
<h2>Resultat</h2>
<?php
$name = $_POST['name'];
$ans1 = $_POST['q1'];
$ans2 = $_POST['q2'];
$ans3 = $_POST['q3'];
$ans4 = $_POST['q4'];
$ans5 = $_POST['q5'];
$points = 0;
if($ans1 == 9)
$points++;
if($ans2 == 15)
$points++;
if($ans3 == -2)
$points++;
if($ans4 == 5)
$points++;
if($ans5 == 56)
$points++;
echo("<p>" . $name . " fick " . $points . " av 5 möjliga poäng</p>");
?>
<form action="index.html">
<input type="submit" value="Go Back">
</form>
</body>
</html>