feedback.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 des Palais 44 Paleizenstraat
  13. B-1030 Brussels - Belgium
  14. Tel. +32 (2) 211 34 56
  15. */
  16. // Note by Ivan Tcholakov, 14-JUL-2009: I can't see where this file is used. Is it obsolete?
  17. /**
  18. * Feedback
  19. * @package dokeos.exercise
  20. * @author
  21. * @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $
  22. */
  23. include('exercise.class.php');
  24. include('question.class.php');
  25. include('answer.class.php');
  26. include('exercise.lib.php');
  27. // name of the language file that needs to be included
  28. $language_file='exercice';
  29. include("../inc/global.inc.php");
  30. $this_section=SECTION_COURSES;
  31. include_once(api_get_path(LIBRARY_PATH).'fileUpload.lib.php');
  32. include_once(api_get_path(LIBRARY_PATH).'document.lib.php');
  33. include_once(api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
  34. $nameTools=get_lang('ExerciseManagement');
  35. if (isset($_SESSION['gradebook'])){
  36. $gradebook= $_SESSION['gradebook'];
  37. }
  38. if (!empty($gradebook) && $gradebook=='view') {
  39. $interbreadcrumb[]= array (
  40. 'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
  41. 'name' => get_lang('Gradebook')
  42. );
  43. }
  44. $interbreadcrumb[]=array("url" => "exercice.php","name" => get_lang('Exercices'));
  45. Display::display_header($nameTools,"Exercise");
  46. ?>
  47. <table border="0" align="center" cellpadding="2" cellspacing="2" width="100%">
  48. <h4>
  49. <?php echo "Add Feedback"; ?>
  50. </h4>
  51. <?php
  52. $id = $_REQUEST['question'];
  53. $objQuestionTmp = Question::read($id);
  54. echo "<tr><td><b>".get_lang('Question')." : </b>";
  55. echo $objQuestionTmp->selectTitle();
  56. echo "</td></tr>";
  57. echo " <br><tr><td><b><br>".get_lang('Answer')." : </b></td></tr>";
  58. $objAnswerTmp=new Answer($id);
  59. $num = $objAnswerTmp->selectNbrAnswers();
  60. $objAnswerTmp->read();
  61. for($i=1;$i<=$num;$i++)
  62. {
  63. echo "<tr><td width='10%'> ";
  64. $ans = $objAnswerTmp->answer[$i];
  65. $form = new FormValidator('feedbackform','post',api_get_self()."?modifyQuestion=".$modifyQuestion."&newQuestion=".$newQuestion);
  66. $obj_registration_form = new HTML_QuickForm('frmRegistration', 'POST');
  67. $renderer =& $obj_registration_form->defaultRenderer();
  68. $renderer->setElementTemplate(
  69. '<tr>
  70. <td align="left" style="" valign="top" width=30%>{label}
  71. <!-- BEGIN required --><span style="color: #ff0000">*</span><!-- END required -->
  72. </td>
  73. <td align="left" width=70%>{element}
  74. <!-- BEGIN error --><br /><span style="color: #ff0000;font-size:10px">{error}</span><!-- END error -->
  75. </td>
  76. </tr>');
  77. $form->add_html_editor('Feedback', $i.'.'.$ans, false, false, array('ToolbarSet' => 'TestAnswerFeedback', 'Width' => '600', 'Height' => '200'));
  78. $form->display();
  79. echo "</td>";
  80. }?>
  81. <form name="frm" action="javascript: void(0);" method="post">
  82. Click Ok to finish <input type="submit" value="Ok" />
  83. </form>