gradebook_edit_eval.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. // $Id: gradebook_edit_eval.php 880 2007-05-07 09:32:52Z bert $
  3. /*
  4. ==============================================================================
  5. Dokeos - elearning and course management software
  6. Copyright (c) 2006 Dokeos S.A.
  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, 44 rue des palais, B-1030 Brussels, Belgium
  17. Mail: info@dokeos.com
  18. ==============================================================================
  19. */
  20. $language_file = 'gradebook';
  21. $cidReset = true;
  22. include_once ('../inc/global.inc.php');
  23. include_once ('lib/be.inc.php');
  24. include_once ('lib/gradebook_functions.inc.php');
  25. include_once ('lib/fe/evalform.class.php');
  26. api_block_anonymous_users();
  27. block_students();
  28. $evaledit = Evaluation :: load($_GET['editeval']);
  29. $form = new EvalForm(EvalForm :: TYPE_EDIT, $evaledit[0], null, 'edit_eval_form',null,api_get_self() . '?editeval=' . $_GET['editeval']);
  30. if ($form->validate()) {
  31. $values = $form->exportValues();
  32. $eval = new Evaluation();
  33. $eval->set_id($values['hid_id']);
  34. $eval->set_name($values['name']);
  35. $eval->set_description($values['description']);
  36. $eval->set_user_id($values['hid_user_id']);
  37. $eval->set_course_code($values['hid_course_code']);
  38. $eval->set_category_id($values['hid_category_id']);
  39. $eval->set_weight($values['weight']);
  40. $eval->set_date(strtotime($values['date']));
  41. $eval->set_max($values['max']);
  42. if (empty ($values['visible']))
  43. $visible = 0;
  44. else
  45. $visible = 1;
  46. $eval->set_visible($visible);
  47. $eval->save();
  48. //var_dump($values);
  49. //echo 'visible :' . $visible;
  50. header('Location: gradebook.php?editeval=&selectcat=' . $eval->get_category_id());
  51. exit;
  52. }
  53. $interbreadcrumb[] = array (
  54. 'url' => 'gradebook.php?selectcat='.$_GET['selectcat'],
  55. 'name' => get_lang('Gradebook'
  56. ));
  57. Display :: display_header(get_lang('EditEvaluation'));
  58. $form->display();
  59. Display :: display_footer();
  60. ?>