// if on this page, only viewing single report include "newProgressReports.php"; $currentDate = date("F j, Y", time() - 18000); $schoolYears = get_school_years_list(); $schoolYear = $schoolYears[$_SESSION[$_CONF['sess_name'] . '_current_school_year']]; $assign_table = ""; $b = ""; $custom_scores = array(); $custom_scores = get_custom_scores($tid, $_SESSION[$_CONF['sess_name'] . '_current_school_year']); //displayArray($custom_scores); $cid = $_SESSION[$_CONF['sess_name'] . '_selected_class']; $sid = $_SESSION[$_CONF['sess_name'] . '_selected_student']; /* This only works for teachers. should move to teach_rep or stud_rep $tid = $_SESSION[$_CONF['sess_name'].'_myUID']; */ $reports = getReportForStudent($sid, $tid, $cid); //$reports = $reportsResults; if (count($reports)) { foreach ($reports as $id => $report) { $teacherName = $report['classInfo']['first_name'] . " " . $report['classInfo']['last_name']; /** Assignments Table **/ $assign_table = "\n <table class=\"grade_book_print\">\n <tr class=\"grade_header\">\n <th>Date</a></th>\n <th>Assignment</th>\n <th>Category</th>\n <th>Score</th>\n <th>Weight</th>\n <th>Avg.</th>\n\n </tr>"; $rcv = 0; /** used for row shading **/ //foreach($report['studentGrades'] as $gid=>$grade){ foreach ($report['assignments'] as $grade) { $cat = $grade['category_name']; if ($rcv % 2) { $rowclass = "row_odd"; } else { $rowclass = "row_even";
$x_coord += $termw; $pdf->SetXY($x_coord, $y_coord); } $pdf->Cell($overallavw, 2 * $termh, 'Overall Avg.', 0, 1, 'C', 1); $pdf->SetFillColor(255, 255, 255); $x_coord = $lm; $y_coord += 2 * $termh; $result = get_students_for_course($courseID); $students = make_assoc_array_from_sql($result, 'user_id', 'my'); foreach ($students as $sid => $studentInfoArray) { $avgSum = $percentSum = $termCount = 0; $pdf->SetFont('Times', '', $studentfs); $pdf->Cell($studentw, $studenth, $studentInfoArray['first_name'] . " " . $studentInfoArray['last_name'], 0, 0, 'C', 1); $page .= $studentInfoArray['first_name'] . " " . $studentInfoArray['last_name'] . " "; foreach ($classes as $class_id => $classTitle) { $reports = getReportForStudent($sid, $courseInfo['user_id'], $class_id); if (!empty($reports)) { $termID = $reports[$sid]['classInfo']['term_id']; if ($reports[$sid]['overallCalculatedAverage'] > 0) { $termWeight = $terms[$termID]['term_weight']; $avgSum += $reports[$sid]['overallCalculatedAverage'] * ($termWeight / 100); $percentSum += $termWeight; $termCount++; } if ($reports[$sid]['locked']['hasLocked']) { $pdf->SetTextColor(255, 0, 0); $pdf->Cell($termw, $studenth, $reports[$sid]['locked']['lockedGrade'], 0, 0, 'C', 1); $page .= $reports[$sid]['locked']['lockedGrade'] . " "; $pdf->SetTextColor(0, 0, 0); } else { $pdf->Cell($termw, $studenth, $reports[$sid]['overallCalculatedAverage'], 0, 0, '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; $pdf->SetXY($x_coord, $y_coord);
$setWorksheets = []; $studentWorksheets = []; $questionTags = []; $tags = []; $recentQuestions = 5; $userAvg; $reliabilityConstant = 0.2; $reliabilityBase = 0.2; $timeBase = 0.1; $timeConstant = 0.0004; switch ($requestType) { case "STUDENTREPORT": if (!authoriseUserRoles($role, ["SUPER_USER", "STAFF"])) { failRequest("You are not authorised to complete that request"); } getReportForStudent($startDate, $endDate, $studentId, $setId, $staffId, $tagsArrayString); break; case "STUDENTSUMMARY": getSummaryForStudent($startDate, $endDate, $studentId, $setId, $staffId, $tagsArrayString); break; default: failRequest("Invalid request type."); break; } function getReportForStudent($startDate, $endDate, $studentId, $setId, $staffId, $tagsArrayString) { validateAndReturnInputs($startDate, $endDate, $studentId, $setId, $staffId, $tagsArrayString); unset($startDate, $endDate, $studentId, $setId, $staffId, $tagsArrayString); getAnsweredQuestionsAndTags(); groupResultsByTag(); reorderTagsAndSucceedRequest();