$advancegrading = get_advance_grading($cmid, $emarking->id); $markeradvance_marker = get_markeradvance_marker($cmid, $emarking->id); $markeradvance_corregido = get_markeradvance_corregido($cmid, $emarking->id); $markeradvance_porcorregir = get_markeradvance_porcorregir($cmid, $emarking->id); $markeradvance_porrecorregir = get_markeradvance_porrecorregir($cmid, $emarking->id); $final = array("Grading" => $grading, "Contributioners" => $contributioners, "Contributions" => $contributions, "Advancedescription" => $advancedescription, "Advanceresponded" => $advanceresponded, "Advanceregrading" => $advanceregrading, "Advancegrading" => $advancegrading, "MarkeradvanceMarker" => $markeradvance_marker, "MarkeradvanceCorregido" => $markeradvance_corregido, "MarkeradvancePorcorregir" => $markeradvance_porcorregir, "MarkeradvancePorrecorregir" => $markeradvance_porrecorregir); $output = $final; $jsonOutputs = array('error' => '', 'values' => $output); $jsonOutput = json_encode($jsonOutputs); if ($callback) { $jsonOutput = $callback . "(" . $jsonOutput . ");"; } echo $jsonOutput; } else { if ($action == "gradereport") { $grading = get_status($cmid, $emarking->id); $marks = get_marks($cmid, $emarking->id, $cmid, $ids); $coursemarks = get_courses_marks($cmid, $emarking->id, $cmid, $ids); $pass_ratio = get_pass_ratio($cmid, $emarking->id, $cmid, $ids); $efficiencycriterion = get_efficiency_criterion($cmid, $emarking->id, $cmid, $ids); $efficiencyrate = get_efficiency_rate($cmid, $emarking->id, $cmid, $ids); $final = array("Marks" => $marks, "CourseMarks" => $coursemarks, "PassRatio" => $pass_ratio, "EfficiencyCriterion" => $efficiencycriterion, "EfficiencyRate" => $efficiencyrate); $output = $final; $jsonOutputs = array('error' => '', 'values' => $output); $jsonOutput = json_encode($jsonOutputs); if ($callback) { $jsonOutput = $callback . "(" . $jsonOutput . ");"; } echo $jsonOutput; } }
<?php require 'libs/checklogin.php'; require 'libs/functions.php'; $username = isset($_SESSION["username"]) ? $_SESSION["username"] : ''; echo get_marks($username);
function get_code($exerid, $username) { $code = ''; if (get_marks($username) >= $exerid * 5) { $code = get_passed_code($exerid, $username); } if (strlen($code) == 0 || strcmp($code, 'Unable to open file!') == 0) { $code = get_sample_code($exerid); } return $code; }
<?php require_once "bd.php"; require_once "model.php"; $link = db_connect(); $marks = get_marks($link); include "view.html";
<?php $exerid = $_GET['id']; if ($exerid == null || $exerid == '') { $exerid = 0; } $filename = $username . '_exer_' . $exerid; ?> <header> <a href='index.php' class='Link'></a> <span id="profile" > Xin chào <a href="#"><?php echo $username; ?> </a>(<span class="marks"><?php echo get_marks($exerid, $username); ?> </span>) | <a href="index.php">Trang chủ</a> | <a href="logout.php">Đăng xuất</a> </span> </header> <div id="content"> <?php echo '<div id="exercise-pane"></div>'; echo '<h2>Tập viết chương trình</h2>'; ?> <form method="post"> <table class="large">