exercice_history.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <?php
  2. /*
  3. DOKEOS - elearning and course management software
  4. For a full list of contributors, see documentation/credits.html
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. See "documentation/licence.html" more details.
  10. Contact:
  11. Dokeos
  12. Rue du Corbeau, 108
  13. B-1030 Brussels - Belgium
  14. info@dokeos.com
  15. */
  16. /**
  17. * Exercise list: This script shows the list of exercises for administrators and students.
  18. * @package dokeos.exercise
  19. * @author Olivier Brouckaert, original author
  20. * @author Denes Nagy, HotPotatoes integration
  21. * @author Wolfgang Schneider, code/html cleanup
  22. * @version $Id:exercice.php 12269 2007-05-03 14:17:37Z elixir_julian $
  23. */
  24. // name of the language file that needs to be included
  25. $language_file='exercice';
  26. require_once('../inc/global.inc.php');
  27. $this_section=SECTION_COURSES;
  28. api_protect_course_script(true);
  29. $show=(isset($_GET['show']) && $_GET['show'] == 'result')?'result':'test'; // moved down to fix bug: http://www.dokeos.com/forum/viewtopic.php?p=18609#18609
  30. /*
  31. -----------------------------------------------------------
  32. Libraries
  33. -----------------------------------------------------------
  34. */
  35. require_once(api_get_path(LIBRARY_PATH).'document.lib.php');
  36. include(api_get_path(LIBRARY_PATH).'mail.lib.inc.php');
  37. include(api_get_path(LIBRARY_PATH).'usermanager.lib.php');
  38. /*
  39. -----------------------------------------------------------
  40. Constants and variables
  41. -----------------------------------------------------------
  42. */
  43. $is_allowedToEdit = api_is_allowed_to_edit();
  44. $is_tutor = api_is_allowed_to_edit(true);
  45. if(!$is_allowedToEdit){
  46. header('Location: /main/exercice/exercice.php?cidReq='.Security::Remove_XSS($_GET['cidReq']));
  47. exit;
  48. }
  49. $TBL_USER = Database::get_main_table(TABLE_MAIN_USER);
  50. $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
  51. $TBL_EXERCICES_QUESTION = Database::get_course_table(TABLE_QUIZ_QUESTION);
  52. $TBL_TRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
  53. $TBL_TRACK_ATTEMPT_RECORDING= Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
  54. //$nameTools=get_lang('Exercices');
  55. Display::display_header($nameTools,"Exercise");
  56. if(isset($_GET['message']))
  57. {
  58. if (in_array($_GET['message'], array('ExerciseEdited')))
  59. {
  60. Display::display_confirmation_message(get_lang($_GET['message']));
  61. }
  62. }
  63. //include_once(api_get_path(LIBRARY_PATH).'events.lib.inc.php');
  64. //event_access_tool(TOOL_QUIZ);
  65. ?>
  66. <a href="exercice.php?cidReq=<?php echo $_GET['cidReq'] ?>&show=result"><< <?php echo get_lang('Back') ?></a>
  67. <table class="data_table">
  68. <tr class="row_odd">
  69. <th><?php echo get_lang('Question'); ?></th>
  70. <th><?php echo get_lang('Value'); ?></th>
  71. <th><?php echo get_lang('Feedback'); ?></th>
  72. <th><?php echo get_lang('Date'); ?></th>
  73. <th><?php echo get_lang('Author'); ?></th>
  74. </tr>
  75. <?php
  76. //Display::display_introduction_section(TOOL_QUIZ);
  77. /*
  78. $sql = 'SELECT * FROM '.$TBL_EXERCICES;
  79. $query = api_sql_query($sql,__FILE__,__LINE__);
  80. */
  81. $sql = "SELECT *, quiz_question.question, CONCAT(firstname,' ',lastname) as full_name FROM $TBL_TRACK_ATTEMPT_RECORDING,$TBL_USER,$TBL_EXERCICES_QUESTION quiz_question WHERE quiz_question.id = question_id AND user_id = author AND exe_id = '".(int)$_GET['exe_id']."' ORDER BY question ASC";
  82. $query = api_sql_query($sql,__FILE__,__LINE__);
  83. while($row = mysql_fetch_array($query)){
  84. echo '<tr';
  85. if($i%2==0) echo 'class="row_odd"'; else echo 'class="row_even"';
  86. echo '>';
  87. echo '<td>'.$row['question'].'</td>';
  88. echo '<td>'.get_lang('NewScore').': '.$row['marks'].'</td>';
  89. if(!empty($row['teacher_comment'])){
  90. echo '<td>'.get_lang('NewComment').': '.$row['teacher_comment'].'</td>';
  91. } else {
  92. echo '<td>'.get_lang('WithoutComment').'</td>';
  93. }
  94. echo '<td>'.$row['insert_date'].'</td>';
  95. echo '<td>'.(empty($row['full_name'])?'<i>'.get_lang('OriginalValue').'</i>':$row['full_name']).'</td>';
  96. echo '</tr>';
  97. }
  98. echo '</table>';
  99. Display::display_footer();
  100. ?>