feedback.php 2.6 KB

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