(count($modal_verbs)-1) || $modalTest<1) $modalTest = -1; $title = "Modal Verbs Test (impersonal ".($modalTest==-1?"modal verbs":"modal verb \"".$modal_verbs[$modalTest][3]."\"").", ".($isSpoken?"spoken":"written")." style, ".($isPersScript?"Persian script":"transcription").")"; $bodyParams = ($isSpoken?'text="#FFFFFF" bgcolor="#808080"':'text="#000000" bgcolor="#CC99FF"'); function GetQuestion($person, $negative, $verb) { global $isPersScript; $persons = array(1 => 'I', 'You', 'He/she/it', 'We', 'You', 'They'); $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') $question = 'It '; else $question = 'One '; 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') $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, 6, 7))) { $persons[$j] = $persons[$answer]; } if (in_array($qtypes[$j], array(1, 2, 3, 4))) { $mpersons[$j] = $mpersons[$answer]; } elseif ($qtypes[$j]==5) { if ($modals[$j]==1) $mpersons[$j] = 0; else $mpersons[$j] = 3; } if ($modals[$j]==2) { $mpersons[$j] = 3; } // 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; // } switch ($qtypes[$j]) { case 1: // correct answer case 2: // wrong person case 5: // wrong modal verb case 6: // wrong modal verb and person $tenses[] = 1; $mtenses[] = 7; break; case 3: case 4: do { if (count($wrong_tenses)==0) { $tense = 1; break; } else $tense = array_shift($wrong_tenses); } while (Conjugate(substr($randomVerb, 0, strlen($randomVerb)-2), $presStem, $presStemTrans, $tense, $persons[$j])==""); $tenses[] = $tense; $mtenses[] = 7; break; case 7: $cnt = 0; do { $cnt++; if ($cnt>7) { $tense = 1; break; } else $tense = array_shift($mwrong_tenses); if (Conjugate($modal_verbs[$modals[$j]][0], $modal_verbs[$modals[$j]][1], $modal_verbs[$modals[$j]][2], $tense, $mpersons[$j])=="") { array_unshift($mwrong_tenses, $tense); } else break; } while (true); $mtenses[] = $tense; $tenses[] = 1; break; } } $data = "$verb_id:$engVerb:".implode(",", $modals).":$answer:".implode(",", $persons).":".implode(",", $mpersons).":".implode(",", $tenses).":".implode(",", $mtenses).":".implode(",", $qtypes).":".implode(",", $neg); $data = base64_encode($data); } $pastStem = substr($randomVerb, 0, strlen($randomVerb)-2); ?> .css"> \n

$title

\n"; print "



You have answered the question correctly.


Try another question.


Back to the Persian Verb Conjugator
\n"; if ($id) print "Basic Verb Conjugation Tests
"; exit("Back to the Persian Tests

"); } print "\n"; } 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)."-".($modal==2?3:$mpersons[$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); $url = urlencode("/persian/tests/tempsnd/$mp3file.mp3"); $audiobtn = "

"; } } else { $url = urlencode("/persian/tests/tempsnd/$mp3file.mp3"); $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]?neg($mtenses[$j-1]):$mtenses[$j-1]), ($modals[$j-1]==2?3:$mpersons[$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