123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- <?php
- $language_file = 'survey';
- require_once ('../inc/global.inc.php');
- require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
- require_once (api_get_path(LIBRARY_PATH)."/course.lib.php");
- if (!api_is_allowed_to_edit())
- {
- Display :: display_header();
- Display :: display_error_message(get_lang('NotAllowedHere'));
- Display :: display_footer();
- exit;
- }
- $temp = $_REQUEST['temp'];
- $ques = $_REQUEST['ques'];
- $ans = $_REQUEST['ans'];
- $qtype = $_REQUEST['qtype'];
- $answers = explode("|",$ans);
- $count = count($answers);
- Display :: display_header();
- ?>
- <table width="707" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <?php
- switch ($qtype)
- {
-
- case "Yes/No":
- {
- ?>
- <td width="100%" bgcolor="F6F5F5"><p><strong><?php echo get_lang('Question'); ?>: </strong><br />
- <?php echo html_entity_decode($ques);?><br />
- <strong><?php echo get_lang('Answers'); ?>:</strong>><br />
- <textarea cols="50" rows="3" disabled='true'><?php echo $answers[0];?></textarea>
- <input name="radiobutton" type="radio" value="radiobutton">
- <textarea cols="50" rows="3" disabled='true'><?php echo $answers[1];?></textarea>
- <input name="radiobutton" type="radio" value="radiobutton">
- </td>
-
- <td width="10" height="161" bgcolor="F6F5F5"> </td>
- <?php
- break;
- }
-
-
- case "Multiple Choice (multiple answer)":
- {
- ?>
- <td width="100%" bgcolor="F6F5F5"><strong><?php echo get_lang('Question'); ?>:</strong><br />
- <?php echo $ques;?><br />
- <br />
- <strong><?php echo get_lang('Answers'); ?>: </strong><br />
- <?php
- $i=0;
- for($p=1;$p<$count;$i++,$p++)
- {
- ?>
- <textarea cols="50" rows="3" disabled="true"><?php echo $answers[$i]; ?></textarea>
- <input type="checkbox" name="checkbox" value="checkbox">
- <br />
- <?php
- }
- ?>
- </td>
- <td width="8" height="161" bgcolor="F6F5F5"> </td>
- <?php
- break;
- }
-
-
- case "Multiple Choice (single answer)":
- {
- ?>
- <td width="100%" bgcolor="F6F5F5"><strong><?php echo get_lang('Question'); ?>:</strong><br />
- <?php echo $ques;?><br />
- <br />
- <strong><?php echo get_lang('Answers'); ?>:</strong><br />
- <?php
- $i=0;
- for($p=1;$p<$count;$i++,$p++)
- {
- ?>
- <textarea cols="50" rows="3" disabled='true'><?php echo $answers[$i]; ?></textarea>
- <input name="radiobutton" type="radio" value="radiobutton">
- <br />
- <?php
- }
- ?>
- </td>
- <td width="8" height="161" bgcolor="F6F5F5"> </td>
- <?php
- break;
- }
-
-
- case "Open":
- {
- ?>
- <td width="87" bgcolor="F6F5F5"><strong><?php echo get_lang('Question'); ?>:</strong><br />
- <?php echo $ques;?><br />
- <br />
- <strong><?php echo get_lang('Answers'); ?>:</strong><br />
- <textarea style="width: 100%" name="defaultext" rows=3 cols=60></textarea>
- </td>
- <?php
- break;
- }
-
-
- case "Numbered":
- {
- ?>
- <td width="144" bgcolor="F6F5F5"><strong><?php echo get_lang('Question'); ?>:</strong><br />
- <?php echo $ques;?><br />
- <br />
- <strong><?php echo get_lang('Answers'); ?>: </strong><br />
- <?php
- $i=0;
- for($p=1;$p<$count;$i++,$p++)
- {
- ?>
- <textarea cols="50" rows="3" disabled='true'><?php echo $answers[$i]; ?></textarea>
- <select>
- <option value="not applicable"><?php echo get_lang('NotApplicable'); ?></option>
- <option value="<?php echo $i; ?>">1</option>
- <option value="<?php echo $i; ?>">2</option>
- <option value="<?php echo $i; ?>">3</option>
- <option value="<?php echo $i; ?>">4</option>
- <option value="<?php echo $i; ?>">5</option>
- <option value="<?php echo $i; ?>">6</option>
- <option value="<?php echo $i; ?>">7</option>
- <option value="<?php echo $i; ?>">8</option>
- <option value="<?php echo $i; ?>">9</option>
- <option value="<?php echo $i; ?>">10</option>
- </select>
- <br />
- <?php
- }
- echo '</td>';
- break;
- }
- }
- ?>
- </tr>
- </table>
- <?php
- Display :: display_footer();
- ?>
|