7 || $t<2) { $t = 2; } $fntClass = 'pers'; if (isset($_POST['fontclass'])) { $fntClass = $_POST['fontclass']; } //#################################### // Sending a letter to the instructor if (isset($_POST['sendinfo'])) { $stname = htmlspecialchars($_POST['stname']); $email = htmlspecialchars($_POST['email']); $trans = (isset($_GET['trans'])) ? 'transliterated' : ''; if ($_POST['univer']=='University of Texas at Austin') { include "vars.php"; $link = mysql_connect("localhost", $login, $pass) or die("Could not connect: " . mysql_error()); mysql_select_db($db) or die("Could not select database"); $sql = "INSERT INTO test_results (`date`, `name`, `email`, `othertest_id`, `grade`, `comment`) VALUES ('".date('Y-m-d H:i:s')."', '$stname', '$email', ".($t<7?$t+4:18).", 'A', '');"; mysql_query($sql); } $mailtext = "This is the letter from the Groups 1-$t Letters Disjoining Test page. {$_POST['stname']} from {$_POST['univer']} has successfully answered all the questions of this test! His/her e-mail is {$_POST['email']} 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 = "Groups 1-$t Letters Disjoining 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 - Groups 1-$t Letters Disjoining Test", $mailtext, $header); exit(" Combined Test for Disjoining Groups 1-$t Letters

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

Back to the Persian Tests "); } $letters_array = array(); // The "vaared" letters--letters that are always unconnected to the left $letters_array[1] = array('و', 'ا', 'ر', 'د', 'ز', 'ژ', 'ذ'); // vaav, alef, re, daal, ze, zhe, zaal // letters with a left-stretch in final position $letters_array[2] = array('ب', 'پ', 'ف', 'ت', 'ث', 'ک', 'گ'); // be, pe, fe, te, se, kaaf, gaaf // letters with a left-downward swing in final position $letters_array[3] = array('س', 'ش', 'ص', 'ض', 'ل', 'ق', 'ن'); // sin, shin, saad, zaad, laam, qaaf, nun // one letter with the simplest, one with the most elegant arbesque: $letters_array[4] = array('م', 'ی'); // mim, ye // letters with inward swing in final position $letters_array[5] = array('ج', 'چ', 'ح', 'خ', 'ع', 'غ'); // jim, che, he (hotti), khe, `ayn, ghayn // *he (havvaz)* $letters_array[6] = array('ه'); $letters_array[7] = array('ط', 'ظ'); $letters = array(); for ($i=1; $i<=$t; $i++) { $letters = array_merge($letters, $letters_array[$i]); } srand((float)microtime() * 1000000); $wrong = false; if (isset($_POST['data'])) { $data = $_POST['data']; $newdata = explode(";", base64_decode($data)); $qletters = explode(",", $newdata[0]); $textname = $newdata[1]; $counter = intval($_POST['counter']); for ($i=0; $i3) ? rand(2, 6) : rand(2, 4); for ($i=0; $i<$letterCount; $i++) $qletters[] = $letters[array_rand($letters, 1)]; $textname = ""; for ($i=0; $i Combined Test for Disjoining Groups 1- Letters $max) { print "

Combined Test for Disjoining Groups 1-$t Letters

\n"; print "

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

\n"; include("emailform.php"); exit(); } ?>

Combined Test for Disjoining Groups 1- Letters

Question out of

Please disjoin these 0 letters by typing them on your keyboard from right to left:

\n"; } ?>
Keyboard layout, unshifted




Back to the Persian Tests