"خودم", "خودت", "خودش", "خودمون", "خودتون", "خودشون"); } else { $modal_verbs = array(array("خواست", "خواه", "khāh", "want", 123), array("توانست", "توان", "tavān", "be able", 163), array("بایست", "بای", "bāy", "must", 99), array("شد", "شو", "shaw", "be possible for", 48), array("گذاشت", "گذار", "gozār", "let, allow", 117)); $khod_ar = array(1 => "خودم", "خودت", "خودش", "خودمان", "خودتان", "خودشان"); } } else { if ($isSpoken) { $modal_verbs = array(array("khāst", "khā", "khā", "want", 324), array("tunest", "tun", "tun", "be able", 323), array("bāyest", "bāy", "bāy", "must", 414), array("shod", "sh", "sh", "be possible for", 315), array("gozāsht", "gzār", "gzār", "let, allow", 320)); $khod_ar = array(1 => "khodam", "khodet", "khodesh", "khodemun", "khodetun", "khodeshun"); } else { $modal_verbs = array(array("khāst", "khāh", "khāh", "want", 123), array("tavānest", "tavān", "tavān", "be able", 163), array("bāyest", "bāy", "bāy", "must", 99), array("shod", "shaw", "shaw", "be possible for", 48), array("gozāsht", "gozār", "gozār", "let, allow", 117)); $khod_ar = array(1 => "khodam", "khodat", "khodash", "khodemān", "khodetān", "khodeshān"); } } $modalTest = -1; if (isset($_GET['modal'])) { $modalTest = intval($_GET['modal']); } if ($modalTest>(count($modal_verbs)-1) || $modalTest<0) $modalTest = -1; $title = "Modal Verbs Test (personal ".($modalTest==-1?"modal verbs":($modalTest==4?"pseudo-":"")."modal verb \"".$modal_verbs[$modalTest][3]."\"").", 1 agent, ".($isSpoken?"spoken":"written")." style, ".($isPersScript?"Persian script":"transcription").", Present Indicative)"; $bodyParams = ($isSpoken?'text="#FFFFFF" bgcolor="#808080"':'text="#000000" bgcolor="#CC99FF"'); function GetQuestion($person, $negative, $verb, $self=0) { global $isPersScript; $persons = array(1 => 'I', 'You', 'He/she/it', 'We', 'You', 'They'); if ($self) $persons2 = array(1 => 'myself', 'yourself', 'him/her/itself', 'ourselves', 'yourselves', 'themselves'); else $persons2 = array(1 => 'me', 'you', 'him/her/it', 'us', 'you', 'them'); $be = array(1 => 'am', 'are', 'is', 'are', 'are', 'are'); $verb = str_replace(",", "", $verb); $words = explode(' ', $verb); // if there is a preposition after the verb if ($verb=='be possible for') $question = 'It '; else $question = $persons[$person].' '; if ($negative) { if ($words[0]=='be') { if ($verb=='be possible for') $question .= $be[3] . " not"; else $question .= $be[$person] . " not"; } elseif ($words[0]=='must') { $question .= $words[0] . " not"; } else { if ($person==3) $question .= "does not $words[0]"; else $question .= "do not $words[0]"; if ($words[0]=='let') { $question .= ', '.array_pop($words); } } } else { if ($words[0]=='be') { if ($verb=='be possible for') $question .= $be[3]; else $question .= $be[$person]; } else { if ($person==3 && $words[0]!='must') $question .= eng3sgVerb($words[0]); else $question .= $words[0]; if ($words[0]=='let') { $question .= ', '; $verb2 = array_pop($words); if ($person==3) $question .= eng3sgVerb($verb2); else $question .= $verb2; } } } for ($i=1; $i321".($id?"":" AND (e1.hassnd=1 OR e1.hassndtest=1)")." AND e2.style=0".($id?" AND e1.id=$id":" ORDER BY RAND()").";"); else $r = mysql_query("SELECT * FROM pvc_verbs WHERE id<>26 AND isnew=0 AND level=1 AND style=0".($id?"":" AND (hassnd=1 OR hassndtest=1)")." AND translation IS NOT NULL".($id?" AND id=$id":" ORDER BY RAND()").";"); $row = mysql_fetch_assoc($r); if ($row===false) exit("The verb is not found"); $verb_id = $row['id']; if ($isPersScript) { $randomVerb = $row['pers_inf']; $presStem = $row['pers_presstem']; } else { $randomVerb = $row['trans_inf']; $presStem = $row['trans_presstem']; } $presStemTrans = $row['trans_presstem']; $engVerb = $row['translation']; $engVerbs = explode(',', $engVerb); $engVerb = $engVerbs[0]; if (substr($engVerb, 0, 3)=='to ') $engVerb = substr($engVerb, 3); // $tags = explode(',', $row['tags']); // if (!empty($row['tags'])) { // for ($i=0; $i4) { $modals[] = $modal_ar[rand(0, count($modal_ar)-1)]; } else { $modals[] = $modal; } if (in_array($qtypes[$j], array(3, 5, 7))) { $persons[$j] = $persons[$answer]; } // only one YOU should be among answers if ($qtypes[$j]==2) { if ($persons[$answer]==2 && $persons[$j]==5) { $persons[$j] = array_pop($persons); } if ($persons[$answer]==5 && $persons[$j]==2) { $persons[$j] = array_pop($persons); } } // if ($modals[$j]==2) { // $persons[$j] = 3; // $tenses[$j] = $neg[$j] ? 17 : 7; // } } $data = "$verb_id:$engVerb:".implode(",", $modals).":$answer:".implode(",", $persons).":".implode(",", $tenses).":".implode(",", $qtypes).":".implode(",", $neg); $data = base64_encode($data); } $pastStem = substr($randomVerb, 0, strlen($randomVerb)-2); ?> .css"> \n

$title

\n"; if ($modalTest==4 && $khod==0) { $person = $persons[$answer]; $neg = $neg[$answer]; $persons = range(1, 6); array_splice($persons, $person-1, 1); shuffle($persons); array_splice($persons, 2); $persons[] = $person; shuffle($persons); $answer = array_search($person, $persons); $data = "$verb_id:$engVerb:$answer:$neg:".implode(",", $persons); $data = base64_encode($data); } else { print "



You have answered the question correctly."; if ($khod==1) { print "

".Conjugate($modal_verbs[4][0], $modal_verbs[4][1], $modal_verbs[4][2], ($neg==1?17:7), $persons[$answer])." ".$khod_ar[$persons[$answer]]." ".Conjugate($pastStem, $presStem, $presStemTrans, 9, $persons[$answer]); print "

means"; print "

".GetQuestion($persons[$answer], $neg, 'let, allow', 1)." $engVerb."; $modalsnd = $modal_verbs[4][4]."-".($neg==1?17:7)."-".$persons[$answer]; if ($r = mysql_query("SELECT snd_file FROM pvcsound WHERE homophone=\"$modalsnd\"")) { if ($homophone = mysql_fetch_row($r)) { $modalsnd = trim($homophone[0]); } } $verbsnd = $verb_id."-9-".$persons[$answer]; if ($r = mysql_query("SELECT snd_file FROM pvcsound WHERE homophone=\"$verbsnd\"")) { if ($homophone = mysql_fetch_row($r)) { $verbsnd = trim($homophone[0]); } } $khodsnd = "khod-".$persons[$answer]; if ($isSpoken) $khodsnd .= "s"; $audiobtn = ""; if (file_exists("../pvc/snd/$verbsnd.mp3") && file_exists("../pvc/snd/$modalsnd.mp3") && file_exists("../pvc/snd/$khodsnd.mp3")) { $mp3file = $modalsnd."-s-$khodsnd-".$verbsnd; if (!file_exists("tempsnd/$mp3file.mp3")) { $f1c = file_get_contents("../pvc/snd/$modalsnd.mp3"); $f2c = file_get_contents("../pvc/snd/s.mp3"); $f3c = file_get_contents("../pvc/snd/$verbsnd.mp3"); $f4c = file_get_contents("../pvc/snd/$khodsnd.mp3"); if ($f1c!==false && $f2c!==false && $f3c!==false && $f4c!==false) { file_put_contents("tempsnd/$mp3file.mp3", $f1c.$f2c.$f4c.$f3c); $audiobtn = "

"; } } else { $audiobtn = "

"; } } print "

$audiobtn"; } print "


Try another question.


Back to the Persian Verb Conjugator
\n"; } if ($khod==1 || $modalTest!=4) { if ($id) print "Basic Verb Conjugation Tests
"; exit("Back to the Persian Tests"); } } else { print "\n"; } if ($khod==1) { print "

$title

\n"; } if ($answcount==$correct || $khod==1) { print "



The sentence you have just created is perfectly correct but please add the appropriate form of \""; print $trans ? "khod" : "خود"; print "\" (self) in the blank to make it sound more natural."; print "

".Conjugate($modal_verbs[4][0], $modal_verbs[4][1], $modal_verbs[4][2], ($neg==1?17:7), $persons[$answer])." _____ ".Conjugate($pastStem, $presStem, $presStemTrans, 9, $persons[$answer]); print "\n

"; $style = $isPersScript ? "pers" : "trans"; for ($i=1; $i<=1; $i++) { print ""; for ($j=1; $j<=3; $j++) { print ""; } print "
".$khod_ar[$persons[$j-1]]."
"; // print "$modal_verb ".Conjugate($pastStem, $presStem, $presStemTrans, $tenses[1], $persons[1]).""; // print "$modal_verb ".Conjugate($pastStem, $presStem, $presStemTrans, $tenses[2], $persons[2]).""; // print "$modal_verb ".Conjugate($pastStem, $presStem, $presStemTrans, $tenses[3], $persons[3]).""; } print "



"; if ($id) print "Basic Verb Conjugation Tests
"; exit("Back to the Persian Tests
"); } } else { print "\n"; } ?>

Please translate to Persian:

".GetQuestion($persons[$answer], $neg[$answer], $modal_verbs[$modal][3])." $engVerb."; $modalsnd = $modal_verbs[$modal][4]."-".($neg[$answer]==1?17:7)."-".(in_array($modal, array(2, 3))?3:$persons[$answer]); if ($r = mysql_query("SELECT snd_file FROM pvcsound WHERE homophone=\"$modalsnd\"")) { if ($homophone = mysql_fetch_row($r)) { $modalsnd = trim($homophone[0]); } } $verbsnd = $verb_id."-".$tenses[$answer]."-".$persons[$answer]; if ($r = mysql_query("SELECT snd_file FROM pvcsound WHERE homophone=\"$verbsnd\"")) { if ($homophone = mysql_fetch_row($r)) { $verbsnd = trim($homophone[0]); } } $audiobtn = ""; if (file_exists("../pvc/snd/$verbsnd.mp3") && file_exists("../pvc/snd/$modalsnd.mp3")) { $mp3file = $modalsnd."-s-".$verbsnd; if (!file_exists("tempsnd/$mp3file.mp3")) { $f1c = file_get_contents("../pvc/snd/$modalsnd.mp3"); $f2c = file_get_contents("../pvc/snd/s.mp3"); $f3c = file_get_contents("../pvc/snd/$verbsnd.mp3"); if ($f1c!==false && $f2c!==false && $f3c!==false) { file_put_contents("tempsnd/$mp3file.mp3", $f1c.$f2c.$f3c); $audiobtn = "

"; } } else { $audiobtn = "

"; } } print "$audiobtn"; for ($j=1; $j<=4; $j++) { $modal_verb = Conjugate($modal_verbs[$modals[$j-1]][0], $modal_verbs[$modals[$j-1]][1], $modal_verbs[$modals[$j-1]][2], ($neg[$j-1]==1?17:7), (in_array($modals[$j-1], array(2, 3))?3:$persons[$j-1])); print ""; } print "
$modal_verb ".Conjugate($pastStem, $presStem, $presStemTrans, $tenses[$j-1], $persons[$j-1])."
"; // print "$modal_verb ".Conjugate($pastStem, $presStem, $presStemTrans, $tenses[1], $persons[1]).""; // print "$modal_verb ".Conjugate($pastStem, $presStem, $presStemTrans, $tenses[2], $persons[2]).""; // print "$modal_verb ".Conjugate($pastStem, $presStem, $presStemTrans, $tenses[3], $persons[3]).""; } print "

"; ?>

Back to the Persian Verb Conjugator Basic Verb Conjugation Tests"; ?>

Back to the Persian Tests