function get_content() { global $CFG; if ($this->content !== NULL) { return $this->content; } if (!isloggedin()) { return $this->content; } //if(is_siteadmin()){ // return $this->content; //} //if(has_capability('local_collegestructure:manage', context_system::instance())){ // return $this->content; //} // Prep the content $this->content = new stdClass(); if (!isloggedin() || isguestuser()) { $this->content = ''; } else { require_once 'exams.php'; $string = get_exams(); $this->content->text = $string; return $this->content; // Prepare the footer for this block // No footer to display $this->content->footer = ''; // Return the content object return $this->content; } }
function get_exams_content($catID) { $exams = get_exams($catID); $html = "<h4>Created Exams</h4>\n"; $html .= "<input type='hidden' value='{$catID}' id='cat_id' />"; $html .= "<div id='exams'>\n"; foreach ($exams as $exam) { $html .= "<li><span class='exam_link' id='{$exam[1]}' name='{$exam[0]}'>{$exam[0]}, Questions: {$exam[2]}</span>"; $html .= "<u class='space'></u><span class='take_exam_link' id='{$exam[1]}' name='{$exam[0]}' data-questions='{$exam[2]}'>Take Exam</span>"; $html .= "<u class='space'></u><u class='remove_exam' id='{$exam[1]}' name='{$exam[0]}' title='delete {$exam[0]} exam'>x</u><br /></li>\n<br/>"; } $html .= "</div><br /><br />"; $html .= "<button id='create_exam_button'>Create New</button>\n"; $html .= "<input id='new_exam' type='text' autocomplete='off' placeholder='Enter name of new exam' size='25' maxlength='30'/>"; return $html; }
$exam_name = $_POST['exam_name']; add_exam($exam_name); } ?> <html> <head> <title> Examinations </title> </head> <body> <h3>Examinations</h3> <hr/> <?php $exams = get_exams(); foreach ($exams as $i => $exam) { echo $i + 1 . ") "; echo "<a href = 'editexam.php?exam_id=" . $exam['ID'] . "&exam_name=" . $exam['Name'] . "'>" . $exam['Name'] . "</a>"; echo "<br/>\n"; } ?> <hr/> <form method = "post"> <input type = "text" name = "exam_name" value = "New Exam Name"> <input type = "submit" name = "add_exam" value = "Add Exam"> </form>
} $stude = $myrowrank['student_id']; $sqlgenerate = "UPDATE termly_class_ranks\n\t\t\t\t\tSET class_rank='" . $ranked . "'\n\t\t\t\t\tWHERE student_id='" . $stude . "'\n\t\t\t\t\tAND period_id='" . $_POST['period_id'] . "'\n\t\t\t\t\tAND class_id='" . $myrowclass['id'] . "'"; $generate = DB_query($sqlgenerate, $db); $previous_marks = $myrowrank['mean']; } //end of `while ($myrowrank= DB_fetch_array($resultrank)) } //end of else (DB_num_rows($resultroll) >0) } //end of foreach ($bus_report->scheduled_students as $sa => $st } // end of if($bus_report->scheduled_students>0) } // end class is lower $exams = get_exams($db); if ($myrowclass['lower'] == 0) { foreach ($exams as $exms => $ex) { $exam_rank = 0; $stud_array = mode_marks($myrowclass['id'], $_POST['period_id'], $ex['id'], $db); if ($stud_array > 0) { foreach ($stud_array as $studs => $stds) { $language_marks_per_exam = array(); $science_marks_per_exam = array(); $mathematics_marks_per_exam = array(); $technical_marks_per_exam = array(); $humanity_marks_per_exam = array(); $subjects_taken_by_student = 0; $total_per_exam_marks = 0; $subject_points_per_exam = 0; $sqlsub = "select sm.actual_marks,sub.department_id from subjects sub INNER JOIN studentsmarks sm ON\n\t\t\t sm.subject_id=sub.id\n\t\t\tWHERE sm.student_id='" . $stds['id'] . "'\n\t\t\tAND sm.period_id='" . $_POST['period_id'] . "'\n\t\t\tAND sm.exam_mode='" . $ex['id'] . "'";