mrmime Posted May 20, 2010 Share Posted May 20, 2010 I am using The web acronym php test. everything is working fine except full answers/results. i have 11 questions and 4 answers in each. when am viewing my results the first answer is always Correct , but its not .i dont want it to be a first and Correct. I want to put Correct versions in different order. i think this part of code must be changed : $_SESSION['user'] = $username; $_SESSION['score'] = 0; $_SESSION['correct'] = array(); $_SESSION['wrong'] = array(); $_SESSION['finished'] = 'no'; if (isset($_SESSION['error'])) unset($_SESSION['error']); $num = 0; } else { $random = rand(1,1000); $_SESSION['user'] = 'Anon'. $random; $_SESSION['score'] = 0; $_SESSION['correct'] = array(); $_SESSION['wrong'] = array(); $_SESSION['finished'] = 'no'; $num = 0; } } else { $num = (int) $_POST['num']; $postedanswers = str_replace("_"," ",$_POST['answers']); if ($postedanswers == $answers[$num]['0']) { $_SESSION['score']++; $_SESSION['correct'][] = $postedanswers; } else { $_SESSION['wrong'][] = $postedanswers; } if ($num < count($questions)-1) { $num++; } else { $last = true; $_SESSION['finished'] = 'yes'; } } Please help me to find out the solution or maby i can find the Correct php acronym test ? regards)) Link to comment https://forums.phpfreaks.com/topic/202434-the-web-acronym-test-results-are-wrong-please-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.