delete_exam.php 534 B

12345678910111213141516171819202122
  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. api_block_anonymous_users();
  9. $ex_user_id = isset($_GET['student_id']) ? (int) $_GET['student_id'] : 0;
  10. $num = isset($_GET['num']) ? (int) $_GET['num'] : 0;
  11. $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
  12. $sql = "DELETE FROM $table WHERE exe_id = $num";
  13. Database::query($sql);
  14. header("location: myStudents.php?student=$ex_user_id");
  15. exit;