Exemplo n.º 1
0
             if (!empty($value)) {
                 $lockedGrade = makeSQLsafe($value);
                 $sql = "\n                        INSERT into lockedGrades (student_id, class_id, lockedGrade)\n                        VALUES(" . $stud . "," . $classID . ",'" . $lockedGrade . "')\n                            ON DUPLICATE KEY UPDATE\n                            lockedGrade='" . $lockedGrade . "'";
                 $db->query($sql);
             } else {
                 // remove from db
                 $sql = "DELETE from lockedGrades where student_id = " . $stud . " AND class_id = " . $classID;
                 $db->query($sql);
             }
         }
     }
 }
 $order_by = $_SESSION[$_CONF['sess_name'] . '_gradebook_sortBy'];
 $bc = "blue";
 $t = "Gradebook - Class Selection";
 $b = "<FORM action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=POST id=\"classes\">\n\t\t\t<center>" . get_teacher_class_list($_SESSION[$_CONF['sess_name'] . '_myUID'], $classID, 'class_id', "classes") . "\n            <br />\n            Sort Assignments by : \n            <select name=gradebook_sortBy onChange=document.forms['classes'].submit();>\n            <option value=\"assignments.due_date desc\"";
 if ($_SESSION[$_CONF['sess_name'] . '_gradebook_sortBy'] == "assignments.due_date desc") {
     $b .= " selected";
 }
 $b .= ">Date (descending)</option>\n            <option value=\"assignments.due_date asc\"";
 if ($_SESSION[$_CONF['sess_name'] . '_gradebook_sortBy'] == "assignments.due_date asc") {
     $b .= " selected";
 }
 $b .= ">Date (ascending)</option>\n            <option value=\"categories.category_name\"";
 if ($_SESSION[$_CONF['sess_name'] . '_gradebook_sortBy'] == "categories.category_name") {
     $b .= " selected";
     $order_by .= ",assignments.due_date asc";
 }
 $b .= ">Category Name</option>\n            </select>               \n            </form>\n            </center>";
 $main .= make_box($t, $b, $bc) . "<br />";
 $bc = "";
