select_question.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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: select_question.php 10680 2007-01-11 21:26:23Z pcool $
  20. */
  21. // including the global dokeos file
  22. require_once ('../inc/global.inc.php');
  23. if(isset($_POST['add_question']))
  24. {
  25. $groupid=$_REQUEST['groupid'];
  26. $surveyid=$_REQUEST['surveyid'];
  27. // name of the language file that needs to be included
  28. $language_file = 'survey';
  29. $add_question=$_REQUEST['add_question'];
  30. switch ($_POST['add_question'])
  31. {
  32. case get_lang('YesNo'):
  33. header("location:yesno.php?add_question=$add_question&groupid=$groupid&surveyid=$surveyid");
  34. break;
  35. case get_lang('MultipleChoiceSingle'):
  36. header("location:mcsa.php?add_question=$add_question&groupid=$groupid&surveyid=$surveyid");
  37. break;
  38. case get_lang('MultipleChoiceMulti'):
  39. header("location:mcma.php?add_question=$add_question&groupid=$groupid&surveyid=$surveyid");
  40. break;
  41. case get_lang('Open'):
  42. header("location:open.php?add_question=$add_question&groupid=$groupid&surveyid=$surveyid");
  43. break;
  44. case get_lang('Numbered'):
  45. header("location:numbered.php?add_question=$add_question&groupid=$groupid&surveyid=$surveyid");
  46. break;
  47. default :
  48. header("location:select_question_type.php");
  49. break;
  50. }
  51. exit;
  52. }
  53. function select_question_type($add_question12,$groupid,$surveyid,$cidReq,$curr_dbname)
  54. {
  55. $sql = "SELECT groupname FROM survey_group WHERE group_id='$groupid'";
  56. $sql_result = api_sql_query($sql,__FILE__,__LINE__);
  57. $group_name = @mysql_result($sql_result,0,'groupname');
  58. ?>
  59. <table>
  60. <tr>
  61. <td><?php api_display_tool_title('Group Name :'); ?></td>
  62. <td><?php api_display_tool_title($group_name); ?></td>
  63. </tr>
  64. </table>
  65. <?php
  66. if( isset($error_message) )
  67. {
  68. Display::display_error_message($error_message);
  69. }
  70. ?>
  71. <form name="question" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
  72. <input type="hidden" name="groupid" value="<?php echo $groupid?>">
  73. <input type="hidden" name="surveyid" value="<?php echo $surveyid?>">
  74. <input type="hidden" name="curr_dbname" value="<?php echo $curr_dbname?>">
  75. <table>
  76. <tr>
  77. <td>
  78. <?php echo get_lang('Selectype');?>
  79. </td>
  80. <td>
  81. <select name="add_question" onChange="javascript:this.form.submit();">
  82. <option value="0"><?php echo get_lang('Select');?></option>
  83. <option value="<?php echo get_lang('YesNo'); ?>" <?php if($add_question12==get_lang('YesNo'))echo "selected";?>><?php echo get_lang('YesNo');?></option>
  84. <option value="<?php echo get_lang('MultipleChoiceSingle'); ?>" <?php if($add_question12==get_lang('MultipleChoiceSingle')) { echo " selected ";}?>><?php echo get_lang('MultipleChoiceSingle');?></option>
  85. <option value="<?php echo get_lang('MultipleChoiceMulti'); ?>" <?php if($add_question12==get_lang('MultipleChoiceMulti')) { echo " selected ";}?>><?php echo get_lang('MultipleChoiceMulti');?></option>
  86. <option value="<?php echo get_lang('Open'); ?>" <?php if($add_question12==get_lang('Open')) { echo "selected";}?>><?php echo get_lang('Open');?></option>
  87. <option value="<?php echo get_lang('Numbered'); ?>" <?php if($add_question12==get_lang('Numbered')) { echo "selected";}?>><?php echo get_lang('Numbered');?></option>
  88. </select>
  89. </td>
  90. </tr>
  91. </table>
  92. </form>
  93. <?php
  94. }
  95. ?>