feedback.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. include("../inc/global.inc.php");
  11. $this_section=SECTION_COURSES;
  12. $nameTools=get_lang('ExerciseManagement');
  13. if (isset($_SESSION['gradebook'])){
  14. $gradebook= $_SESSION['gradebook'];
  15. }
  16. if (!empty($gradebook) && $gradebook=='view') {
  17. $interbreadcrumb[]= array (
  18. 'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
  19. 'name' => get_lang('ToolGradebook')
  20. );
  21. }
  22. $interbreadcrumb[]=array("url" => "exercise.php","name" => get_lang('Exercises'));
  23. Display::display_header($nameTools,"Exercises");
  24. ?>
  25. <table border="0" align="center" cellpadding="2" cellspacing="2" width="100%">
  26. <h4>
  27. <?php echo "Add Feedback"; ?>
  28. </h4>
  29. <?php
  30. $id = $_REQUEST['question'];
  31. $objQuestionTmp = Question::read($id);
  32. echo "<tr><td><b>".get_lang('Question')." : </b>";
  33. echo $objQuestionTmp->selectTitle();
  34. echo "</td></tr>";
  35. echo " <br><tr><td><b><br>".get_lang('Answer')." : </b></td></tr>";
  36. $objAnswerTmp=new Answer($id);
  37. $num = $objAnswerTmp->selectNbrAnswers();
  38. $objAnswerTmp->read();
  39. for($i=1;$i<=$num;$i++)
  40. {
  41. echo "<tr><td width='10%'> ";
  42. $ans = $objAnswerTmp->answer[$i];
  43. $form = new FormValidator('feedbackform','post',api_get_self()."?".api_get_cidreq()."&modifyQuestion=".$modifyQuestion."&newQuestion=".$newQuestion);
  44. $obj_registration_form = new HTML_QuickForm('frmRegistration', 'POST');
  45. $renderer =& $obj_registration_form->defaultRenderer();
  46. $renderer->setCustomElementTemplate(
  47. '<tr>
  48. <td align="left" style="" valign="top" width=30%>{label}
  49. <!-- BEGIN required --><span style="color: #ff0000">*</span><!-- END required -->
  50. </td>
  51. <td align="left" width=70%>{element}
  52. <!-- BEGIN error --><br /><span style="color: #ff0000;font-size:10px">{error}</span><!-- END error -->
  53. </td>
  54. </tr>');
  55. $form->addHtmlEditor('Feedback', $i.'.'.$ans, false, false, array('ToolbarSet' => 'TestAnswerFeedback', 'Width' => '600', 'Height' => '200'));
  56. $form->display();
  57. echo "</td>";
  58. }?>
  59. <form name="frm" action="javascript: void(0);" method="post">
  60. Click Ok to finish <input type="submit" value="Ok" />
  61. </form>