Exemplo n.º 2
0
 $fromClassID = -1;
 if (isset($_POST['from_class_id'])) {
     $fromClassID = $_POST['from_class_id'];
 }
 if (isset($_SESSION[$_CONF['sess_name'] . '_selected_class'])) {
     $classID = $_SESSION[$_CONF['sess_name'] . '_selected_class'];
 }
 $t = "Schedule Students";
 $b = "<form action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=POST name=classes>\n\t\t\t<center>" . get_teacher_class_list($_SESSION[$_CONF['sess_name'] . '_myUID'], $classID, 'class_id', "classes") . "</center></form>";
 $main .= make_box($t, $b);
 if (isset($_POST['copy_from'])) {
     $t = "Copy From Another Class";
     $bc = "yellow";
     $b = "<table border=0 cellspacing=0 cellpadding=3>\n\t\t\t\t<tr><td>Copy From Class...<br />";
     $b .= "<form action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=POST>";
     $b .= get_teacher_class_list($_SESSION[$_CONF['sess_name'] . '_myUID'], $fromClassID, 'from_class_id', "classes", "off");
     $b .= "</td><td>";
     /** the copy to is from the previous screen POST variables... **/
     $b .= "You are copying the students to...<br />";
     $sql2 = "SELECT classes.class_id, courses.course_name, terms.term_name, terms.term_start_date, terms.term_end_date\n\t\t\t\tFROM courses, classes, terms\n\t\t\t\tWHERE classes.class_id=" . $classID . "\n                    AND courses.course_id=classes.course_id\n                    AND terms.term_id=classes.term_id";
     $result2 = $db->query($sql2);
     $row2 = $result2->fetch_assoc();
     $b .= $row2['course_name'] . " - " . $row2['term_name'] . "<br />";
     $b .= "</td>";
     $b .= "<tr><td colspan=2 align=center>\n\t\t\t\t<input type=submit class=submit name=copy_to value=\"Copy Students\" />\n\t\t\t\t<input type=hidden name=to_class_id value=" . $classID . " />\n\t\t\t\t</td></tr></form>\n\t\t\t\t</table>";
     $main .= make_box($t, $b, $bc);
 }
 if (isset($_POST['copy_to'])) {
     /**
     			Need to change this so I get the list of assignemnts for this class
     			So I can add to the grades table for each of these students....
Exemplo n.º 3
0
<?php

if ($_SESSION[$_CONF['sess_name'] . '_isTeacher']) {
    global $info;
    $cid = -1;
    $className = $termName = $teacherName = "";
    $_SESSION[$_CONF['sess_name'] . '_selected_teacher'] = $_SESSION[$_CONF['sess_name'] . '_myUID'];
    if (isset($_SESSION[$_CONF['sess_name'] . '_selected_class'])) {
        $cid = $_SESSION[$_CONF['sess_name'] . '_selected_class'];
        $result = get_class_info($cid);
        $row = $result->fetch_assoc();
        $term_id = $row['term_id'];
        $className = $row['course_name'];
        $termName = $row['term_name'];
        $teacherName = $row['first_name'] . " " . $row['last_name'];
        $tid = $_SESSION[$_CONF['sess_name'] . '_myUID'];
    }
    $t = "Class Score Summary";
    $b = "<FORM action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=POST name=classes>\n\t\t\t<center>" . get_teacher_class_list($_SESSION[$_CONF['sess_name'] . '_selected_teacher'], $cid, 'class_id', "classes") . "</center></form><br />";
    if ($cid != -1) {
        $classArray = array($cid => $className);
        include 'classSummary.php';
        $b .= "<span style=color:red>NOTE: Red grades mean they are locked by the teacher to that value rather than the calculated grade.</span>" . $summary_table . "<br />" . $print_button;
    }
    // end if isset class_id
    $main .= make_box($t, $b);
} else {
    $main .= login_error();
}
Exemplo n.º 4
0
 if (isset($_SESSION[$_CONF['sess_name'] . '_selected_student'])) {
     $sid = $_SESSION[$_CONF['sess_name'] . '_selected_student'];
 }
 /** the following is used for sorting the grades on this page only... **/
 if (!isset($_SESSION[$_CONF['sess_name'] . '_progress_sortBy'])) {
     //session_register($_CONF['sess_name'].'_progress_sortBy');
     $_SESSION[$_CONF['sess_name'] . '_progress_sortBy'] = "assignments.due_date asc";
 }
 if (isset($_POST['progress_sortBy'])) {
     $_SESSION[$_CONF['sess_name'] . '_progress_sortBy'] = $_POST['progress_sortBy'];
 }
 $order_by = $_SESSION[$_CONF['sess_name'] . '_progress_sortBy'];
 $print_button = "\t\n\t\t\t<CENTER>\n\t\t\t<FORM action=printview_progressreport.php method=POST target=new name=printview>\n\t\t\tPrint/View <input type=submit class=submit name=submit value=\"Current\" /> Student Report.\n\t\t\t</form>\n            <FORM action=printview_progressreport.php method=POST target=new name=printview>\n            Download <input type=submit class=submit name=all value=\"All\" /> Current Class Reports (Sinlge File).\n            <input type=hidden name=all value=all />\n            </form>\n            </CENTER>";
 $t = "Student Progress Reports";
 /** Function get_teacher_class_list($teacher_id,$class_id=-1,$select_name='class_id',$form, $change="on") **/
 $b = "<center><FORM action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=POST id=classes naame=classes>\n\t\t\t<center>" . get_teacher_class_list($_SESSION[$_CONF['sess_name'] . '_myUID'], $cid, 'class_id', 'classes', 'on') . "\n            </form><br />";
 if ($cid != -1) {
     $b .= "<FORM action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=POST name=students>\n\t\t<center>" . make_selection_list($los, $sid, 'student_id', 'students', 'Student', 'on') . "<br>\n\t\t\tSort Assignments by : \n                <select name=progress_sortBy onChange=document.forms['students'].submit();>\n                <option value=\"assignments.due_date desc\"";
     if ($_SESSION[$_CONF['sess_name'] . '_progress_sortBy'] == "assignments.due_date desc") {
         $b .= " selected";
     }
     $b .= ">Date (descending)</option>\n                <option value=\"assignments.due_date asc\"";
     if ($_SESSION[$_CONF['sess_name'] . '_progress_sortBy'] == "assignments.due_date asc") {
         $b .= " selected";
     }
     $b .= ">Date (ascending)</option>\n                <option value=categories.category_name";
     if ($_SESSION[$_CONF['sess_name'] . '_progress_sortBy'] == "categories.category_name") {
         $b .= " selected";
     }
     $b .= ">Category Name</option>\n                </select>               \n                </form>\n             </center>";
 }
Exemplo n.º 5
0
     $result = get_class_info($cid);
     $row = $result->fetch_assoc();
     $term_id = $row['term_id'];
     $className = $row['class_name'];
     $termName = $row['term_name'];
     $teacherName = $row['first_name'] . " " . $row['last_name'];
 }
 if ($tid != -1) {
     $custom_scores = array();
     $custom_scores = get_custom_scores($tid, $_SESSION[$_CONF['sess_name'] . '_current_school_year']);
     $classList = get_teacher_class_list($tid, $cid, 'class_id', "classes");
 }
 if (isset($_POST['teacher_id'])) {
     $tid = $_SESSION[$_CONF['sess_name'] . '_selected_teacher'] = $_POST['teacher_id'];
     $cid = $_SESSION[$_CONF['sess_name'] . '_selected_class'] = -1;
     $classList = get_teacher_class_list($tid, $cid, 'class_id', "classes");
 }
 $t = "Class Score Summary";
 $b = "<FORM action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=POST name=teachers>";
 $b .= "<center>" . make_selection_list($teacherList, $tid, 'teacher_id', 'teachers', 'Teacher', 'on') . "</center>";
 $b .= "</form>";
 if ($tid > -1) {
     $b .= "<FORM action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=POST name=classes>";
     $b .= "<center>" . $classList . "</center>";
     $b .= "</form>";
 }
 if ($cid > -1) {
     include 'classSummary.php';
     $b .= $summary_table . "<br />" . $print_button;
 }
 // end if isset class_id
