'; include("vars.php"); mb_http_output("UTF-8"); $link = mysql_connect("localhost", $login, $pass) or die("Could not connect: " . mysql_error());//mysql.laits.utexas.edu mysql_select_db($db) or die("Could not select database"); if (!isset($_GET['id'])) { ?> Persian Tests

Tests Contents

Tests to Practice Joining and Disjoining Persian Letters

Based on the 7 groups of Windfuhr

Tests for Disjoining Frequently Occurring Shapes (Training the Retina to See Multi-Level Blocks)

Tests for Disjoining Frequently Occurring Shapes (Handwriting)

Alphabet Tests with Audio to Learn Pronunciation

Word Derivation Tests

Tests for Telling the Time with audio, no knowledge of Persian script required

Math Tests

Info on Persian and Arabic Numbers

Writing Conventions Tests - Written and Spoken Styles some postmodern examples with audio

Stress and Intonation in the Present Perfect and Simple Past Tenses (Spoken Style)

Stress in words ending in -e

Verb Conjugation Tests

Return to the list of verbs

$cat[1]

\n"; if ($cat[0]==2 || $cat[0]==3) { print "

Return to the movie

"; } } if ($r = mysql_query("SELECT tests.id, name, COUNT(test_id), num, category FROM tests LEFT JOIN test_items ON tests.id = test_items.test_id WHERE (category IS NULL OR category=0) GROUP BY tests.id ORDER BY num")) { if ($row = mysql_fetch_row($r)) { print "

Other Tests

\n\n"; } } ?>

Back to Courses

Redirected from Persian in Texas

'; } else { print ''; } ?> <? print "[".$test."] ".$title ?> "; if (!empty($row_cat[3])) $bookcover = "$bookcover"; if (!empty($caption)) $bookcover .= "

$caption"; if (!empty($links)) $bookcover .= "

".html_entity_decode($links); $bookcover = "

$bookcover
"; //---------------------------------------------- // E-mail the results to the instructor //---------------------------------------------- if (isset($_POST['sendinfo'])) { $stname = htmlspecialchars($_POST['stname']); $email = htmlspecialchars($_POST['email']); $mailtext = "

This is the letter from the Lesson $test Test page.

{$_POST['stname']} from {$_POST['univer']} has successfully answered all the questions of this test!

His/her e-mail is {$_POST['email']}"; if ($_POST['univer']=='University of Texas at Austin') { $sql = "INSERT INTO test_results (`date`, `name`, `email`, `test_id`, `grade`, `comment`) VALUES ('".date('Y-m-d H:i:s')."', '$stname', '$email', $id, 'A', '');"; mysql_query($sql); } if (!empty($openEnded)) { if ($_POST['univer']=='University of Texas at Austin') { // $sql = "INSERT INTO test_results (`date`, `name`, `email`, `test_id`, `grade`, `comment`) // VALUES ('".date('Y-m-d H:i:s')."', '$stname', '$email', $id, 'N', '');"; // mysql_query($sql); // $mark_id = mysql_insert_id(); $openEnded = explode("::", $openEnded); $sql = "SELECT * FROM $table WHERE test_id=$id ORDER BY seq"; $rc = mysql_query($sql); $mailtext .= "

You have to check the following open-ended answers:\n\n"; for ($i=0; $i"; $mailtext .= "".$answer[1]."\n\n"; } // $mailtext .= "

Grade the student: http://".$_SERVER["SERVER_NAME"]."/persian/grade/editgrade.php?id=$mark_id\n\n"; } } $mailtext .= "

Best regards,
Persian Test System
{$_SERVER['HTTP_REFERER']}"; $uri = $_SERVER['HTTP_REFERER']; $header = "From: {$_POST['email']}\n" ."MIME-Version: 1.0\n" ."Content-Type: text/plain; charset=\"windows-1252\"\n" ."Content-Transfer-Encoding: 7bit\n"; if ($_POST['univer']=='University of Michigan') { $mb = 0; $mailto = "aghaeib@umich.edu"; } elseif ($_POST['univer']=='South Orange County Community College District') { $mb = 1; $mailto = "monird@cox.net"; } elseif ($_POST['univer']=='UT Informal Class') { $mb = 2; $mailto = "blake.atwood@gmail.com"; } else { $mb = 3; $mailto = "connieb@gmail.com"; } $subject = "Lesson $test"; $uri = base64_encode($uri); $error = "Sorry. This service is unavailable right now. Try to send a e-mail later."; /* $PostData = "mb=$mb&sbj=$subject&stname=$stname&email=$email&uri=$uri"; $len = strlen($PostData); $fp = fsockopen("students.washington.edu", 80, $errno, $errstr, 30); if ($fp) { fputs($fp, "POST /irina/tests/emailer.php HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;.NET CLR 1.1.4322; .NET CLR 2.0.50215) Host: students.washington.edu Connection: close Content-Type: application/x-www-form-urlencoded Content-Length: $len $PostData"); $page = ""; while (!feof($fp)) $page .= fgets($fp, 128); fclose($fp); if (substr($page, strlen($page)-6)=="SENDOK") { $sent = true; $error = ""; } // echo ""; } */ // header("Location: http://students.washington.edu/irina/tests/emailer.php?mb=$mb&sbj=$subject&stname=$stname&email=$email&uri=$uri"); // exit(); $sent = mail($mailto, "Persian Test System - Lesson $test", $mailtext, $header); exit("

