exercise_jump.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php //$id $
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2008 Dokeos Latinoamerica SAC
  6. Copyright (c) 2006 Dokeos SPRL
  7. Copyright (c) 2006 Ghent University (UGent)
  8. Copyright (c) various contributors
  9. For a full list of contributors, see "credits.txt".
  10. The full license can be read in "license.txt".
  11. This program is free software; you can redistribute it and/or
  12. modify it under the terms of the GNU General Public License
  13. as published by the Free Software Foundation; either version 2
  14. of the License, or (at your option) any later version.
  15. See the GNU General Public License for more details.
  16. Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
  17. Mail: info@dokeos.com
  18. ==============================================================================
  19. */
  20. /**
  21. * Sets needed course variables and then jumps to the exercises result page.
  22. * This intermediate page is needed because the user is not inside a course
  23. * when visiting the gradebook, and several course scripts rely on these
  24. * variables.
  25. * Most code here is ripped from /main/course_home/course_home.php
  26. * @author Bert Steppé
  27. */
  28. require_once ('../inc/global.inc.php');
  29. api_block_anonymous_users();
  30. $this_section=SECTION_COURSES;
  31. require_once (api_get_path(LIBRARY_PATH).'course.lib.php');
  32. $course_code = api_get_course_id();
  33. $course_info = Database::get_course_info($course_code);
  34. $course_title = $course_info['title'];
  35. $course_code = $return_result['code'];
  36. $gradebook=Security::remove_XSS($_GET['gradebook']);
  37. $dbname = $course_info['db_name'];
  38. $_course['name'] = $course_title;
  39. $_course['official_code'] = $course_code;
  40. if (isset($_GET['doexercise'])) {
  41. header('Location: ../exercice/exercice_submit.php?cidReq='.$cidReq.'&gradebook='.$gradebook.'&origin=&learnpath_id=&learnpath_item_id=&exerciseId='.Security::remove_XSS($_GET['doexercise']));
  42. exit;
  43. } else {
  44. if (isset($_GET['gradebook'])) {
  45. $add_url = '&gradebook=view&exerciseId='.Security::remove_XSS((int)$_GET['exerciseId']);
  46. }
  47. header('Location: ../exercice/exercice.php?cidReq='.Security::remove_XSS($cidReq).'&show=result'.$add_url);
  48. exit;
  49. }