feedback.php 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. /*
  3. DOKEOS - elearning and course management software
  4. For a full list of contributors, see documentation/credits.html
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. See "documentation/licence.html" more details.
  10. Contact:
  11. Dokeos
  12. Rue des Palais 44 Paleizenstraat
  13. B-1030 Brussels - Belgium
  14. Tel. +32 (2) 211 34 56
  15. */
  16. /**
  17. * Feedback
  18. * @package dokeos.exercise
  19. * @author
  20. * @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $
  21. */
  22. include('exercise.class.php');
  23. include('question.class.php');
  24. include('answer.class.php');
  25. include('exercise.lib.php');
  26. // name of the language file that needs to be included
  27. $language_file='exercice';
  28. include("../inc/global.inc.php");
  29. $this_section=SECTION_COURSES;
  30. include_once(api_get_path(LIBRARY_PATH).'fileUpload.lib.php');
  31. include_once(api_get_path(LIBRARY_PATH).'document.lib.php');
  32. include_once(api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
  33. $nameTools=get_lang('ExerciseManagement');
  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. $fck_attribute['Width'] = '600';
  56. $fck_attribute['Height'] = '200';
  57. $fck_attribute['ToolbarSet'] = 'Small';
  58. $fck_attribute['Config']['IMUploadPath'] = 'upload/test/';
  59. $fck_attribute['Config']['InDocument'] = false;
  60. $fck_attribute['Config']['CreateDocumentDir'] = '../../courses/'.api_get_course_path().'/document/';
  61. $form = new FormValidator('feedbackform','post',api_get_self()."?modifyQuestion=".$modifyQuestion."&newQuestion=".$newQuestion);
  62. $obj_registration_form = new HTML_QuickForm('frmRegistration', 'POST');
  63. $renderer =& $obj_registration_form->defaultRenderer();
  64. $renderer->setElementTemplate(
  65. '<tr>
  66. <td align="left" style="" valign="top" width=30%>{label}
  67. <!-- BEGIN required --><span style="color: #ff0000">*</span><!-- END required -->
  68. </td>
  69. <td align="left" width=70%>{element}
  70. <!-- BEGIN error --><br /><span style="color: #ff0000;font-size:10px">{error}</span><!-- END error -->
  71. </td>
  72. </tr>'
  73. );
  74. $form->add_html_editor('Feedback',$i.'.'.$ans,false);
  75. $form->display();
  76. echo "</td>";
  77. }?>
  78. <form name="frm" action="#" method="post">
  79. Click Ok to finish <input type="submit" value="Ok" />
  80. </form>