blank.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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. * @package dokeos.survey
  18. * @author
  19. * @version $Id: blank.php 10680 2007-01-11 21:26:23Z pcool $
  20. */
  21. // name of the language file that needs to be included
  22. $language_file = 'survey';
  23. // including the global dokeos file
  24. require_once ('../inc/global.inc.php');
  25. // including additional libraries
  26. /** @todo check if these are all needed */
  27. /** @todo check if the starting / is needed. api_get_path probably ends with an / */
  28. require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
  29. require_once (api_get_path(LIBRARY_PATH)."/course.lib.php");
  30. /** @todo replace this with the correct code */
  31. /*
  32. $status = surveymanager::get_status();
  33. api_protect_course_script();
  34. if($status==5)
  35. {
  36. api_protect_admin_script();
  37. }
  38. */
  39. /** @todo this has to be moved to a more appropriate place (after the display_header of the code)*/
  40. if (!api_is_allowed_to_edit())
  41. {
  42. Display :: display_header();
  43. Display :: display_error_message(get_lang('NotAllowedHere'));
  44. Display :: display_footer();
  45. exit;
  46. }
  47. // $_GET and $_POST
  48. /** @todo replace $_REQUEST with $_GET or $_POST */
  49. $temp = $_REQUEST['temp'];
  50. $ques = $_REQUEST['ques'];
  51. $ans = $_REQUEST['ans'];
  52. $qtype = $_REQUEST['qtype'];
  53. $answers = explode("|",$ans);
  54. $count = count($answers);
  55. Display :: display_header();
  56. ?>
  57. <table width="707" border="0" cellspacing="0" cellpadding="0">
  58. <tr>
  59. <?php
  60. switch ($qtype)
  61. {
  62. /** @todo switch statement with hard coded language string => won't work in a language that is not English */
  63. case "Yes/No":
  64. {
  65. ?>
  66. <td width="100%" bgcolor="F6F5F5"><p><strong><?php echo get_lang('Question'); ?>: </strong><br />
  67. <?php echo html_entity_decode($ques);?><br />
  68. <strong><?php echo get_lang('Answers'); ?>:</strong>><br />
  69. <textarea cols="50" rows="3" disabled='true'><?php echo $answers[0];?></textarea>
  70. <input name="radiobutton" type="radio" value="radiobutton">
  71. <textarea cols="50" rows="3" disabled='true'><?php echo $answers[1];?></textarea>
  72. <input name="radiobutton" type="radio" value="radiobutton">
  73. </td>
  74. <td width="10" height="161" bgcolor="F6F5F5">&nbsp;</td>
  75. <?php
  76. break;
  77. }
  78. /** @todo switch statement with hard coded language string => won't work in a language that is not English */
  79. case "Multiple Choice (multiple answer)":
  80. {
  81. ?>
  82. <td width="100%" bgcolor="F6F5F5"><strong><?php echo get_lang('Question'); ?>:</strong><br />
  83. <?php echo $ques;?><br />
  84. <br />
  85. <strong><?php echo get_lang('Answers'); ?>: </strong><br />
  86. <?php
  87. $i=0;
  88. for($p=1;$p<$count;$i++,$p++)
  89. {
  90. ?>
  91. <textarea cols="50" rows="3" disabled="true"><?php echo $answers[$i]; ?></textarea>
  92. <input type="checkbox" name="checkbox" value="checkbox">
  93. <br />
  94. <?php
  95. }
  96. ?>
  97. </td>
  98. <td width="8" height="161" bgcolor="F6F5F5">&nbsp;</td>
  99. <?php
  100. break;
  101. }
  102. /** @todo switch statement with hard coded language string => won't work in a language that is not English */
  103. case "Multiple Choice (single answer)":
  104. {
  105. ?>
  106. <td width="100%" bgcolor="F6F5F5"><strong><?php echo get_lang('Question'); ?>:</strong><br />
  107. <?php echo $ques;?><br />
  108. <br />
  109. <strong><?php echo get_lang('Answers'); ?>:</strong><br />
  110. <?php
  111. $i=0;
  112. for($p=1;$p<$count;$i++,$p++)
  113. {
  114. ?>
  115. <textarea cols="50" rows="3" disabled='true'><?php echo $answers[$i]; ?></textarea>
  116. <input name="radiobutton" type="radio" value="radiobutton">
  117. <br />
  118. <?php
  119. }
  120. ?>
  121. </td>
  122. <td width="8" height="161" bgcolor="F6F5F5">&nbsp;</td>
  123. <?php
  124. break;
  125. }
  126. /** @todo switch statement with hard coded language string => won't work in a language that is not English */
  127. case "Open":
  128. {
  129. ?>
  130. <td width="87" bgcolor="F6F5F5"><strong><?php echo get_lang('Question'); ?>:</strong><br />
  131. <?php echo $ques;?><br />
  132. <br />
  133. <strong><?php echo get_lang('Answers'); ?>:</strong><br />
  134. <textarea style="width: 100%" name="defaultext" rows=3 cols=60></textarea>
  135. </td>
  136. <?php
  137. break;
  138. }
  139. /** @todo switch statement with hard coded language string => won't work in a language that is not English */
  140. case "Numbered":
  141. {
  142. ?>
  143. <td width="144" bgcolor="F6F5F5"><strong><?php echo get_lang('Question'); ?>:</strong><br />
  144. <?php echo $ques;?><br />
  145. <br />
  146. <strong><?php echo get_lang('Answers'); ?>: </strong><br />
  147. <?php
  148. $i=0;
  149. for($p=1;$p<$count;$i++,$p++)
  150. {
  151. ?>
  152. <textarea cols="50" rows="3" disabled='true'><?php echo $answers[$i]; ?></textarea>
  153. <select>
  154. <option value="not applicable"><?php echo get_lang('NotApplicable'); ?></option>
  155. <option value="<?php echo $i; ?>">1</option>
  156. <option value="<?php echo $i; ?>">2</option>
  157. <option value="<?php echo $i; ?>">3</option>
  158. <option value="<?php echo $i; ?>">4</option>
  159. <option value="<?php echo $i; ?>">5</option>
  160. <option value="<?php echo $i; ?>">6</option>
  161. <option value="<?php echo $i; ?>">7</option>
  162. <option value="<?php echo $i; ?>">8</option>
  163. <option value="<?php echo $i; ?>">9</option>
  164. <option value="<?php echo $i; ?>">10</option>
  165. </select>
  166. <br />
  167. <?php
  168. }
  169. echo '</td>';
  170. break;
  171. }
  172. }
  173. ?>
  174. </tr>
  175. </table>
  176. <?php
  177. Display :: display_footer();
  178. ?>