feedback.php 2.7 KB

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