(count($modal_verbs)-1) || $modalTest<0) $modalTest = -1; $title = "Modal Verbs Test (personal ".($modalTest==-1?"modal verbs":($modalTest==1?"pseudo-":"")."modal verb \"".$modal_verbs[$modalTest][3]."\"").", 2 agents, ".($isSpoken?"spoken":"written")." style, ".($isPersScript?"Persian script":"transcription").", Present Indicative)"; $bodyParams = ($isSpoken?'text="#FFFFFF" bgcolor="#808080"':'text="#000000" bgcolor="#CC99FF"'); function GetQuestion($person, $person2, $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 $question = $persons[$person].' '; if ($negative) { if ($words[0]=='be') { $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') { $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); // 1 - correct; 2 - wrong person; 3 - wrong tense, 4 - wrong tense and person, // 5 - wrong object person, 6 - wrong object person and tense $qtypes = range(2, 6); shuffle($qtypes); $qtypes = array_slice($qtypes, 0, 3); $qtypes[] = 1; shuffle($qtypes); $answer = array_search(1, $qtypes); //Make a list of answers - person numbers $persons = range(1, 6); shuffle($persons); $persons2 = range(1, 6); do { shuffle($persons2); } while ($persons[$answer]==$persons2[$answer]); if ($isSpoken) $wrong_tenses = array(1, 2, 5, 6); else $wrong_tenses = array(1, 2, 4, 5, 6, 8, 10); if ($presStemTrans!="dār") $wrong_tenses[] = 3; shuffle($wrong_tenses); $neg = array(0, 0, 0, 1, 1, 1); shuffle($neg); $tenses = array(); for ($j=0; $j<4; $j++) { switch ($qtypes[$j]) { case 1: // correct answer case 2: // wrong person case 5: // wrong object person if ($presStemTrans=="dār") $tenses[] = 3; else $tenses[] = 9; break; default: do { $tense = array_shift($wrong_tenses); } while (Conjugate(substr($randomVerb, 0, strlen($randomVerb)-2), $presStem, $presStemTrans, $tense, $persons[$j])==""); $tenses[] = $tense; // It is not wrong to have the perfect subjunctive. // It may be rare, but it is possible. // Make them wrongly positive or negative if ($tense==3 && $neg[$j]==$neg[$answer]) { $neg[$j] = abs($neg[$answer]-1); } break; } if (in_array($qtypes[$j], array(3, 5, 6))) { $persons[$j] = $persons[$answer]; } if (in_array($qtypes[$j], array(2, 3, 4))) { $persons2[$j] = $persons2[$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 ($qtypes[$j]==5) { if ($persons2[$answer]==2 && $persons2[$j]==5) { $persons2[$j] = array_pop($persons2); } if ($persons2[$answer]==5 && $persons2[$j]==2) { $persons2[$j] = array_pop($persons2); } } } if ($modalTest==-1) { $modal = rand(0, 1); } else { $modal = $modalTest; } $data = "$verb_id:$engVerb:".implode(",", $persons2).":$answer:".implode(",", $persons).":".implode(",", $tenses).":".implode(",", $qtypes).":".implode(",", $neg).":$modal"; $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], $persons2[$answer], $neg[$answer], $modal_verbs[$modal][3])." $engVerb."; $modalsnd = $modal_verbs[$modal][4]."-".($neg[$answer]==1?17:7)."-".($modal==2?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]."-".$persons2[$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[$modal][0], $modal_verbs[$modal][1], $modal_verbs[$modal][2], ($neg[$j-1]==1?17:7), $persons[$j-1]); print ""; } print "
$modal_verb ".Conjugate($pastStem, $presStem, $presStemTrans, $tenses[$j-1], $persons2[$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