exercise_jump.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  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 = api_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. $session_id = api_get_session_id();
  24. $cidReq = Security::remove_XSS($_GET['cidReq']);
  25. $_course['name'] = $course_title;
  26. $_course['official_code'] = $course_code;
  27. if (isset($_GET['doexercise'])) {
  28. header('Location: ../exercice/overview.php?session_id='.$session_id.'&cidReq='.$cidReq.'&gradebook='.$gradebook.'&origin=&learnpath_id=&learnpath_item_id=&exerciseId='.intval($_GET['doexercise']));
  29. exit;
  30. } else {
  31. if (isset($_GET['gradebook'])) {
  32. $add_url = '&gradebook=view&exerciseId='.intval($_GET['exerciseId']);
  33. }
  34. header('Location: ../exercice/exercice.php??session_id='.$session_id.'&cidReq='.Security::remove_XSS($cidReq).'&show=result'.$add_url);
  35. exit;
  36. }