preview_yesno.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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: preview_yesno.php 10680 2007-01-11 21:26:23Z pcool $
  20. */
  21. /*
  22. ==============================================================================
  23. INIT SECTION
  24. ==============================================================================
  25. */
  26. // name of the language file that needs to be included
  27. $language_file = 'survey';
  28. // including the global dokeos file
  29. require_once ('../inc/global.inc.php');
  30. // including additional libraries
  31. /** @todo check if these are all needed */
  32. /** @todo check if the starting / is needed. api_get_path probably ends with an / */
  33. require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
  34. require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
  35. require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
  36. require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
  37. /** @todo replace this with the correct code */
  38. /*
  39. $status = surveymanager::get_status();
  40. api_protect_course_script();
  41. if($status==5)
  42. {
  43. api_protect_admin_script();
  44. }
  45. */
  46. /** @todo this has to be moved to a more appropriate place (after the display_header of the code)*/
  47. if (!api_is_allowed_to_edit())
  48. {
  49. Display :: display_header();
  50. Display :: display_error_message(get_lang('NotAllowedHere'));
  51. Display :: display_footer();
  52. exit;
  53. }
  54. // Database table definitions
  55. $table_category = Database :: get_main_table(TABLE_MAIN_CATEGORY);
  56. $table_survey = Database :: get_main_table(TABLE_MAIN_SURVEY);
  57. $table_group = Database :: get_main_table(TABLE_MAIN_GROUP);
  58. $table_survey_question = Database :: get_main_table(TABLE_MAIN_SURVEYQUESTION);
  59. $tool_name = get_lang('ViewQuestions');
  60. $header1 = get_lang('SurveyName');
  61. $header2 = get_lang('GroupName');
  62. $header3 = get_lang('Type');
  63. $interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('Survey'));
  64. $questionid = '1';
  65. $surveyid = $_REQUEST['surveyid'];
  66. $groupid = $_REQUEST['groupid'];
  67. $qid = 'Yes/No';
  68. if(isset($_REQUEST['back']))
  69. {
  70. $surveyid = $_REQUEST['surveyid'];
  71. $groupid = $_REQUEST['groupid'];
  72. header("location:mcma.php?groupid=$groupid&surveyid=$surveyid");
  73. exit;
  74. }
  75. /*
  76. -----------------------------------------------------------
  77. Libraries
  78. -----------------------------------------------------------
  79. */
  80. /*
  81. ==============================================================================
  82. FUNCTIONS
  83. ==============================================================================
  84. */
  85. /*
  86. ==============================================================================
  87. MAIN CODE
  88. ==============================================================================
  89. */
  90. Display::display_header($tool_name);
  91. $ques_id = $_GET['qid'];
  92. $gname=surveymanager::ques_id_group_name($ques_id);
  93. $ques_type = $_GET['qtype'];
  94. ?>
  95. <form name="question" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
  96. <input type="hidden" name="action" value="add_question">
  97. <input type="hidden" name="groupid" value="<?php echo $groupid; ?>">
  98. <input type="hidden" name="surveyid" value="<?php echo $surveyid; ?>">
  99. <table>
  100. <tr>
  101. <td><?php api_display_tool_title($header1) ?></td>
  102. <?php $surveyname = surveymanager::get_surveyname($surveyid); ?>
  103. <td><?php api_display_tool_title($surveyname)?></td>
  104. </tr>
  105. <tr>
  106. <td><?php api_display_tool_title($header2); ?></td>
  107. <?php $groupname = surveymanager::get_groupname($groupid); ?>
  108. <td><?php api_display_tool_title($groupname); ?></td>
  109. </tr>
  110. <tr>
  111. <td><?php api_display_tool_title($header3); ?></td>
  112. <td><?php api_display_tool_title($qid); ?></td>
  113. </tr>
  114. <tr>
  115. <td><?php echo get_lang('Question'); ?></td>
  116. </tr>
  117. <tr>
  118. <td><textarea cols="50" rows="6" name="questions"> <?php echo $enterquestion;?></textarea></td>
  119. </tr>
  120. <tr>
  121. <td></br><?php echo get_lang('Answer'); ?></td>
  122. </tr>
  123. <tr>
  124. <?php
  125. for($i=1;$i<=2;$i++)
  126. {
  127. ?><tr><td><textarea cols="50" rows="3" name="yes"><?php echo $mutlichkboxtext[$i];?></textarea></td></tr>
  128. <?php
  129. }
  130. ?>
  131. <tr>
  132. <td></br><input type="submit" name="back" value="<?php echo get_lang('Back'); ?> "></td>
  133. <!-- <td></br><input type="submit" value="<?php echo get_lang('Import'); ?>"></td>-->
  134. </tr>
  135. </table>
  136. </form>
  137. <?php
  138. //<textarea rows="4" name="comment"></textarea>
  139. /*
  140. ==============================================================================
  141. FOOTER
  142. ==============================================================================
  143. */
  144. Display :: display_footer();
  145. ?>