0) { $_SESSION['AcctName'] = $AcctNameT2; $_SESSION['AcctApwd'] = $AcctApwdT2; $_SESSION['AcctID'] = $AcctID; $AcctName = $AcctNameT2; $AcctApwd = $AcctApwdT2; } } include ("MathApp_utils.php"); $DTAG = "DIV"; $DTAG2 = "DIV"; include ("upd-browser-stats.php"); update_user_stat($MacSF, $MacIE, $MacN6, $MacCh, $WinFF, $WinIE, $WinN6, $WinCh); $a_channel = A_PROB_PAGE; // Problem page $s_channel = S_PROB_PAGE; // Problem page if ($mode == 1) { $a_channel = A_PROGRESS; // Check progress $s_channel = S_PROGRESS; // Check progress } else if ($mode == 2) { $a_channel = A_FIND_HWORK; // Find Homework $s_channel = S_FIND_HWORK; // Find Homework } ?> MathDrill - an interactive site for Math Problems! 0) { if (isset($hwork)) $appmode = 1; else $appmode = 0; if (!isset($level)) $level = 0; print("\n"); // print("initNumCols($level);"); // print("moreProblems('$platform', '$AcctName', '$AcctApwd', '$level', '$access');"); } else { print("\n"); } ?>
0) { if ($mode == 0) { // Display applet for lessons ?>
  Mode : Practice\n"); print(" Homework\n"); ?> Help    \n"); print("Feedback  \n"); ?>
Sample Progress\n"); ?> Sample Progress\n"); ?>
Recent Activity Summary
\n"); include ("db_info.php"); /* make connection to database */ MYSQL_CONNECT($hostname, $username, $password) OR DIE("Unable to connect to MYSQL"); @mysql_select_db( "$dbName") or die( "Unable to select database"); $query = "SELECT UseDate, Label, NumProbs, NumRight, TimeSpent "; $query .= "FROM MathAcctVisits, MathLevels "; $query .= "WHERE AcctId = $AcctID AND MathLevels.Level = MathAcctVisits.Level "; $query .= "ORDER BY UseDate DESC LIMIT 100"; $result = MYSQL_QUERY($query); $number = MYSQL_NUMROWS($result); // Print these results to the screen in a nice format $numPts = 28; $numPts1 = $numPts - 1; if ($number == 0) print("

No recent activity to report.
\n"); elseif ($number > 0) { // Display progress chart if ($number > 15) print("

(Last 15 out of $number activities)

\n"); print(""); print("\n"); print("\n"); $numLbls = 0; for ($i = 0; $i < $number; $i++) { $UseDate = mysql_result($result,$i,"UseDate"); $UseDateY[$i] = strtok($UseDate, "-"); $UseDateM[$i] = strtok("-"); $UseDateD[$i] = strtok("-"); $Label[$i] = mysql_result($result,$i,"Label"); $NumProbs[$i] = mysql_result($result,$i,"NumProbs"); $NumRight[$i] = mysql_result($result,$i,"NumRight"); $TimeSpent[$i] = mysql_result($result,$i,"TimeSpent"); if ($i < 16) { // Show table of at most 15 rows print("\n"); print("\n"); } // Make charts for data from at most $numPts days from the latest entry $timeX[$i] = mktime(0,0,0, $UseDateM[$i], $UseDateD[$i], $UseDateY[$i]); $dateOff = ($timeX[0] - $timeX[$i]) / 86400; // 86400 = (3600*24) if ($dateOff < $numPts) { $match = 0; for ($j = 0; $j < $numLbls; $j++) { if (strcmp($Label[$i], $Labels[$j]) == 0) { $match = 1; break; } } if ($match == 0) $Labels[$numLbls++] = $Label[$i]; } } print("
Date Level # problems # correct Time Spent \n"); print("
$UseDateM[$i]/$UseDateD[$i]/$UseDateY[$i] $Label[$i] $NumProbs[$i] $NumRight[$i] $TimeSpent[$i] \n"); print("

\n"); print("There are $numLbls levels in the progress report ..
\n"); print("\n

