Jump to content

The web acronym test results are wrong. please help


mrmime

Recommended Posts

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))

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.