create_exam.php 1.0 KB

1234567891011121314151617181920212223
  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. $table = Database:: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
  9. $ex_user_id = isset($_GET['ex_user_id']) ? (int) $_GET['ex_user_id'] : '';
  10. $mod_no = isset($_GET['mod_no']) ? Database::escape_string($_GET['mod_no']) : '';
  11. $score_ex = isset($_GET['score_ex']) ? Database::escape_string($_GET['score_ex']) : '';
  12. $score_rep1 = isset($_GET['score_rep1']) ? Database::escape_string($_GET['score_rep1']) : '';
  13. $score_rep2 = isset($_GET['score_rep2']) ? Database::escape_string($_GET['score_rep2']) : '';
  14. $coment = isset($_GET['coment']) ? Database::escape_string($_GET['coment']) : '';
  15. $sql = "INSERT INTO $table (exe_user_id, c_id, mod_no, score_ex, score_rep1, score_rep2, coment)
  16. VALUES ($ex_user_id, 0, '$mod_no', '$score_ex', '$score_rep1', '$score_rep2', '$coment')";
  17. Database::query($sql);
  18. header("location: myStudents.php?student=$ex_user_id");
  19. exit;