\n"); } // Display progress chart print("\n"); // Form is unused in this mode } // elseif ($mode == 1) // Display activity summary elseif ($mode == 2) { // Display homework summary include ("db_info.php"); include ("submit-getpass.php"); /* make connection to database */ MYSQL_CONNECT($hostname, $username, $password) OR DIE("Unable to connect to MYSQL"); @mysql_select_db( "$dbName") or die( "Unable to select database"); if (isset($addW)) { // This is set if this file was called as a post from this file itself (add Teacher) $TeacherID = db_getVal("Teacher", "TeacherId", "Name", $addW); // Check if $addW is a valid teacher if ($TeacherID > 0) { // check if this teacher is already in watchlist $TID = db_getVal2("MyTeachers", "TeacherId", "AcctId", $AcctID, "TeacherId", $TeacherID); if ($TID <= 0) db_addVal2("MyTeachers", $AcctID, $TeacherID); } } if (isset($dnum)) { // This is set if this file was called as a post from this file itself (del Teacher) for ($i = 0; $i < $dnum; $i++) { $TeacherID = db_getVal("Teacher", "TeacherId", "Name", $delW[$i]); if ($TeacherID > 0) db_delVal2("MyTeachers", "AcctId", $AcctID, "TeacherId", $TeacherID); } } ?>
Sample Submissions Teachers in my WatchList How to Set Homework?

\n"); ?>
Select one or more teachers from the box on right and click here
Type username of a teacher in the box on right and click here 0)) print(" value = $addW"); ?> >
\n"); if ($TeacherID == 0) print("$addW is not a Teacher in our database!"); else if ($TID > 0) print("$addW is already in your watchlist!"); print("\n"); } ?>

Homeworks Due
(Click on a Hw # to bring up the Problems Page with that problem level.)

Fill in the Grade in the box on right and Click here  
Click here to show homeworks for ALL grades

= '$lastMonth' "; $query .= "AND HomeworkGiven.TeacherId = MyTeachers.TeacherId "; $query .= "AND MyTeachers.TeacherId = Teacher.TeacherId "; $query .= "AND HomeworkGiven.Level = MathLevels.Level "; $query .= "AND Submission.Stype = HomeworkGiven.Stype "; if (isset($grade)) $query .= "AND HomeworkGiven.Grade = '$grade' "; $query .= "ORDER BY Name, HworkGivenId"; $result = MYSQL_QUERY($query); $number = MYSQL_NUMROWS($result); // Print these results to the screen in a nice format $i = 0; if ($numW == 0) print("

You need to put some registered teachers in your watchlist in order to find the homeworks that they have assigned.
\n"); elseif ($number == 0) print("

No homeworks assigned by teachers in your watchlist .
\n"); elseif ($number > 0) { print(""); print("\n"); print("\n"); while ($i < $number) { $Name = mysql_result($result,$i,"Name"); $HworkGivenId = mysql_result($result,$i,"HworkGivenId"); $Label = mysql_result($result,$i,"Label"); $Level = mysql_result($result,$i,"Level"); $NumProbs = mysql_result($result,$i,"NumProbs"); $DueDate = mysql_result($result,$i,"DueDate"); list($year, $month, $day) = explode('-', $DueDate); if (!isset($grade)) $Grade = mysql_result($result,$i,"Grade"); $Sname = mysql_result($result,$i,"Sname"); $Upass = getSubmitPass($HworkGivenId); if ($DueDate >= $today) print("\n"); else print("\n"); print("\n"); $i++; } print("
Teacher Hw # "); if (!isset($grade)) print(" For Grade "); print(" Problem Level # problems Due Date Acceptance\n"); print("
$Name "); print(" $HworkGivenId "); if (!isset($grade)) print(" $Grade "); print(" $Label $NumProbs $month/$day/$year $Sname\n"); print("

\n"); } } // elseif ($mode == 2) // Display homework summary inclMathControlApplet($BRW); if ($mode != 0) { include ("bottom-links.php"); ShowBottomLinks("0", $sidSfx, $MainApp, $Logout, $BRW, $lang); } } // if ($AcctID > 0) else { // No or incorrect account info in cookies. Show login form if (!isset($mode)) $mode = 0; print("
\n"); include ("login_utils.php"); ShowLoginForm($mode, $AcctID, $lang); } ?>