Beispiel #1
0
     $pdf->Cell($catw, $cath, $cat, 0, 2, 'C', 1);
     $pdf->Cell($catw, $cath, $weight . "%", 0, 0, 'C', 1);
     $x_coord += $catw;
     $pdf->SetXY($x_coord, $y_coord);
 }
 /** Overall Average **/
 $pdf->Cell($overallavw, 2 * $cath, 'Overall Avg.', 0, 1, 'C', 1);
 $x_coord = $lm;
 $y_coord += 2 * $cath;
 $pdf->SetXY($x_coord, $y_coord);
 $pdf->SetFillColor(255, 255, 255);
 $pdf->SetTextColor(0, 0, 0);
 $rcv = 0;
 /** used for row shading **/
 /** get the list of students in this class **/
 $students = get_students_for_class($class_id);
 $reports = getReportForStudent("all", $tid, $class_id);
 /** Loop for each student in this class **/
 foreach ($reports as $sid => $report) {
     $rcv++;
     if ($rcv % 2) {
         $pdf->SetFillColor(255, 255, 255);
     } else {
         $pdf->SetFillColor(238, 238, 238);
     }
     /** Now for the calculations.  Remember to deal with no assigns in a category... **/
     $pdf->Cell($studentw, $cath, $students[$sid], 0, 0, 'L', 1);
     $x_coord += $studentw;
     foreach ($cat_names_array as $cat => $weight) {
         $pdf->Cell($catw, $cath, $report['summary'][$cat]['value'], 0, 0, 'C', 1);
         $x_coord += $catw;
<?php

define('FPDF_FONTPATH', 'fpdf_fonts/');
require 'fpdf.php';
include '_includeSessionConfig.php';
$loginError = check_auth($_SESSION[$_CONF['sess_name'] . '_username'], $_SESSION[$_CONF['sess_name'] . '_password']);
if (!$loginError['error_value']) {
    $cid = $_SESSION[$_CONF['sess_name'] . '_selected_class'];
    $los = array();
    /** used to hold the list of students to print report for **/
    $sid = -1;
    $download = false;
    if (isset($_POST['all'])) {
        $sid = 'all';
        $los = get_students_for_class($cid);
        $download = true;
    } else {
        $sid = $_SESSION[$_CONF['sess_name'] . '_selected_student'];
        $sql = "SELECT first_name, last_name from users where user_id=" . $sid;
        $result = $db->query($sql);
        $row = $result->fetch_assoc();
        $studentName = $row['first_name'] . " " . $row['last_name'];
        $los[$sid] = $studentName;
        $download = false;
    }
    include 'newProgressReports.php';
    $cid = $_SESSION[$_CONF['sess_name'] . '_selected_class'];
    //$sid = $_SESSION[$_CONF['sess_name'].'_selected_student'];
    $tid = $_SESSION[$_CONF['sess_name'] . '_myUID'];
    $reports = getReportForStudent($sid, $tid, $cid);
    //$reports = $reportsResults;
Beispiel #3
0
         $val['comment'] = $row1['comment'];
         $grade_array[$key] = $val;
     }
 }
 /** Now get any locked grades for this class **/
 $sql = "SELECT * from lockedGrades where class_id=" . $classID;
 $result = $db->query($sql);
 $lockedGradesArray = array();
 if ($result) {
     while ($row = $result->fetch_assoc()) {
         $lockedGradesArray[$row['student_id']] = $row['lockedGrade'];
     }
 }
 /** get the list of students in this class and the list of assignments for this class **/
 /** get_students_for_class($classID) returns id=>First_Last **/
 $studList = get_students_for_class($classID);
 /** assignments.due_date asc, assignments.assignment_name"; **/
 $sql2 = "SELECT assignments.assignment_id, assignments.assignment_name, assignments.due_date,\n                        assignments.max_score, assignment_note, categories.category_name\n\t\t\t\tFROM categories, assignments\n\t\t\t\tWHERE assignments.category_id=categories.category_id AND categories.class_id=" . $classID . "\n                ORDER by " . $order_by . ",assignment_name";
 $result2 = $db->query($sql2);
 $numAssigns = $result2->num_rows;
 $colSpan = $numAssigns + 1;
 $assign_array = array();
 /**
  * Now build the table (Gradebook)
  */
 if ($numAssigns != 0) {
     $left = "\n\t\t\t\t<table class=\"grade_book\" border=0 cellspacing=1 cellpadding=3 bgcolor=black id=\"gradeTable\">\n\t\t\t\t<thead>\n\t\t\t\t  <tr valign=middle align=center class=\"gradeBookAssignmentHead\">\n\t\t\t\t\t<td>\n                        <b><span style=white-space:nowrap>" . $className . "</span><br />\n                        <span style=white-space:nowrap>" . $termName . "</span></b>\n\t\t\t\t\t</td>\n                    <td width=20px;><img src=\"make_assigns.php?a=Lock Grade&d=N/A&c=N/A&t=n&l=red\" alt=\"\" border=0 /></td>\n\t\t\t\t  </tr>\n\t\t\t\t  <tr align=right class=\"gradeBookStudentHead\">\n                        <td><b>Max Score</b></td>\n                        <td width=20px; style=\"text-align:center;color:red;\"><span>100</span></td>\n\t\t\t\t  </tr>\n\t\t\t\t</thead>";
     $right = "\n\t\t\t\t<table class=\"grade_book\" border=0 cellspacing=1 cellpadding=3 bgcolor=black id=\"gradeTable\">\n\t\t\t\t<thead>\n\t\t\t\t  <tr class=\"gradeBookAssignmentHead\">";
     $assign_count = 1;
     while ($row2 = $result2->fetch_assoc()) {
         $assign_array[$assign_count] = $row2['assignment_id'];
Beispiel #4
0
    if ($classID != -1 || isset($_POST['update_s2c'])) {
        $t = "Class Roster";
        $b = "<font color=red><center>If you remove a student here and he/she has grades in the database for this class, the grades are removed also.</center></font>";
        $b .= "\n\t\t<br />\n\t\t<center>\n\t\t<TABLE width=350 border=0 cellspacing=0 cellpadding=2 bgcolor=white>\n\t\t<tr><th colspan=2>Schedule Students</th></tr>";
        // get class name, term_name...
        $sql = "SELECT course_name, term_name\n\t\t\t\tFROM classes, terms, courses\n\t\t\t\tWHERE class_id=" . $classID . "\n\t\t\t\t\tAND courses.course_id=classes.course_id\n\t\t\t\t\tAND terms.term_id=classes.term_id";
        $result = $db->query($sql);
        $row = $result->fetch_assoc();
        $className = $row['course_name'] . " : " . $row['term_name'];
        $b .= $hiddenTerm . "\n\t\t<tr><th colspan=2>Scheduling Class : " . $className . "</th></tr>";
        /** display the list of students... **/
        $students = get_users_for_center($_SESSION[$_CONF['sess_name'] . '_myCenter'], 'isStudent', 'Y', "users.last_name, users.first_name");
        $studentList = make_selection_list($students, -1, 'student_id', 'studentList', 'Student', "off");
        /** need to get students that ONLY go to my school **/
        $b .= "\n\t\t<tr>\n\t\t\t<td bgcolor=white align=center>\n\t\t\t\t<form action=\"\" id=studentListForm name=studentListForm method=post>" . $studentList . "\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<input id=addToRoster type=submit class=submit name=addToRoster value=Add />\n\t\t\t\t<input type=hidden name=class_id id=class_id value=" . $classID . " />\n\t\t\t\t</form>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td colspan=2 bgcolor=white align=center>\n\t\t\t\t<form action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " name=studentList method=post>\n\t\t\t\t<input id=copyFrom type=submit class=submit name=copy_from value=\"Copy From Another Class\" />\n\t\t\t\t</form>\n\t\t\t</td>\n\t\t</tr>\n\t\t</form>\n\t\t</table>";
        /** 
        			now for the new way of adding/removing students.  Use a selection list with "Add" button
        			Then use checkboxes next to names and a remove button.  Keep the copy from
        		**/
        $registered = get_students_for_class($classID);
        $b .= "\n\t\t<div id=enrolledStudentsDiv><h2>Current Enrollment</h2>\n\t\t<form id=enrolledStudentsForm name=enrolledStudentsForm action=\"\" method=post>\n\t\t<table id=\"enrollmentTable\" background=white cellspacing=1 cellpadding=3>\n\t\t<thead><tr><th colspan=2></th></tr></thead>\n\t\t<tbody id=\"enrollmentTableBody\">";
        foreach ($registered as $id => $name) {
            $b .= "\n\t\t\t<tr><td><input type=checkbox id=s_" . $id . " name=s_" . $id . " class=studentCheckbox></td><td>" . $name . "</td></tr>";
        }
        $b .= "\n\t\t</tbody>\n\t\t<tfoot>\n\t\t<tr>\n\t\t\t<td colspan=2>\n\t\t\t\t<input type=submit id=removeFromRoster name=removeFromRoster value=Remove />\n\t\t\t\t<input type=hidden name=class_id id=class_id value=" . $classID . " />\n\t\t\t</td>\n\t\t</tr>\n\t\t</tfoot>\n\t\t</table>\n\t\t</form>\n\t\t</div>\n\t\t";
        $b .= "\n\t\t</center>";
        $main .= make_box($t, $b);
    }
} else {
    $main .= login_error();
}