7) $t = 1; $test_title = "Alphabet Test"; $letters = array(); $letters[0][0] = array('او', 'آ', 'ای'); $letters[0][1] = array('u', 'aa', 'i'); $letters[1][0] = array('و', 'ر', 'د', 'ز', 'ژ', 'ذ'); $letters[1][1] = array('v', 'r', 'd', 'z', 'zh', 'z'); $letters[2][0] = array('ب', 'پ', 'ف', 'ت', 'ث', 'ک', 'گ'); $letters[2][1] = array('b', 'p', 'f', 't', 's', 'k', 'g'); $letters[3][0] = array('س', 'ش', 'ص', 'ض', 'ل', 'ق', 'ن'); $letters[3][1] = array('s', 'sh', 's', 'z', 'l', 'gh', 'n'); $letters[4][0] = array('اوم', 'آم', 'ایم', 'اوی', 'آی', 'یی'); $letters[4][1] = array('um', 'aam', 'im', 'uy', 'aay', 'i'); $letters[5][0] = array('ج', 'چ', 'ح', 'خ', 'ع', 'غ'); $letters[5][1] = array('j', 'ch', 'h', 'kh', '`', 'gh'); $letters[6][0] = array('اوه', 'آه', 'ایه', 'هه'); $letters[6][1] = array('uh', 'aah', 'ih', 'hh'); $letters[7][0] = array('اوط', 'آط', 'ایط', 'اوظ', 'آظ', 'ایظ'); $letters[7][1] = array('ut', 'aat', 'it', 'uz', 'aaz', 'iz'); if (isset($_POST['check'])) { $data = $_POST['data']; $newdata = explode(":", base64_decode($data)); $correct_answer = $newdata[0]; $letter_index = $newdata[1]; $vowel = $newdata[2]; $answers = explode(",", $newdata[3]); } else { srand((float)microtime() * 1000000); $answers = range(0, count($letters[$t][0])-1); shuffle($answers); $cnt = count($letters[$t][0])-1; $vowel = rand(0, 2); if ($t==6) { do { $correct_answer = rand(0, 3); // correct answer out of 4 } while ($answers[$correct_answer]==3); // 3 - is incorrect } elseif ($t==4 || $t==7) { $correct_answer = rand(0, 3); // correct answer out of 4 } else { // remove homonyms for ($i=1; $i<=$cnt; $i++) { for ($j=0; $j<$i; $j++) { if ($letters[$t][1][$answers[$i]]==$letters[$t][1][$answers[$j]]) { for ($k=$i; $k<$cnt; $k++) { $answers[$k] = $answers[$k+1]; } unset($answers[$cnt]); $cnt--; } } } do { $correct_answer = rand(0, 3); // correct answer out of 4 } while ($letters[0][1][$vowel].$letters[$t][1][$answers[$correct_answer]]=='uv'); } $letter_index = $answers[$correct_answer]; // index of the correct letter $data = "$correct_answer:$letter_index:$vowel:".implode(",", $answers); $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 a consonant from Group $t preceded by a long vowel and then select the same combination in Perso-Arabic script from the choices given."; ?>

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

"; ?>


Back to the Persian Alphabet Tests