update_exam.php 1.2 KB

12345678910111213141516171819202122232425262728
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. require_once '../inc/global.inc.php';
  4. $allow = api_get_configuration_value('extra');
  5. if (empty($allow)) {
  6. exit;
  7. }
  8. $tbl_stats_exercices = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
  9. $ex_idd = isset($_POST['exe_id']) ? (int) $_POST['exe_id'] : '';
  10. $ex_user_id = isset($_POST['ex_user_id']) ? (int) $_POST['ex_user_id'] : '';
  11. $mod_no = isset($_POST['mod_no']) ? Database::escape_string($_POST['mod_no']) : '';
  12. $score_ex = isset($_POST['score_ex']) ? Database::escape_string($_POST['score_ex']) : '';
  13. $score_rep1 = isset($_POST['score_rep1']) ? Database::escape_string($_POST['score_rep1']) : '';
  14. $score_rep2 = isset($_POST['score_rep2']) ? Database::escape_string($_POST['score_rep2']) : '';
  15. $coment = isset($_POST['coment']) ? Database::escape_string($_POST['coment']) : '';
  16. $student_id = isset($_POST['student_id']) ? Database::escape_string($_POST['student_id']) : '';
  17. $sql = "UPDATE $tbl_stats_exercices SET
  18. mod_no='$mod_no', score_ex='$score_ex', score_rep1='$score_rep1', score_rep2='$score_rep2', coment='$coment'
  19. WHERE exe_id = '$ex_idd'
  20. ";
  21. Database::query($sql);
  22. header("location:../extra/myStudents.php?student=$student_id");
  23. exit;