exercise_jump.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php //$id $
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Sets needed course variables and then jumps to the exercises result page.
  5. * This intermediate page is needed because the user is not inside a course
  6. * when visiting the gradebook, and several course scripts rely on these
  7. * variables.
  8. * Most code here is ripped from /main/course_home/course_home.php
  9. * @author Bert Steppé
  10. * @package chamilo.gradebook
  11. */
  12. /**
  13. * Init
  14. */
  15. require_once '../inc/global.inc.php';
  16. api_block_anonymous_users();
  17. $this_section=SECTION_COURSES;
  18. $course_code = api_get_course_id();
  19. $course_info = Database::get_course_info($course_code);
  20. $course_title = $course_info['title'];
  21. $course_code = $return_result['code'];
  22. $gradebook=Security::remove_XSS($_GET['gradebook']);
  23. $dbname = $course_info['db_name'];
  24. $_course['name'] = $course_title;
  25. $_course['official_code'] = $course_code;
  26. if (isset($_GET['doexercise'])) {
  27. header('Location: ../exercice/overview.php?cidReq='.$cidReq.'&gradebook='.$gradebook.'&origin=&learnpath_id=&learnpath_item_id=&exerciseId='.intval($_GET['doexercise']));
  28. exit;
  29. } else {
  30. if (isset($_GET['gradebook'])) {
  31. $add_url = '&gradebook=view&exerciseId='.intval($_GET['exerciseId']);
  32. }
  33. header('Location: ../exercice/exercice.php?cidReq='.Security::remove_XSS($cidReq).'&show=result'.$add_url);
  34. exit;
  35. }