的重量我用這個頁面來創建自己的競猜腓測驗如何增加價值的答案
https://css-tricks.com/building-a-simple-quiz/
在這個例子中每一個問題是得1分。 我想改變每個問題來說10分。
我試過改變價值,並沒有運氣, 任何想法?
<?php
$answer1 = $_POST['question-1-answers'];
$answer2 = $_POST['question-2-answers'];
$answer3 = $_POST['question-3-answers'];
$answer4 = $_POST['question-4-answers'];
$answer5 = $_POST['question-5-answers'];
$totalCorrect = 0;
if ($answer1 == "A") { $totalCorrect++; }
if ($answer1 == "B") { $totalCorrect++; }
if ($answer2 == "A") { $totalCorrect++; }
if ($answer3 == "C") { $totalCorrect++; }
if ($answer4 == "D") { $totalCorrect++; }
if ($answer5) { $totalCorrect++; }
echo "<div id='results'>$totalCorrect/100%</div>"
?>
任何代碼可以幫助您? – Stefan
http://www.vestedutility.com.au/home_safety_check.php是我擁有它的地方 –
你應該在「問題」主體內部發布你的代碼「使用」格式標籤以使其更「易讀」。 –