".($sent?"Your results have successfully been sent to your Instructor!":$error)."

Back to the Persian Tests "); } //---------------------------------------------- // Checking the answers //---------------------------------------------- //$answers = '3121322112332223121123131212322131233'; //$total = strlen($answers); $user_answers = ''; $correct_answers = ''; $correct = 0; $skipped = 0; $part = 0; $openEndedCount = 0; if (isset($_POST['check'])) { if ($_POST['skipped']==1) { $skipped = 1; } $newOpenEnded = ""; $part = intval($_POST['part']); if ($part==ceil(($total-10)/10)) $end = $total; else $end = $part*10+10; for ($i=1+$part*10; $i<=$end; $i++) { // multi-choice if ($type==0) { $answer = intval(substr($answers, $i-1, 1)); if (isset($_POST['R'.$i])) { if (intval($_POST['R'.$i])==$answer) { $correct++; $user_answers .= $answer; $correct_answers .= '1'; } else { $user_answers .= $_POST['R'.$i]; $correct_answers .= '0'; } } else { $user_answers .= '0'; $correct_answers .= '0'; } // type an answer } else { $allanswers = str_replace("\r", "", $answers_ar[$i-1]); $allanswers = explode("\n", $allanswers); if (isset($_POST['a'.$i])) { $user_answers .= $_POST['a'.$i]."::"; if ($sendanswer[$i-1]) { $openEndedCount++; $newOpenEnded .= "$i;;".$_POST['a'.$i]."::"; $correct++; $correct_answers .= '2'; } else { $match = false; foreach ($allanswers as $answer) { if ($_POST['a'.$i]==$answer) { $correct++; $correct_answers .= '1'; $match = true; break; } } if (!$match) { $correct_answers .= '0'; } } } else { $user_answers .= '::'; $correct_answers .= '0'; } } } if (!empty($newOpenEnded)) { $newOpenEnded = substr($newOpenEnded, 0, strlen($newOpenEnded)-2); } if ($type==1) { $user_answers = substr($user_answers, 0, strlen($user_answers)-2); $user_answers = str_replace("\n", '\n', $user_answers); $user_answers = str_replace("\r", '', $user_answers); } $answcount = $end-$part*10;//strlen($answers); if ($answcount==$correct) { print "\n$bookcover

$title

\n"; $part++; if ($part==ceil($total/10) && $skipped==0) { if (!empty($newOpenEnded)) { if (!empty($openEnded)) $openEnded .= "::"; $openEnded .= $newOpenEnded; } print "

You have answered all $total questions correctly. Fill the form and click the button to send the results to your instructor:

\n"; ?>

Your name:
Your e-mail:
Your University:

Instructors, if you would like to have your students get credit for taking any of these tests, please send an email to webmaster@persianintexas.org indicating which test(s) and the email address(s) to which you would like your students' results sent.

Back to the Persian Tests Some questions were skipped. Go to the list of tests."); } else { print "

You have completed $end out of $total, ".($total-$end)." left to go.

"; } } else { if ($part==0) { $start = 0; } else { $start = $part*10; } ?> \n$bookcover

$title

You have answered $correct questions of $answcount correctly. Try again."; } } else { print "\n$bookcover

$title

There are $total questions in this test."; if (isset($_POST['skip'])) { $skipped = 1; $part = intval($_POST['part']); if ($part==ceil(($total-10)/10)) $end = $total; else $end = $part*10+10; $part++; print " ".($total-$end)." left to go.

"; } else { if ($total>10) { print " Answer the first 10:"; } } } ?>

0) { if ($part==0) { $start = 0; } else { $start = $part*10; } if (mysql_data_seek($r, $start)) { for ($i=$start+1; $i<=$start+10; $i++) { if ($row = mysql_fetch_assoc($r)) { print "

".($dir?$row['seq']:PersNumber($row['seq'])).". ".$row['question']; if ($type==0) { print ""; print ""; print "
".$row['answer1']."
".$row['answer2']."
".$row['answer3']."
"; } else { if ($sendanswer[$i-1]) { print "
"; if ($openEndedCount==0) $openEndedCount++; print " open-ended question"; } else { print "
"; } print " "; } print "

"; } } print "

"; if ($type==1) print " "; if ($total-$start>10) { print " "; } print "

"; } } ?>


Back to the Persian Tests