Ejemplo n.º 1
0
 /**
  * Display a listing of the resource.
  * @return Response
  */
 public function index()
 {
     if ($terms = Cache::get('student_' . $this->student->id . '_api_grades')) {
         return response(['grades' => $terms, 'gpas' => $this->calculateGpa($terms)], 200, [], JSON_NUMERIC_CHECK);
     }
     $terms = get_student_grades($this->student->id);
     Cache::put('student_' . $this->student->id . '_api_terms', $terms, 600);
     return response(['grades' => $terms, 'gpas' => $this->calculateGpa($terms)], 200, [], JSON_NUMERIC_CHECK);
 }
Ejemplo n.º 2
0
 public function record($student_id, Request $request)
 {
     if (!$student_id) {
         return redirect()->rotue('students.students.index');
     }
     $terms = get_student_grades($student_id);
     $student = Student::findOrFail($student_id);
     if ($request->has('partial')) {
         return view('students::grades._record_list', compact('terms', 'student'));
     }
     return view('students::grades.record', compact('terms', 'student'));
 }
Ejemplo n.º 3
0
         $info[$MAX] = 0;
         $USER = $row['category_name'] . "_user_points";
         $info[$USER] = 0;
         $WEIGHT = $row['category_name'] . "_weight";
         $info[$WEIGHT] = $row['category_weight'];
         $COUNT = $row['category_name'] . "_count";
         $info[$COUNT] = 0;
         $AVG = $row['category_name'] . "_avg";
         $info[$AVG] = 0;
         $POSSIBLE = $row['category_name'] . "_possible";
         $info[$POSSIBLE] = 0;
         $WTD_AVG = $row['category_name'] . "_weighted_avg_sum";
         $info[$WTD_AVG] = 0;
     }
 }
 $result = get_student_grades($sid, $class_id);
 $assigns = array();
 if (mysql_num_rows($result) > 0) {
     while ($row = mysql_fetch_assoc($result)) {
         array_push(${$row['category_name']}, $row);
         array_push($assigns, $row);
     }
     $rcv = 0;
     /** used for row shading **/
     $total_cat_weights = 0;
     foreach ($assigns as $grade) {
         $cat = $grade['category_name'];
         if ($grade['raw_score'] != "") {
             /** Weighted average **/
             $info[$cat . "_weighted_avg_sum"] += round($grade['raw_score'] / $grade['max_score'] * 100 * $grade['assignment_weight'], 1);
             /** Assignment Weights **/
Ejemplo n.º 4
0
        $info[$WEIGHT] = $row['category_weight'];
        $COUNT = $row['category_name'] . "_count";
        $info[$COUNT] = 0;
        $AVG = $row['category_name'] . "_avg";
        $info[$AVG] = 0;
        $POSSIBLE = $row['category_name'] . "_possible";
        $info[$POSSIBLE] = 0;
        $WTD_AVG = $row['category_name'] . "_weighted_avg_sum";
        $info[$WTD_AVG] = 0;
    }
}
$assign_table = "";
$b = "";
$t = "Student Progress Report";
$t = "";
$result = get_student_grades($sid, $cid, $order_by);
$assigns = array();
if (mysql_num_rows($result) > 0) {
    while ($row = mysql_fetch_assoc($result)) {
        array_push(${$row['category_name']}, $row);
        array_push($assigns, $row);
    }
    /** Assignments Table **/
    $assign_table = "\n\t\t\t<table class=\"grade_book_print\">\n\t\t\t<tr class=\"grade_header\">\n\t\t\t\t<th>Date</a></th>\n\t\t\t\t<th>Assignment</th>\n\t\t\t\t<th>Category</th>\n\t\t\t\t<th>Score</th>\n\t\t\t\t<th>Weight</th>\n\t\t\t\t<th>Avg.</th>\n\t\t\t</tr>";
    $rcv = 0;
    /** used for row shading **/
    $total_cat_weights = 0;
    /** Display the grades for each category **/
    /** 
    		commenting out the old way so I can try to implement sorting by date rather than category
    		foreach($cat_names_array as $cat){
Ejemplo n.º 5
0
 private function getGrades()
 {
     // if ($terms = Cache::get('student_'.$this->student->id.'_api_grades')) {
     // return ['grades'=>$terms, 'gpas'=>$this->calculateGpa($terms)];
     // }
     $terms = get_student_grades($this->student->id);
     // Cache::put('student_'.$this->student->id.'_api_terms', $terms, 1200);
     return ['grades' => $terms, 'gpas' => $this->calculateGpa($terms)];
 }
Ejemplo n.º 6
0
    public function getcompletedeplomesubCertificate($background = false)
    {
        $student = Student::select('students.*')->joinTermName()->findOrFail($this->student_id);
        $semesters = get_student_grades($student->id);
        if ($this->student_id == 1821) {
            $gpa = 3.59;
        } else {
            $gpa = GPA($semesters);
        }
        // $year_id =  $semesters = Semester::where('id', $student->histories->first()->academycycle_semester_id)->first()->id;
        //  dd($year_id);
        // $year_name = Year::where('id', '=', $year_id - 1)->first()->name;
        $pdf = $this->preparePdf($background);
        $html = '<h2>إفادة بإكمال درجة</h2>';
        $pdf->writeHTMLCell(210, 20, 10, 50, $html, 0, 0, false, true, "R");
        $valuation = check_final_valuation($gpa);
        $graduated_date = '';
        $fourth = '';
        if ($student->registration->fourth_name) {
            $fourth = ' بن ' . $student->registration->fourth_name . ' ';
        }
        $pdf->SetFontSize(16, 'B');
        if ($student->gender == 'f') {
            $html = '<p>تشهد كلية العلوم الشرعية - التعليم عن بعد بأن:<br>' . $student->registration->first_name . ' بنت ' . $student->registration->second_name . ' بن ' . $student->registration->third_name . $fourth . $student->registration->last_name . '<br>الرقم الجامعي:' . $student->username . '<br>
      الجنسيـة: ' . $student->registration->birthcountry->name . ' <br>
    </p>';
            $pdf->writeHTMLCell(100, 20, 10, 60, $html, 0, 0, false, true, "R");
            $pdf->SetFontSize(16, 'B');
            //'.$year_name.'
            $html = '<p>قد أكملت متطلبات درجة الدبلوم في العلوم الشرعية  <br>بمعدل تراكمي ' . $gpa . ' بتقدير ' . $valuation . '<br><br><br><br>وسوف تمنح الدرجة رسمياً بعد اعتمادها.

      <p>';
            $pdf->writeHTMLCell(100, 20, 10, 110, $html, 0, 0, false, true, "R");
        } else {
            $html = '<p>تشهد كلية العلوم الشرعية - التعليم عن بعد بأن:<br>' . $student->registration->first_name . ' بن ' . $student->registration->second_name . ' بن ' . $student->registration->third_name . $fourth . $student->registration->last_name . '<br> الرقم الجامعي:' . $student->username . '<br>
       الجنسيـة: ' . $student->registration->birthcountry->name . '<br>
    </p>';
            //'.$year_name.'
            $pdf->writeHTMLCell(100, 20, 10, 60, $html, 0, 0, false, true, "R");
            $pdf->SetFontSize(16, 'B');
            $html = '<p> قد أكمل متطلبات درجة الدبلوم في العلوم الشرعية
        <br>في العام الأكاديمي: 
        <br>بمعدل تراكمي ' . $gpa . ' بتقدير ' . $valuation . '
         <br><br>بتاريخ ' . $graduated_date . 'م
         <br><br>وسوف تمنح الدرجة رسمياً بعد اعتمادها.

      <p>';
            $pdf->writeHTMLCell(100, 20, 10, 110, $html, 0, 0, false, true, "R");
        }
        $pdf->SetFontSize(20, 'B');
        $html = 'المشرف العام على التعليم عن بعد<br>مستشار معالي وزير الأوقاف والشؤون الدينية';
        $pdf->writeHTMLCell(210, 20, 0, 200, $html, 0, 0, false, true, "C");
        $pdf->SetFontSize(16, 'B');
        $html = '<table cellpadding="3">
      <tr><td align="right">لمزيد من التفاصيل يمكن طلب كشف الدرجات الأصلي</td></tr>

    </table>';
        $pdf->writeHTMLCell(100, 20, 10, 250, $html, 0, 0, false, true, "R");
        //English language
        switch ($valuation) {
            case 'امتياز':
                $valuation = 'excellence';
                break;
            case 'امتياز مع مرتبة الشرف':
                $valuation = 'excellent with honors';
                break;
            case 'جيد جدا':
                $valuation = 'very good';
                break;
            case 'جيد':
                $valuation = 'good';
                break;
            case 'مقبول':
                $valuation = 'fairly good';
                break;
            default:
                $valuation = '';
        }
        $html = '<h2>Notification of Degree Completion</h2>';
        $pdf->writeHTMLCell(205, 20, 0, 50, $html, 0, 0, false, true, "L");
        $pdf->SetFontSize(14, 'B');
        $fourth = '';
        if ($student->registration->fourth_name_latin) {
            $fourth = ' bin ' . $student->registration->fourth_name_latin . ' ';
        }
        if ($student->gender == 'f') {
            $html = '<p>College of Shari’a Sciences - Distance learning
                  <br>attests that:<br>' . $student->registration->first_name_latin . ' bint ' . $student->registration->second_name_latin . ' bin ' . $student->registration->third_name_latin . $fourth . $student->registration->last_name_latin . '
                  <br>Student ID: ' . $student->username . '<br> Nationality: ' . $student->registration->birthcountry->nationality_en . '  <br>
               </p>';
        } else {
            $html = '<p>College of Shari’a Sciences - Distance learning
                  <br>attests that:<br>' . $student->registration->first_name_latin . ' bin ' . $student->registration->second_name_latin . ' bin <br>' . $student->registration->third_name_latin . $fourth . $student->registration->last_name_latin . '
                  <br>Student ID: ' . $student->username . '<br> Nationality: ' . $student->registration->birthcountry->nationality_en . '  <br>
               </p>';
        }
        $pdf->writeHTMLCell(205, 10, 0, 60, $html, 0, 0, false, true, "L");
        $pdf->SetFontSize(14, 'B');
        $html = '<p>Has successfully fulfilled the graduation
    <br>requirements of the Diploma degree in Sharia
    <br>Sciences on the academic year $year_name with
    <br>accumulative grade of ' . $gpa . ' ' . $valuation . '<br><br> on ' . $graduated_date . '
             <br><br>The degree will be officially awarded after <br>the endorsement.</p>';
        $pdf->writeHTMLCell(205, 10, 0, 110, $html, 0, 0, false, true, "L");
        $pdf->SetFontSize(14, 'B');
        $html = '<p>For more details, the official transcript could be<br>requested.</p>';
        $pdf->writeHTMLCell(205, 10, 0, 250, $html, 0, 0, false, true, "L");
        ob_clean();
        return $pdf;
    }
Ejemplo n.º 7
0
         $info[$POSSIBLE] = 0;
         $WTD_AVG = $row3['category_name'] . "_weighted_avg_sum";
         $info[$WTD_AVG] = 0;
     }
 }
 /** NOW LOOP OVER THE ARRAY OF STUDENTS **/
 /** THE FOLLOWING SHOULD BE REPEATED FOR EACH STUDENT **/
 //foreach($los as $sid=>$sname) {
 $info[$MAX] = 0;
 $info[$USER] = 0;
 $info[$COUNT] = 0;
 $info[$AVG] = 0;
 $info[$POSSIBLE] = 0;
 $info[$WTD_AVG] = 0;
 $pageTitle = $year . "_" . $sname . "_" . $className . "_" . $termName . "_Progress_Reports.pdf";
 $result4 = get_student_grades($sid, $cid);
 $assigns = array();
 if ($result4->num_rows > 0) {
     $pdf = new FPDF('P', 'in', 'Letter');
     $pdf->open();
     $pdf->SetTitle($pageTitle);
     while ($row4 = $result4->fetch_assoc()) {
         array_push(${$row4['category_name']}, $row4);
         array_push($assigns, $row4);
     }
     $rcv = 0;
     /** used for row shading **/
     $total_cat_weights = 0;
     /** Display the grades for each category **/
     $assignmentsArray = array();
     foreach ($assigns as $grade) {
Ejemplo n.º 8
0
include_once 'init.php';
include_once 'include/students.php';
include_once 'include/classes.php';
include_once 'include/curriculums.php';
$renderArray = array();
$fromAjax = intval($_REQUEST['fromAjax']);
$template_name = 'index.html';
if ($fromAjax) {
    $template_name = 'index-ajax.html';
    $quarter_id = intval($_REQUEST['quarter_id']) or die('Invalid quarter_id');
    $quarter = get_quarter($quarter_id) or die("No quarter for {$quarter_id}={$quarter_id}");
    $date_from = $quarter['started'];
    $date_to = $quarter['finished'];
    $day_of_week = array(0 => 'Пн', 1 => 'Вт', 2 => 'Ср', 3 => 'Чт', 4 => 'Пт', 5 => 'Сб', 6 => 'Вс');
    $class_id = get_student_class_id($student_id) or die('Unknown student');
    $student_grades = get_student_grades($student_id, $date_from, $date_to);
    $disciplines = get_disciplines_from_class($class_id);
    $dates = array();
    $grades = array();
    foreach ($student_grades as $grade) {
        $lesson_monthyear = $grade['lesson_month'] . '.' . $grade['lesson_year'];
        $dates[$lesson_monthyear][$grade['lesson_date']] = array('lesson_weekday' => $grade['lesson_weekday'], 'lesson_weekday_w' => $day_of_week[$grade['lesson_weekday']], 'lesson_day' => $grade['lesson_day'], 'lesson_month' => $grade['lesson_month'], 'lesson_year' => $grade['lesson_year']);
        $grades[$grade['discipline_id']][$grade['lesson_date']][] = array('grade' => $grade['grade'], 'topic' => $grade['topic'], 'lesson_id' => $grade['lesson_id'], 'lesson_type_id' => $grade['lesson_type_id'], 'lesson_type_name' => $grade['lesson_type_name']);
    }
    $quarter['started_date'] = date("d.m.Y", strtotime($quarter['started']));
    $quarter['finished_date'] = date("d.m.Y", strtotime($quarter['finished']));
    $renderArray['quarter'] = $quarter;
    $renderArray['dates'] = $dates;
    $renderArray['disciplines'] = $disciplines;
    $renderArray['grades'] = $grades;
} else {
Ejemplo n.º 9
0
 }
 $bc = "";
 $t = "Teacher Gradebook for " . $_SESSION[$_CONF['sess_name'] . '_myfName'] . " " . $_SESSION[$_CONF['sess_name'] . '_mylName'];
 $b = "";
 $sql = "SELECT courses.course_name, terms.term_name \n\t\t\t\tFROM classes, terms, courses\n\t\t\t\tWHERE courses.course_id=classes.course_id\n\t\t\t\tAND classes.class_id=" . $classID . " \n\t\t\t\tAND terms.term_id=classes.term_id";
 $result = $db->query($sql);
 $row = $result->fetch_assoc();
 $courseName = $row['course_name'];
 $termName = $row['term_name'];
 /** get student info **/
 $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'];
 /** get the assignments for this student in this class **/
 $result = get_student_grades($sid, $classID, "assignments.due_date,assignment_name");
 if ($result->num_rows != 0) {
     $b .= "\n\t\t\t\t\t<center>\n\t\t\t\t\t<form action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=gradebook method=POST id=\"myGradebook\">\n\t\t\t\t\t<table class=\"grade_book\" border=1 cellspacing=1 cellpadding=3 bgcolor=black id=\"gradeTable\">\n\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign=middle align=center colspan=3>\n\t\t\t\t\t\t<b><span style=white-space:nowrap>" . $studentName . "</span><br />\n\t\t\t\t\t\t<span style=white-space:nowrap>" . $courseName . " - " . $termName . "</span></b></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td align=center style=font-weight:bold>Assignment</td>\n\t\t\t\t\t<td align=center style=font-weight:bold>Grade</td>\n\t\t\t\t\t<td align=center style=font-weight:bold>Comment</td>\n\t\t\t\t\t</tr>";
     if ($result) {
         while ($row = $result->fetch_assoc()) {
             $assignmentMaxScore = $row['max_score'];
             $b .= "<tr class=\"assignment\">\n\t\t\t\t\t\t\t\t<td><span style=white-space:nowrap>" . $row['assignment_name'] . "</span></td>";
             $b .= "<td align=center>\n\t\t\t\t\t\t\t\t<input name=assign_" . $row['assignment_id'] . "_" . $sid . " type=text size=4 class=\"grade_input\" maxlength=6 value=\"" . $row['raw_score'] . "\" onChange=\"validate_score(this," . $assignmentMaxScore . ",'" . $row['raw_score'] . "');\"";
             if ($row['raw_score'] == 'mi') {
                 $b .= " style=\"background-color:#FFF0B2;\"";
             }
             $b .= "/>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<textarea rows=\"1\" cols=\"40\" name=comment_" . $row['assignment_id'] . "_" . $sid . ">" . $row['comment'] . "</textarea>\n\t\t\t\t\t\t\t\t</td>\n";
             $b .= "</tr>";
         }
     }
     $b .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td colspan=3 align=center>\n\t\t\t\t\t\t<input type=submit class=submit name=update_grades value=Submit />\n\t\t\t\t\t\t<input type=hidden name=studentent_id value=" . $sid . " />\n\t\t\t\t\t\t<input type=hidden name=class_id value=" . $classID . " />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>";