gradebook.ajax.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Responses to AJAX calls.
  5. */
  6. require_once __DIR__.'/../global.inc.php';
  7. api_protect_course_script(true);
  8. $action = $_REQUEST['a'];
  9. switch ($action) {
  10. case 'get_gradebook_weight':
  11. if (api_is_allowed_to_edit(null, true)) {
  12. $cat_id = $_GET['cat_id'];
  13. $cat = Category :: load($cat_id);
  14. if ($cat && isset($cat[0])) {
  15. echo $cat[0]->get_weight();
  16. } else {
  17. echo 0;
  18. }
  19. }
  20. break; /*
  21. case 'generate_custom_report':
  22. if (api_is_allowed_to_edit(null, true)) {
  23. $allow = api_get_configuration_value('gradebook_custom_student_report');
  24. if (!$allow) {
  25. exit;
  26. }
  27. $form = new FormValidator(
  28. 'search',
  29. 'get',
  30. api_get_path(WEB_CODE_PATH).'gradebook/index.php?'.api_get_cidreq().'&action=generate_custom_report'
  31. );
  32. $form->addText('custom_course_id', get_lang('CourseId'));
  33. $form->addDateRangePicker('range', get_lang('DateRange'));
  34. $form->addHidden('action', 'generate_custom_report');
  35. $form->addButtonSearch();
  36. $form->display();
  37. }
  38. break;*/
  39. default:
  40. echo '';
  41. break;
  42. }
  43. exit;