feedback.php 2.2 KB

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