Exemplo n.º 6
0
 $count = $row['count'];
 $copyALL = "\n\t\t\t\t<tr><td colspan=5><span style=\"color:red\">Copy ALL CLASS DATA from another class ?<br>\n\t\t\t\tWARNING : This will replace ALL data in the Categories, Assignments AND Grades Tables for the (Copy To) Class.<br>\n                It will also remove current student and replace with student in the copy FROM class.</span></td><td>\n\t\t\t\t<form action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=POST name=copyAllForm>\n\t\t\t\t<input type=submit class=submit name=copy_ALL_from id=copy_ALL_from value=\"COPY ALL\" />\n\t\t\t\t</form><br /></span>\n\t\t\t\t</td></tr>";
 if ($count != 0) {
     $bc = "blue";
     /** list the assignments for the selected class **/
     $sql = "SELECT assignments.assignment_id, assignments.assignment_name, assignments.due_date, assignments.max_score,\n                        assignments.assignment_weight, assignments.isExtraCredit, categories.category_name\n\t\t\t\t\tFROM assignments, categories\n\t\t\t\t\tWHERE categories.class_id=" . $classID . " and assignments.category_id=categories.category_id\n\t\t\t\t\tORDER by assignments.due_date";
     $result = $db->query($sql);
     $numAssigns = $result->num_rows;
     $t = "Assignments";
     $b = "\n                <script type=\"text/javascript\">\n                    \$(document).ready(function() {\n                        \$('#numAssignsForm').validationEngine({inlineValidation: true});\n                    });\n                </script>\n\t\t\t\t<center>\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t<form id=\"numAssignsForm\" name=\"numAssignsForm\" action=\"\" method=POST>\n\t\t\t\t\t\t<span style=white-space:nowrap>I would like to add <input class=\"validate[required,custom[integer]]\" type=text size=3 id=\"numAssigns\" name=numAssigns /> assignments to this class.\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=submit class=submit id=\"addNewAssigns\" name=\"addNewAssigns\" value=Add />\n\t\t\t\t\t\t<input type=hidden class=submit id=\"class_id\" name=\"class_id\" value=\"" . $classID . "\" />\n\t\t\t\t\t\t</form></span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t\t<form id=assignmentListForm name=assignmentListForm action=\"\" method=post>\n\t\t\t\t<table id=\"assignsTable\"border=0 bgcolor=white cellspacing=3 cellpadding=3>\n\t\t\t\t<thead>\n\t\t\t\t</thead>";
     if ($numAssigns > 0) {
         $b .= "\n\t\t\t\t<tbody id=\"assignmentList\">\n\t\t\t\t<tr>\n\t\t\t\t\t<th></th>\n\t\t\t\t\t<th bgcolor=white>Name</th>\n\t\t\t\t\t<th bgcolor=white>Category</th>\n\t\t\t\t\t<th bgcolor=white>Due Date</th>\n\t\t\t\t\t<th bgcolor=white>Max Score</th>\n\t\t\t\t\t<th bgcolor=white>Weight</th>\n\t\t\t\t\t<th bgcolor=white>Extra Credit</th>\n\t\t\t\t</tr>";
         while ($myrow = $result->fetch_assoc()) {
             $b .= "\n\t\t\t\t<tr id=\"assign_" . $myrow['assignment_id'] . "\">\n\t\t\t\t\t<td bgcolor=white>\n\t\t\t\t\t<input type=checkbox name=assign_" . $myrow['assignment_id'] . " id=assign_" . $myrow['assignment_id'] . " value=assign_" . $myrow['assignment_id'] . " />\n\t\t\t\t\t</td>\n\t\t\t\t\t<td bgcolor=white><span style=white-space:nowrap>" . $myrow['assignment_name'] . "</span></td>\n\t\t\t\t\t<td bgcolor=white><span style=white-space:nowrap>" . $myrow['category_name'] . "</span></td>\n\t\t\t\t\t<td bgcolor=white><span style=white-space:nowrap>" . $myrow['due_date'] . "</span></td>\n\t\t\t\t\t<td bgcolor=white align=center><span style=white-space:nowrap>" . $myrow['max_score'] . "</span></td>\n\t\t\t\t\t<td bgcolor=white align=center><span style=white-space:nowrap>" . $myrow['assignment_weight'] . "</span></td>\n\t\t\t\t\t<td bgcolor=white align=center><span style=white-space:nowrap>" . $myrow['isExtraCredit'] . "</span></td>\n\t\t\t\t</tr>";
         }
         $b .= "\n\t\t\t\t</tbody>\n\t\t\t\t<tfoot>\n\t\t\t\t<tr>\n\t\t\t\t<td colspan=7 align=center>\n                <input type=submit class=submit id=editAssigns name=editAssigns value=Edit />\n\t\t\t\t<input type=submit class=submit id=deleteAssigns name=deleteAssigns value=Delete /><br>\n                <input type=submit class=submit id=copyFromAssigns name=copyFromAssigns value=Copy />\n                <span style=\"color:red\">Copy These Assignments to the following class :</span> " . get_teacher_class_list($_SESSION[$_CONF['sess_name'] . '_myUID'], $classID, 'copy_to_class_id', "classes", 'off') . "<br>\n\n\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t</tfoot>\n\t\t\t\t";
     } else {
         $b .= "\n\t\t\t\t<tbody id=\"assignmentList\">\n\t\t\t\t</tbody>\n\t\t\t\t<tfoot>There are no assignments for this class yet.\n\t\t\t\t</tfoot>\n\t\t\t\t";
     }
     $b .= "\n\t\t\t</table>\n\t\t\t</form>";
     if ($courseInfo['isCore'] != 'Y') {
         $b .= "<table>" . $copyALL . "</table>";
     }
     $b .= "\n\t\t\t</center>";
     $main .= make_box($t, $b, $bc);
 } else {
     $bc = "red";
     $t = "Error...";
     $b = "You must first create categories for this class before entering assignments.";
     $b .= "You have 3 options...<br />";
     $b .= "<table border=0 cellspacing=0 cellpadding=3>\n\t\t\t\t\t<tr><td colspan=5>Proceed to add a category</td><td>\n\t\t\t\t\t<form action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=category method=POST>\n\t\t\t\t\t<input type=submit class=submit name=go value=OK />\n\t\t\t\t\t</form></td></tr>";
Exemplo n.º 7
0
         $b = "The file was uploaded successfully.<br />";
         $c = "blue";
         // add entry to db
         $sql = "INSERT into downloads (filename,description,title,size,file_type,class_id)\n                    values('" . $sqlfilename . "','" . $sqlfiledesc . "','" . $filetitle . "','" . $filesize . "','" . $sqlfiletype . "'," . $classid . ")";
         $result = $db->query($sql);
     } else {
         $b = "There was an error uploading the file {" . $_FILES['upload_file']['filename'] . "}.<br >" . $downloads_path;
         $c = "red";
     }
     $main .= "<br />" . make_box($t, $b, $c);
 }
 // end if upload
 if ($_SESSION[$_CONF['sess_name'] . '_isTeacher']) {
     // generate the upload input...
     $t = "Upload a file";
     $b = "<form enctype=\"multipart/form-data\" action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=\"post\">\n\t\t\t<center><table border=0 cellspacin=2 cellpadding=2>\n\t\t\t<tr>\n\t\t\t\t<td align=right>Please Select a Class :</td>\n\t\t\t\t<td align=left>" . get_teacher_class_list($_SESSION[$_CONF['sess_name'] . '_myUID'], $cid, 'class_id', "classes") . "</td>\n\t\t\t\t</tr>\n\t\t\t<tr>\n              <td align=right>Please select the file to upload :</td>\n              <td align=left><input name=\"upload_file\" type=\"file\"></td>\n            </tr>\n            <tr>\n                <td align=right>Please provide a Title :</td>\n                <td align=left><input name=\"title\" type=text size=20></td>\n            </tr>\n            <tr>\n              <td align=right valign=top>Description :</td> \n              <td align=left><textarea name=description rows=6 cols=30></textarea></td>\n            </tr>\n            <tr>\n              <td colspan=2 align=center><input type=\"submit\" name=\"upload\" value=\"Upload\"></td>\n            </tr>\n            </table>\n\t\t\t\t</center>\n            </FORM>";
     $main .= "<br />" . make_box($t, $b);
 }
 // table for files is called downloads
 // fields are filename, size, description
 // get the list of files available for download from DB
 $sql = "SELECT download_id, filename, description, title from downloads order by title";
 $result = $db->query($sql);
 $t = "Files Available for Download";
 $b = "";
 if ($result->num_rows != 0) {
     $b = "<center><table border=0 cellspacing=2 cellpadding=2>";
     while ($row = $result->fetch_assoc()) {
         $b .= "<tr>";
         $b .= "<td valign=top nowrap><b>" . $row['title'] . " :</b></td>";
         $b .= "<td valign=top>" . $row['description'] . "</td>";
Exemplo n.º 8
0
             $b .= "<span style=\"color:red;text-decoration: line-through;\">" . $row['category_weight'] . "</span>";
         }
         $b .= "\n\t\t\t\t</td>\n\t\t\t</tr>";
     }
     $b .= "\n\t\t\t<tr>\n\t\t\t\t<td colspan=2 align=center>\n\t\t\t\t<input type=hidden id=\"toBeDeleted\" name=\"toBeDeleted\" value=" . $selectedCats . " />\n\t\t\t\t<input type=submit class=submit id=\"really_delCat\" name=really_delCat value=Delete>\n\t\t\t\t<input type=submit class=submit id=\"cancel_delete\" name=cancel_delete value=Cancel>\n\t\t\t\t<input type=hidden name=cat_id value=" . $_POST['cat_id'] . ">\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t\t</form>\n\t\t";
     $main .= make_box($t, $b, $bc);
 }
 if (isset($_POST['copy_from'])) {
     $t = "Copy From Another Class";
     $bc = "yellow";
     /** copy from prior term **/
     $b = "<table border=0 cellspacing=0 cellpadding=3>\n\t\t<tr><td>";
     /** the copy from shold be selection list...**/
     $b .= "<form action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=POST>";
     //$b .= $classList = get_teacher_class_list($_SESSION[$_CONF['sess_name'].'_myUID'],$classID,'from_class_id',"classes","off");
     $b .= $classList = get_teacher_class_list($_SESSION[$_CONF['sess_name'] . '_myUID'], -1, 'from_class_id', "classes", "off");
     $b .= "</td><td>";
     /** the copy to is from the previous screen POST variables... **/
     $b .= "You are copying the categories to the following class...<br />";
     $sql = "SELECT *\n\t\tFROM terms, classes\n\t\tWHERE classes.term_id = terms.term_id\n\t\tAND classes.class_id =" . $_SESSION[$_CONF['sess_name'] . '_selected_class'];
     $result = $db->query($sql);
     $row = $result->fetch_assoc();
     $b .= $row['term_name'] . " : " . $row['term_start_date'] . "-" . $row['term_end_date'] . "<br />";
     $sql = "SELECT * from classes where class_id=" . $classID;
     $result = $db->query($sql);
     $row = $result->fetch_assoc();
     $b .= $row['class_name'] . "<br />";
     $b .= "</td>";
     $b .= "<tr><td colspan=2 align=center>\n\t\t<input type=submit class=submit name=copy_to value=Copy />\n\t\t<input type=hidden name=to_class_id value=" . $classID . " />\n\t\t</td></tr></form>\n\t\t</table>";
     $main .= make_box($t, $b, $bc);
 }