gradebook.ajax.php 581 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Responses to AJAX calls
  5. */
  6. require_once '../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. default:
  22. echo '';
  23. }
  24. exit;