feedback.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. include('exercise.class.php');
  3. include('question.class.php');
  4. include('answer.class.php');
  5. include('exercise.lib.php');
  6. $langFile='exercice';
  7. include("../inc/global.inc.php");
  8. $this_section=SECTION_COURSES;
  9. include_once(api_get_path(LIBRARY_PATH).'fileUpload.lib.php');
  10. include_once(api_get_path(LIBRARY_PATH).'document.lib.php');
  11. include_once(api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
  12. $nameTools=get_lang('ExerciseManagement');
  13. $interbreadcrumb[]=array("url" => "exercice.php","name" => get_lang('Exercices'));
  14. Display::display_header($nameTools,"Exercise");
  15. ?>
  16. <table border="0" align="center" cellpadding="2" cellspacing="2" width="100%">
  17. <h4>
  18. <?php echo "Add Feedback"; ?>
  19. </h4>
  20. <?php
  21. $id = $_REQUEST['question'];
  22. $objQuestionTmp=new Question();
  23. $objQuestionTmp->read($id);
  24. echo "<tr><td><b>".get_lang('Question')." : </b>";
  25. echo $objQuestionTmp->selectTitle();
  26. echo "</td></tr>";
  27. echo " <br><tr><td><b><br>".get_lang('Answer')." : </b></td></tr>";
  28. $objAnswerTmp=new Answer($id);
  29. $num = $objAnswerTmp->selectNbrAnswers();
  30. $objAnswerTmp->read();
  31. for($i=1;$i<=$num;$i++)
  32. {
  33. echo "<tr><td width='10%'> ";
  34. $ans = $objAnswerTmp->answer[$i];
  35. $fck_attribute['Width'] = '600';
  36. $fck_attribute['Height'] = '200';
  37. $fck_attribute['ToolbarSet'] = 'Comment';
  38. $form = new FormValidator('feedbackform','post',$_SERVER['PHP_SELF']."?modifyQuestion=".$modifyQuestion."&newQuestion=".$newQuestion);
  39. $obj_registration_form = new HTML_QuickForm('frmRegistration', 'POST');
  40. $renderer =& $obj_registration_form->defaultRenderer();
  41. $renderer->setElementTemplate(
  42. '<tr>
  43. <td align="left" style="" valign="top" width=30%>{label}
  44. <!-- BEGIN required --><span style="color: #ff0000">*</span><!-- END required -->
  45. </td>
  46. <td align="left" width=70%>{element}
  47. <!-- BEGIN error --><br /><span style="color: #ff0000;font-size:10px">{error}</span><!-- END error -->
  48. </td>
  49. </tr>'
  50. );
  51. $form->add_html_editor('Feedback',$i.'.'.$ans,false);
  52. $form->display();
  53. echo "</td>";
  54. }?>
  55. <form name="frm" action="#" method="post">
  56. Click Ok to finish <input type="submit" value="Ok" />
  57. </form>