0) { $_SESSION['Teacher'] = $TeacherT2; $_SESSION['AcctApwd'] = $TeacherApwdT2; $_SESSION['TeacherID'] = $TeacherID; $Teacher = $TeacherT2; $TeacherPwd = $TeacherApwdT2; } } } else $TeacherID = 0; ?> MathDrill - an interactive site for Math Problems 0) print("\n"); else print("\n"); if (isset($ProbGroup)) { // Called as a POST for AddHomework if ($TeacherID > 0) { $CatID = 1; $LevID = db_getVal("MathLevels", "Level", "Label", $Level); $query = "INSERT INTO HomeworkGiven VALUES(NULL, '$TeacherID', '$Upass', "; $query .= "'$Grade', '$CatID', '$LevID', '$NumProbs', '$DueDate', '$Stype')"; // print("Adding Homework: query = [$query]
\n"); $result = MYSQL_QUERY($query); $error = MYSQL_ERROR(); if ($error != "") { print("Could not add homework. The system administrator has been informed. Sorry For the inconvience

\n"); sub_suggestion('Teacher AddHW failed', $query, '1'); sub_suggestion('Teacher AddHW failed', $error, '2'); } } } if (isset($delHwork)) { // Called as a POST for DelHomework if ($TeacherID > 0) { foreach($_POST as $key => $val) { // All post vars except for "delHwork" are delete keys if (strcmp($key, "delHwork") != 0) { $query = "DELETE FROM HomeworkGiven WHERE HworkGivenId = '$val'"; $result = MYSQL_QUERY($query); $error = MYSQL_ERROR(); if ($error != "") { print("Could not delete Hwork#$val. The system administrator has been informed. Sorry For the inconvience

\n"); print("
Error code : $error
"); } } } } } ?> 0) print("\n"); ?>
MathDrill Home       Teacher : $Teacher
0, "home-login.php", "", "Login as different teacher"); if ($TeacherID > 0) { $numcols += 1; insertTab("images/teacher.gif", 1, "Teacher.php", "", "Assign homework or View submissions"); } insertTab("images/how-works.gif", 1, "how-prob-works.php", "", "Find out how everything works"); insertTab("images/suggest.gif", 1, "suggest.php", "", "Make Comments or Suggestions"); if ($TeacherID > 0) { if ($Teacher == 'guest') { // Logged in as guest ?> 0) print(""); else print(""); print("\n"); ?>
Home Page Signup!     Logout   
\"\"
0) { if ($regCode == 0) { print("Account $TeacherT created! "); print("You can now start setting and viewing homeworks in this web site!
\n"); } if ($Teacher == 'guest') { // Logged in as guest ?> (Since you didn't log in as teacher, we have logged you in as guest. Any homework you set as guest will be grouped with other homeworks set by other teachers logging in as guest! Create your private set of homeworks by signing up for free.)
Assign New Homework
Grade       
Show fewer levels
(only those related to)
  
NumProbs    Level#   
Password    Acceptance Policy   
DueDate   
\n"); ?> Assign Homework

Assigned Homeworks
(Click on a Hwork # to view graded submissions for that homework.)

No recent activity to report.
\n"); elseif ($number > 0) { print(""); print("\n"); print("\n"); $today = date("Y-m-d"); while ($i < $number) { $HworkId = mysql_result($result,$i,"HworkGivenId"); $Grade = mysql_result($result,$i,"Grade"); $Label = mysql_result($result,$i,"Label"); $NumProbs = mysql_result($result,$i,"NumProbs"); $DueDate = mysql_result($result,$i,"DueDate"); list($year, $month, $day) = explode('-', $DueDate); $Sname = mysql_result($result,$i,"Sname"); if ($DueDate >= $today) print("\n"); else print("\n"); print("\n"); $i++; } ?>
Hwork# Grade Level # problems Due Date Acceptance Policy \n"); print("
\n"); print(" $HworkId \n"); print(" $Grade $Label $NumProbs $month/$day/$year $Sname \n"); print("

\n"); ?> Delete Selected Homeworks
Select all homeworks    
\n"); include ("lang-bottom-links.php"); include ("bottom-links.php"); ShowBottomLinks("1", $sidSfx, $MainApp, $TeaLogout, $BRW, $lang); } else { // No or incorrect account info in cookies. Show login form if ($regCode == 1) { print("Sorry, Could not create Account $TeacherT. "); print("The system administrator has been informed. Sorry For the inconvience
\n"); print("Error code : $error
\n"); print("

\n"); } elseif ($regCode == 2) { print("Sorry, Account $TeacherT already exists!! "); $newAcctName = db_suggestNewAcct($TeacherT, "Teacher"); print("Try another Account name [$newAcctName]\n"); print("

\n"); include ("reg-utils.php"); ShowTeaRegForm($newAcctName, $TeacherFnameT, $TeacherLnameT, $TeacherEmailT, $TeacherRefT, $sidSfx, $MainApp, $TeaApp); } else { include ("login_utils.php"); ShowLoginForm(0, 1, $lang); } } ?>