edit_exam.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. require_once '../inc/global.inc.php';
  4. $allow = api_get_configuration_value('extra');
  5. if (empty($allow)) {
  6. exit;
  7. }
  8. api_block_anonymous_users();
  9. Display::display_header();
  10. $tbl_stats_exercices = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
  11. $num = isset($_GET['num']) ? (int) $_GET['num'] : '';
  12. $student_idd = isset($_GET['student_id']) ? (int) $_GET['student_id'] : '';
  13. ?>
  14. <form action="update_exam.php" method="post" name="save_exam">
  15. <table class='data_table'>
  16. <tr>
  17. <th colspan="6">
  18. <?php echo get_lang('edit_save'); ?>
  19. </th>
  20. <tr>
  21. <th><?php echo get_lang('module_no'); ?></th>
  22. <th><?php echo get_lang('result_exam'); ?></th>
  23. <th><?php echo get_lang('result_rep_1'); ?></th>
  24. <th><?php echo get_lang('result_rep_2'); ?></th>
  25. <th><?php echo get_lang('comment'); ?></th>
  26. <th><?php echo get_lang('action'); ?></th>
  27. </tr>
  28. <?php
  29. $sqlexam = "SELECT * FROM $tbl_stats_exercices WHERE exe_id = $num";
  30. $resultexam = Database::query($sqlexam);
  31. while ($a_exam = Database::fetch_array($resultexam)) {
  32. $exe_id = $a_exam['exe_id'];
  33. $mod_no = $a_exam['mod_no'];
  34. $score_ex = $a_exam['score_ex'];
  35. $score_rep1 = $a_exam['score_rep1'];
  36. $score_rep2 = $a_exam['score_rep2'];
  37. $coment = $a_exam['coment'];
  38. echo "
  39. <tr>
  40. <td>
  41. <input type=text name=mod_no size=1 value= ".$a_exam['mod_no'].">
  42. </td>
  43. <td>
  44. <input type=text name=score_ex size=1 value=".$a_exam['score_ex'].">
  45. </td>
  46. <td><input type=text name=score_rep1 size=1 value=".$a_exam['score_rep1']."></td>
  47. <td><input type=text name=score_rep2 size=1 value=".$a_exam['score_rep2']."></td>
  48. <td><textarea name=\"coment\" cols=\"65\" rows=\"2\">$coment</textarea><br /></td>
  49. <INPUT type=hidden name=ex_idd value=\"$exe_id\" />
  50. <INPUT type=hidden name=student_id value=\"$student_idd\" />
  51. <td>
  52. <input type=\"submit\" value=\"".get_lang('Save')."\" name=\"B1\">
  53. </td>
  54. </tr>
  55. ";
  56. }
  57. ?>
  58. </table>
  59. </form>
  60. <?php
  61. Display::display_footer();