Thanks guys for replying but I am still having problems.
My HTML Question reads as follows
Q6. What are functions and when would you use them? Check all right answers
CB1 Functions are bunch of codes that are defined by the user
CB2 Functions are sort of like a box where you can put all a bunch of arguments and then call on them at once
CB3 Functions can be used when you want to print multiple answers
CB4 Functions are used when you want to call certain arguments multiple times in a code
The correct answers above is Check box 2 and 4. Users must select these two to receive a mark increment.
My PHP code reads as follows
// check answer for question 6 - multiple checkbox answer - use an array to increment mark
foreach($q6 as $answer)
{
if( $answer == "b") $mark1=1;
if ($answer == "d") $mark2=1;
}
If ($mark1 && $mark2) $correctanswers++;
It doesn't work. It totally ignores my array.