exercise_jump.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * Sets needed course variables and then jumps to the exercises result page.
  4. * This intermediate page is needed because the user is not inside a course
  5. * when visiting the gradebook, and several course scripts rely on these
  6. * variables.
  7. * Most code here is ripped from /main/course_home/course_home.php
  8. * @author Bert Stepp�
  9. */
  10. $cidReq = mysql_real_escape_string($_GET['cid']);
  11. include ('../inc/global.inc.php');
  12. api_block_anonymous_users();
  13. $this_section=SECTION_COURSES;
  14. include_once (api_get_path(LIBRARY_PATH).'course.lib.php');
  15. $course_code = $_course['sysCode'];
  16. $course_info = Database::get_course_info($course_code);
  17. $return_result = CourseManager::determine_course_title_from_course_info($_user['user_id'], $course_info);
  18. $course_title = $return_result['title'];
  19. $course_code = $return_result['code'];
  20. $dbname = $course_info['db_name'];
  21. $_course['name'] = $course_title;
  22. $_course['official_code'] = $course_code;
  23. if (isset($_GET['doexercise']))
  24. {
  25. header('Location: ../exercice/exercice_submit.php?cidReq='.$cidReq.'&origin=&learnpath_id=&learnpath_item_id=&exerciseId='.Security::remove_XSS($_GET['doexercise']));
  26. exit;
  27. }
  28. else
  29. {
  30. header('Location: ../exercice/exercice.php?show=result');
  31. exit;
  32. }
  33. ?>