12) $t = 1; $test_title = "Alphabet Test: Real Persian Words with Audio"; $group_title = "Group"; $folder = ""; if ($t<7) { $group_title .= " $t"; $folder = "$t"; } else { $group_title .= "s 1-".($t-5); $folder = $t-5; } $words = array(); if (isset($_POST['check'])) { $data = $_POST['data']; $newdata = explode(":", base64_decode($data)); $correct_answer = $newdata[0]; $word_inds = explode(",", $newdata[1]); for ($i=0; $i<4; $i++) { if ($r = mysql_query("SELECT * FROM perseng WHERE id=".$word_inds[$i])) { if ($row = mysql_fetch_assoc($r)) { $words[] = $row; } } } } else { $r = mysql_query("SELECT * FROM perseng WHERE letter_group=$t ORDER BY RAND() LIMIT 4"); $word_inds = array(); while ($row = mysql_fetch_assoc($r)) { $words[] = $row; $word_inds[] = $row['id']; } srand((float)microtime() * 1000000); $correct_answer = rand(0, 3); $data = "$correct_answer:".implode(",", $word_inds); $data = base64_encode($data); } ?> \n

$test_title

\n"; print "

You have answered the question correctly.
Try to answer another question.\n"; exit("

Back to the Persian Alphabet Tests

"); } print "\n"; } else { print "\n"; } ?>

You are wrong! Please try again!"; } print "

Listen to this word from $group_title meaning \"".$words[$correct_answer]['eng']."\" and then select this word in Perso-Arabic script from the choices given."; ?>

*/ print ""; print ""; print ""; print "
"; } print "

"; ?>


Back to the Persian Alphabet Tests