I'm currently making a quiz with html and PHP, and I'd like to use checkboxes where there are multiple correct answers. The user must get ALL correct answers to get one mark per question. I've been looking at lots of tutorials but nothing seems to quite have what I need. Any help would be massively appreciated!
Here's an example of one of the questions, if you could tell me what is needed adding:
<p class="question">2. Which clubs did Arsene Wenger manage before taking the arsenal job in 1996?</p>
<ul class="answers">
<input type="checkbox" name="q2[]" id="q2a" value="q2a"><label for="q2a" class="labela">Monaco</label><br/>
<input type="checkbox" name="q2[]" id="q2b" value="q2b"><label for="q2b" class="labelb">Paris Saint-Germain</label><br/>
<input type="checkbox" name="q2[]" id="q2c" value="q2c"><label for="q2c" class="labelc">Bayern Munich</label><br/>
<input type="checkbox" name="q2[]" id="q2d" value="q2d"><label for="q2d" class="labeld">Nagoya Grampus</label><br/>
</ul>
and on a seperate answers page what i have at the moment:
<?php
$q2 = $_POST['q2'];
$total = 0;
if ($q2 == "a") { $total = $total + 0.5; }
if ($q2 == "b") { $total = $total + 0; }
if ($q2 == "c") { $total = $total + 0; }
if ($q2 == "d") { $total = $total + 0.5; }
?>