"; $sql = mysql_query("select quizname from currentquizzes where id = '$id'"); $row = mysql_fetch_row($sql); $name = $row[0]; $submit = $_POST['submit']; $poss = $name."_poss"; $real = $name."_answers"; $newsql = mysql_query("select * from $name"); $fields = mysql_num_fields($newsql); $row = mysql_fetch_row($newsql); for ($i = 1; $i<$fields; $i++) { echo "
$row[$i]?

"; $answer = "select possanswers from $poss where question = '$i'"; $answer = mysql_query($answer); if (!$answer) echo mysql_error(); $newrow = mysql_fetch_array($answer); $newrow = $newrow[0]; $realanswer = "answer".$i; $thirdsql = mysql_query("select $realanswer from $real"); $thirdrow = mysql_fetch_array($thirdsql); $realanswer = $thirdrow[0]; $string = $newrow."|".$realanswer; $strarray = explode("|",$string); shuffle($strarray); for ($j = 1;$j < 5; $j++) { $num = $j - 1; echo " $strarray[$num]
"; } } echo ""; echo "
"; //loop with all possibilities exit(); } // $numberfields = count($row); //$num = $numberfields/2 - 1; $teacher = $_GET['teacher']; if ($teacher != "") { echo "

Choose a quiz to complete:

"; $sql = mysql_query("select * from currentquizzes where teacherid = '$teacher'"); while ($row = mysql_fetch_array($sql)) { echo "$row[1]
"; } echo "
back to student page"; echo "

© 2007 Quiddle, Inc.
"; exit(); } $sql = mysql_query("select id, fullname from Quiz_users where position = 'teacher'"); ?> Select a teacher to view his/her quizzes
back to student page"; //} ///////////////////////styles the bottom of the page echo "

© 2007 Quiddle, Inc.
"; exit(); ///////////////////////end of styles ?>