'من', 'تو', 'او', 'ما', 'شما', 'آنها'); else $persons = array(1 => 'man', 'to', 'u', 'mā', 'shomā', 'ānhā'); $question = $persons[$person]." ______."; // if ($person==3) $question .= eng3sgVerb($verb); // else $question .= $verb; // $question .= ". ".$persons[$q_person]." ______."; return $question; } function eng3sgVerb($verb) { $words = explode(' ', $verb); // if there is a preposition after the verb $vowels = 'aeiou'; $len = strlen($words[0]); if ($words[0]=='be') $verbform = 'is'; elseif (substr($words[0], $len-1)=='y') { if (strpos($vowels, substr($words[0], $len-2, 1)>-1)) { $verbform = substr($words[0], 0, $len-1)."ies"; // deny -> denies } } if (empty($verbform)) $verbform = $words[0]."s"; if (count($words)>1) { // if there is a preposition after the verb for ($i=1; $i'."The verb $verb is not found"); if ($isPersScript) { $randomVerb = $row['pers']; $presStem = $row['pers_pres']; } else { $randomVerb = $row['trans']; $presStem = $row['trans_pres']; } $presStemTrans = $row['trans_pres']; $engVerb = $row['eng']; $engVerbs = explode(',', $engVerb); $engVerb = trim($engVerbs[array_rand($engVerbs)]); // Select one verb if there are synonyms //Make a list of answers - person numbers $persons = range(1, 6); shuffle($persons); $answers = array(); $questions = array(); for ($i=0; $i<6; $i++) { $temp = range(1, 6); $answer = $persons[$i]; unset($temp[$answer-1]); //Select 2 among all persons but one in question // if ($answer==2) unset($temp[5-1]); //Show only one 'you'-form: singular // if ($answer==5) unset($temp[2-1]); // or plural $ar_ind = array_rand($temp, 2); $temp = array($temp[$ar_ind[0]], $temp[$ar_ind[1]], $persons[$i]); shuffle($temp); //Shuffle 3 answers array_push($questions, $temp); for ($j=0; $j<3; $j++) { if ($questions[$i][$j]==$persons[$i]) { array_push($answers, $j); //Remember the number of the correct answer break; } } } $data = $randomVerb.":".$engVerb.":".$verb.":".implode(",", $persons).":"; for ($i=0; $i<6; $i++) $data .= implode(",", $questions[$i]).";"; $data .= ":".implode(",", $answers); $data = str_replace(",;", ";", $data); $data = str_replace(";:", ":", $data); $data = base64_encode($data); } $pastStem = substr($randomVerb, 0, strlen($randomVerb)-2); if ($isPersScript) print ""; else print ""; ?> Present Indicative Test \n

Tenses

\n"; print "

You have answered all questions correctly. Try to conjugate another verb.\n"; exit("

Back to the Persian Tests"); } print "\n"; } else { print "\n"; } ?>

Tenses

Please conjugate the verb "to " in the Present Indicative according to the pronoun:

"> ".GetQuestion($persons[$i-1]); print ""; print ""; print "
".Conjugate($pastStem, $presStem, $presStemTrans, 7, $questions[$i-1][0])."
".Conjugate($pastStem, $presStem, $presStemTrans, 7, $questions[$i-1][1])."
".Conjugate($pastStem, $presStem, $presStemTrans, 7, $questions[$i-1][2])."
"; } print "

"; ?>


Persian Verb Conjugator

Back to the Persian Tests