7) $t = 1; $test_title = "Alphabet Test"; $letters = array(); $letters[0][0] = array('َ', 'ِ', 'ُ'); $letters[0][1] = array('a', 'e', 'o'); $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', 'q', 'n'); $letters[4][0] = array('مَم', 'مِم', 'مُم', 'مو', 'ما', 'می'); $letters[4][1] = array('mam', 'mem', 'mom', 'mu', 'maa', 'mi'); $letters[5][0] = array('ج', 'چ', 'ح', 'خ', 'ع', 'غ'); $letters[5][1] = array('j', 'ch', 'h', 'kh', '`', 'gh'); $letters[6][0] = array('هَه', 'هِه', 'هُه', 'هو', 'ها', 'هی'); $letters[6][1] = array('hah', 'heh', 'hoh', 'hu', 'haa', 'hi'); $letters[7][0] = array('طَط', 'طِط', 'طُط', 'ظَظ', 'ظِظ', 'ظُظ'); $letters[7][1] = array('tat', 'tet', 'tot', 'zaz', 'zez', 'zoz'); 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; if ($t==6 || $t==4) { do { $correct_answer = rand(0, 3); // correct answer out of 4 } while ($answers[$correct_answer]>=3); // only 0-3 are correct } elseif ($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--; } } } $correct_answer = rand(0, 3); // correct answer out of 4 } $letter_index = $answers[$correct_answer]; // index of the correct letter $vowel = rand(0, 2); $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 followed by a short vowel and the same consonant and then select the same combination in Perso-Arabic script from the choices given."; ?>

*/?>

[ ]

"; print ""; print ""; print ""; } print "

"; ?>


Back to the Persian Alphabet Tests