question_pool.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Question Pool
  5. * This script allows administrators to manage questions and add them into their exercises.
  6. * One question can be in several exercises
  7. * @package chamilo.exercise
  8. * @author Olivier Brouckaert
  9. * @version $Id: question_pool.php 20451 2009-05-10 12:02:22Z ivantcholakov $
  10. */
  11. // name of the language file that needs to be included
  12. $language_file='exercice';
  13. require_once 'exercise.class.php';
  14. require_once 'question.class.php';
  15. require_once 'answer.class.php';
  16. require_once '../inc/global.inc.php';
  17. $this_section=SECTION_COURSES;
  18. $is_allowedToEdit=api_is_allowed_to_edit(null,true);
  19. $TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
  20. $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
  21. $TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
  22. $TBL_REPONSES = Database::get_course_table(TABLE_QUIZ_ANSWER);
  23. if ( empty ( $delete ) ) {
  24. $delete = intval($_GET['delete']);
  25. }
  26. if ( empty ( $recup ) ) {
  27. $recup = intval($_GET['recup']);
  28. }
  29. if ( empty ( $fromExercise ) ) {
  30. $fromExercise = intval($_GET['fromExercise']);
  31. }
  32. if(isset($_GET['exerciseId'])){
  33. $exerciseId = intval($_GET['exerciseId']);
  34. }
  35. if(isset($_GET['exerciseLevel'])){
  36. $exerciseLevel = intval($_GET['exerciseLevel']);
  37. }
  38. if(isset($_GET['answerType'])){
  39. $answerType = intval($_GET['answerType']);
  40. }
  41. if(!empty($_GET['page'])){
  42. $page = intval($_GET['page']);
  43. }
  44. $copy_question = 0;
  45. if(!empty($_GET['copy_question'])){
  46. $copy_question = intval($_GET['copy_question']);
  47. }
  48. //only that type of question
  49. if(!empty($_GET['type'])){
  50. $type = intval($_GET['type']);
  51. }
  52. // maximum number of questions on a same page
  53. $limitQuestPage=50;
  54. // document path
  55. $documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
  56. // picture path
  57. $picturePath=$documentPath.'/images';
  58. if(!($objExcercise instanceOf Exercise) && !empty($fromExercise)) {
  59. $objExercise = new Exercise();
  60. $objExercise->read($fromExercise);
  61. }
  62. if(!($objExcercise instanceOf Exercise) && !empty($exerciseId)) {
  63. $objExercise = new Exercise();
  64. $objExercise->read($exerciseId);
  65. }
  66. if($is_allowedToEdit) {
  67. //copy exercise
  68. if ($copy_question != 0 && isset($fromExercise)) {
  69. $old_question_id = $copy_question;
  70. $old_question_obj = Question::read($old_question_id);
  71. $old_question_obj->updateTitle($old_question_obj->selectTitle().' - '.get_lang('Copy'));
  72. $new_id = $old_question_obj->duplicate();
  73. $new_question_obj = Question::read($new_id);
  74. $new_question_obj->addToList($fromExercise);
  75. $new_answer_obj = new Answer($old_question_id);
  76. $new_answer_obj->read();
  77. $new_answer_obj->duplicate($new_id);
  78. // destruction of the Question object
  79. unset($new_question_obj);
  80. unset($old_question_obj);
  81. if(!$objExcercise instanceOf Exercise) {
  82. $objExercise = new Exercise();
  83. $objExercise->read($fromExercise);
  84. }
  85. // adds the question ID represented by $recup into the list of questions for the current exercise
  86. //$objExercise->addToList($new_id);
  87. api_session_register('objExercise');
  88. header("Location: admin.php?".api_get_cidreq()."&exerciseId=$fromExercise");
  89. exit();
  90. }
  91. // deletes a question from the data base and all exercises
  92. if($delete) {
  93. // construction of the Question object
  94. // if the question exists
  95. if($objQuestionTmp = Question::read($delete))
  96. {
  97. // deletes the question from all exercises
  98. $objQuestionTmp->delete();
  99. }
  100. // destruction of the Question object
  101. unset($objQuestionTmp);
  102. } elseif($recup && $fromExercise) {
  103. // gets an existing question and copies it into a new exercise
  104. // if the question exists
  105. if($objQuestionTmp = Question :: read($recup))
  106. {
  107. // adds the exercise ID represented by $fromExercise into the list of exercises for the current question
  108. $objQuestionTmp->addToList($fromExercise);
  109. }
  110. // destruction of the Question object
  111. unset($objQuestionTmp);
  112. if(!$objExcercise instanceOf Exercise)
  113. {
  114. $objExercise = new Exercise();
  115. $objExercise->read($fromExercise);
  116. }
  117. // adds the question ID represented by $recup into the list of questions for the current exercise
  118. $objExercise->addToList($recup);
  119. api_session_register('objExercise');
  120. header("Location: admin.php?".api_get_cidreq()."&exerciseId=$fromExercise");
  121. exit();
  122. } else if( isset($_POST['recup']) && is_array($_POST['recup']) && $fromExercise) {
  123. $list_recup = $_POST['recup'];
  124. foreach ($list_recup as $recup) {
  125. $recup = intval($recup);
  126. // if the question exists
  127. if($objQuestionTmp = Question :: read($recup)) {
  128. // adds the exercise ID represented by $fromExercise into the list of exercises for the current question
  129. $objQuestionTmp->addToList($fromExercise);
  130. }
  131. // destruction of the Question object
  132. unset($objQuestionTmp);
  133. if(!$objExcercise instanceOf Exercise) {
  134. $objExercise = new Exercise();
  135. $objExercise->read($fromExercise);
  136. }
  137. // adds the question ID represented by $recup into the list of questions for the current exercise
  138. $objExercise->addToList($recup);
  139. }
  140. api_session_register('objExercise');
  141. header("Location: admin.php?".api_get_cidreq()."&exerciseId=$fromExercise");
  142. exit();
  143. }
  144. }
  145. if (isset($_SESSION['gradebook'])){
  146. $gradebook= $_SESSION['gradebook'];
  147. }
  148. if (!empty($gradebook) && $gradebook=='view') {
  149. $interbreadcrumb[]= array (
  150. 'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
  151. 'name' => get_lang('ToolGradebook')
  152. );
  153. }
  154. $nameTools=get_lang('QuestionPool');
  155. $interbreadcrumb[]=array("url" => "exercice.php","name" => get_lang('Exercices'));
  156. // if admin of course
  157. if($is_allowedToEdit)
  158. {
  159. Display::display_header($nameTools,"Exercise");
  160. ?>
  161. <h3><?php echo $nameTools; ?></h3>
  162. <div class="actions">
  163. <?php
  164. if (isset($type)) {
  165. $url = api_get_self().'?type=1';
  166. } else {
  167. $url = api_get_self();
  168. }
  169. ?>
  170. <form method="get" action="<?php echo $url; ?>" style="display:inline;">
  171. <?php
  172. if (isset($type)) {
  173. echo '<input type="hidden" name="type" value="1">';
  174. }
  175. ?>
  176. <input type="hidden" name="fromExercise" value="<?php echo $fromExercise; ?>">
  177. <?php echo get_lang('Filter'); ?> :
  178. <select name="exerciseId">
  179. <option value="0"><?php echo get_lang('AllExercises'); ?></option>
  180. <option value="-1" <?php if($exerciseId == -1) echo 'selected="selected"'; ?>><?php echo get_lang('OrphanQuestions'); ?></option>
  181. <?php
  182. $sql="SELECT id,title FROM $TBL_EXERCICES WHERE id<>'".Database::escape_string($fromExercise)."' AND active<>'-1' ORDER BY id";
  183. $result=Database::query($sql);
  184. // shows a list-box allowing to filter questions
  185. while($row=Database::fetch_array($result)) {
  186. ?>
  187. <option value="<?php echo $row['id']; ?>" <?php if($exerciseId == $row['id']) echo 'selected="selected"'; ?>><?php echo $row['title']; ?></option>
  188. <?php
  189. }
  190. ?>
  191. </select>
  192. &nbsp;
  193. <?php
  194. echo get_lang('Difficulty');
  195. echo ' : <select name="exerciseLevel">';
  196. //echo '<option value="-1">-- '.get_lang('AllExercises').' --</option>';
  197. //level difficulty only from 1 to 5
  198. if (!isset($exerciseLevel)) $exerciseLevel = -1;
  199. for ($level = -1; $level <=5; $level++) {
  200. $selected ='';
  201. if ($level!=0) {
  202. if ($exerciseLevel == $level)
  203. $selected = ' selected="selected" ';
  204. if ($level==-1) {
  205. echo '<option value="'.$level.'" '.$selected.'>'.get_lang('Any').'</option>';
  206. } else {
  207. echo '<option value="'.$level.'" '.$selected.'>'.$level.'</option>';
  208. }
  209. }
  210. }
  211. echo '</select> ';
  212. //
  213. echo get_lang('AnswerType');
  214. echo ' : <select name="answerType">';
  215. //answer type
  216. if (!isset($answerType)) $answerType = -1;
  217. {
  218. for ($answer_type = -1; $answer_type <=9; $answer_type++) {
  219. $selected ='';
  220. if ($answer_type!=0) {
  221. if ($answerType == $answer_type)
  222. $selected = ' selected="selected" ';
  223. if ($answer_type==-1) {echo '<option value="-1" '.$selected.'>'.get_lang('Any').'</option>'; } // check 0 or -1
  224. elseif ($answer_type==1) {echo '<option value="'.$answer_type.'" '.$selected.'>'.get_lang('UniqueAnswer').'</option>'; }
  225. elseif ($answer_type==2) {echo '<option value="'.$answer_type.'" '.$selected.'>'.get_lang('MultipleAnswer').'</option>'; }
  226. elseif ($answer_type==3) {echo '<option value="'.$answer_type.'" '.$selected.'>'.get_lang('langFillBlanks').'</option>'; }
  227. elseif ($answer_type==4) {echo '<option value="'.$answer_type.'" '.$selected.'>'.get_lang('langMatching').'</option>'; }
  228. elseif ($answer_type==5) {echo '<option value="'.$answer_type.'" '.$selected.'>'.get_lang('FreeAnswer').'</option>'; }
  229. elseif ($answer_type==6) {echo '<option value="'.$answer_type.'" '.$selected.'>'.get_lang('HotSpot').'</option>'; }
  230. elseif ($answer_type==9) {echo '<option value="'.$answer_type.'" '.$selected.'>'.get_lang('MultipleSelectCombination').'</option>'; }
  231. }
  232. }
  233. }
  234. echo '</select> ';
  235. ?>
  236. <button class="save" type="submit" name="name" value="<?php echo get_lang('Ok') ?>"><?php echo get_lang('Ok') ?></button>
  237. <?php
  238. echo '<a href="admin.php?',api_get_cidreq(),'&exerciseId=',$fromExercise,'">'.Display::return_icon('message_reply_forum.png', get_lang('GoBackToQuestionList')),get_lang('GoBackToQuestionList'),'</a>';
  239. /*if(!empty($fromExercise)) {
  240. echo '<a href="admin.php?',api_get_cidreq(),'&exerciseId=',$fromExercise,'">'.Display::return_icon('message_reply_forum.png', get_lang('GoBackToQuestionList')),get_lang('GoBackToQuestionList'),'</a>';
  241. } else {
  242. echo '<a href="admin.php?'.api_get_cidreq().'&newQuestion=yes">'.Display::return_icon('new_test.gif'),get_lang('NewQu').'</a>';
  243. }*/
  244. ?>
  245. </form>
  246. </div>
  247. <form method="post" action="<?php echo $url.'?'.api_get_cidreq().'&fromExercise='.$fromExercise; ?>" >
  248. <table class="data_table">
  249. <?php
  250. $from=$page*$limitQuestPage;
  251. // if we have selected an exercise in the list-box 'Filter'
  252. if ($exerciseId > 0) {
  253. //$sql="SELECT id,question,type FROM $TBL_EXERCICE_QUESTION,$TBL_QUESTIONS WHERE question_id=id AND exercice_id='".Database::escape_string($exerciseId)."' ORDER BY question_order LIMIT $from, ".($limitQuestPage + 1);
  254. $where = '';
  255. if (isset($type) && $type==1) {
  256. $where = ' type = 1 AND ';
  257. }
  258. if (isset($exerciseLevel) && $exerciseLevel != -1) {
  259. $where .= ' level='.$exerciseLevel.' AND ';
  260. }
  261. if (isset($answerType) && $answerType != -1) {
  262. $where .= ' type='.$answerType.' AND ';
  263. }
  264. $sql="SELECT id,question,type,level
  265. FROM $TBL_EXERCICE_QUESTION,$TBL_QUESTIONS
  266. WHERE $where question_id=id AND exercice_id='".Database::escape_string($exerciseId)."'
  267. ORDER BY question_order";
  268. } elseif($exerciseId == -1) {
  269. // if we have selected the option 'Orphan questions' in the list-box 'Filter'
  270. // 1. Old logic: When a test is deleted, the correspondent records in 'quiz' and 'quiz_rel_question' tables are deleted.
  271. //$sql='SELECT id, question, type, exercice_id FROM '.$TBL_QUESTIONS.' as questions LEFT JOIN '.$TBL_EXERCICE_QUESTION.' as quizz_questions ON questions.id=quizz_questions.question_id WHERE exercice_id IS NULL LIMIT $from, '.($limitQuestPage + 1);
  272. // 2. New logic: When a test is deleted, the field 'active' takes value -1 (it is in the correspondent record in 'quiz' table).
  273. //$sql='SELECT questions.id, questions.question, questions.type, quizz_questions.exercice_id FROM '.$TBL_QUESTIONS.
  274. // ' as questions LEFT JOIN '.$TBL_EXERCICE_QUESTION.' as quizz_questions ON questions.id=quizz_questions.question_id LEFT JOIN '.$TBL_EXERCICES.
  275. // ' as exercices ON exercice_id=exercices.id WHERE exercices.active = -1 LIMIT $from, '.($limitQuestPage + 1);
  276. // 3. This is more safe to changes, it is a mix between old and new logic.
  277. /*$sql='SELECT questions.id, questions.question, questions.type, quizz_questions.exercice_id FROM '.$TBL_QUESTIONS.
  278. ' as questions LEFT JOIN '.$TBL_EXERCICE_QUESTION.' as quizz_questions ON questions.id=quizz_questions.question_id LEFT JOIN '.$TBL_EXERCICES.
  279. ' as exercices ON exercice_id=exercices.id WHERE quizz_questions.exercice_id IS NULL OR exercices.active = -1 LIMIT '.$from.', '.($limitQuestPage + 1);
  280. */
  281. /* 4. Query changed because of the Level feature implemented
  282. $sql='SELECT id, question, type, exercice_id,level FROM '.$TBL_QUESTIONS.' as questions LEFT JOIN '.$TBL_EXERCICE_QUESTION.' as quizz_questions
  283. ON questions.id=quizz_questions.question_id AND exercice_id IS NULL '.
  284. (!is_null($exerciseLevel) && $exerciseLevel >= 0 ? 'WHERE level=\''.$exerciseLevel.'\' ' : '');
  285. */
  286. // 5. this is the combination of the 3 and 4 query because of the level feature implementation
  287. // we filter the type of question, because in the DirectFeedback we can only add questions with type=1 = UNIQUE_ANSWER
  288. $type_where= '';
  289. if (isset($type) && $type==1) {
  290. $type_where = ' AND questions.type = 1 ';
  291. }
  292. $level_where = '';
  293. if (isset($exerciseLevel) && $exerciseLevel!= -1 ) {
  294. $level_where = ' level='.$exerciseLevel.' AND ';
  295. }
  296. $answer_where = '';
  297. if (isset($answerType) && $answerType!= -1 ) {
  298. $answer_where = ' questions.type='.$answerType.' AND ';
  299. }
  300. $sql='SELECT questions.id, questions.question, questions.type, quizz_questions.exercice_id , level
  301. FROM '.$TBL_QUESTIONS.' as questions LEFT JOIN '.$TBL_EXERCICE_QUESTION.' as quizz_questions
  302. ON questions.id=quizz_questions.question_id LEFT JOIN '.$TBL_EXERCICES.' as exercices
  303. ON exercice_id=exercices.id
  304. WHERE '.$answer_where.' '.$level_where.' (quizz_questions.exercice_id IS NULL OR exercices.active = -1 ) '.$type_where.'
  305. LIMIT '.$from.', '.($limitQuestPage + 1);
  306. } else {
  307. // if we have not selected any option in the list-box 'Filter'
  308. //$sql="SELECT id,question,type FROM $TBL_QUESTIONS LIMIT $from, ".($limitQuestPage + 1);
  309. $where = '';
  310. if (isset($type)&& $type==1){
  311. $where = ' WHERE type = 1 ';
  312. }
  313. if (isset($exerciseLevel) && $exerciseLevel != -1) {
  314. if (strlen($where)>0)
  315. $where .= ' AND level='.$exerciseLevel.' ';
  316. else
  317. $where = ' WHERE level='.$exerciseLevel.' ';
  318. }
  319. if (isset($answerType) && $answerType != -1) {
  320. if (strlen($where)>0)
  321. $where .= ' AND type='.$answerType.' ';
  322. else
  323. $where = ' WHERE type='.$answerType.' ';
  324. }
  325. $sql="SELECT id,question,type,level FROM $TBL_QUESTIONS $where ";
  326. // forces the value to 0
  327. //echo $sql;
  328. $exerciseId=0;
  329. }
  330. $result=Database::query($sql);
  331. $nbrQuestions=Database::num_rows($result);
  332. echo '<tr>',
  333. '<td colspan="',($fromExercise?4:4),'">',
  334. '<table border="0" cellpadding="0" cellspacing="0" width="100%">',
  335. '<tr>',
  336. '<td>';
  337. echo '</td>',
  338. '<td align="right">';
  339. if(!empty($page)) {
  340. echo '<a href="',api_get_self(),'?',api_get_cidreq(),'&exerciseId=',$exerciseId,'&fromExercise=',$fromExercise,'&page=',($page-1),'">&lt;&lt; ',get_lang('PreviousPage'),'</a> | ';
  341. } elseif($nbrQuestions > $limitQuestPage) {
  342. echo '&lt;&lt; ',get_lang('PreviousPage'),' | ';
  343. }
  344. if($nbrQuestions > $limitQuestPage) {
  345. echo '<a href="',api_get_self(),'?',api_get_cidreq(),'&exerciseId=',$exerciseId,'&fromExercise=',$fromExercise,'&page=',($page+1),'">',get_lang('NextPage'),' &gt;&gt;</a>';
  346. } elseif($page) {
  347. echo ' ',get_lang('NextPage'),' &gt;&gt;';
  348. }
  349. echo '</td>
  350. </tr>
  351. </table>
  352. </td>
  353. </tr>
  354. <tr bgcolor="#e6e6e6">';
  355. if(!empty($fromExercise)) {
  356. echo '<th width="4%"> </th>',
  357. '<th>',get_lang('Question'),'</th>',
  358. '<th>',get_lang('Level'),'</th>',
  359. '<th>',get_lang('Reuse'),'</th>';
  360. } else {
  361. echo '<td width="60%" align="center">',get_lang('Question'),'</td>',
  362. '<td width="20%" align="center">',get_lang('Modify'),'</td>',
  363. '<td width="16%" align="center">',get_lang('Delete'),'</td>';
  364. }
  365. echo '</tr>';
  366. $i=1;
  367. echo '<pre>';
  368. echo '</pre>';
  369. while ($row = Database::fetch_array($result)) {
  370. // if we come from the exercise administration to get a question,
  371. // don't show the questions already used by that exercise
  372. /*if (!$fromExercise) {echo '1'; }
  373. if (!isset($objExercise)){echo '2';}
  374. if (!($objExercise instanceOf Exercise)){echo '3';}
  375. if (!$objExercise->isInList($row['id'])) {echo '4';}
  376. */
  377. // original recipe -
  378. //if (!$fromExercise || !isset($objExercise) || !($objExercise instanceOf Exercise) || (!$objExercise->isInList($row['id'])))
  379. if (!$fromExercise || !isset($objExercise) || !($objExercise instanceOf Exercise) || (is_array($objExercise->questionList)) ) {
  380. echo '<tr ',($i%2==0?'class="row_odd"':'class="row_even"'),'>';
  381. echo '<td align="center"> <input type="checkbox" value="'.$row['id'].'" name="recup[]"/></td>';
  382. echo ' <td><a href="admin.php?',api_get_cidreq(),'&editQuestion=',$row['id'],'&fromExercise=',$fromExercise,'">',$row['question'],'</a></td>';
  383. echo ' <td align="center" >';
  384. if (empty($fromExercise)) {
  385. echo '<a href="admin.php?'.api_get_cidreq().'&amp;editQuestion=',$row['id'],'"><img src="../img/edit.gif" border="0" alt="',get_lang('Modify'),'"></a>',
  386. '</td>',
  387. '<td align="center">',
  388. '<a href="',api_get_self(),'?',api_get_cidreq(),'&exerciseId=',$exerciseId,'&delete=',$row['id'],'" onclick="javascript:if(!confirm(\'',addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)),'\')) return false;"><img src="../img/delete.gif" border="0" alt="',get_lang('Delete'),'"></a>';
  389. //'<a href="',api_get_self(),'?',api_get_cidreq(),'&exerciseId=',$exerciseId,'&delete=',$row['id'],'" onclick="javascript:if(!confirm(\'',addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)),'\')) return false;"><img src="../img/delete.gif" border="0" alt="',get_lang('Delete'),'"></a>';
  390. } else {
  391. //echo $row['level'],'</td>',
  392. // '<td><a href="',api_get_self(),'?',api_get_cidreq(),'&recup=',$row['id'],'&fromExercise=',$fromExercise,'"><img src="../img/view_more_stats.gif" border="0" alt="',get_lang('Reuse'),'"></a>';
  393. echo $row['level'],'</td>',
  394. '<td align="center"><a href="',api_get_self(),'?',api_get_cidreq(),'&recup=',$row['id'],'&fromExercise=',$fromExercise,'">' .
  395. '<img src="../img/view_more_stats.gif" border="0" title="'.get_lang('Reuse').'" alt="'.get_lang('Reuse').'"></a>';
  396. echo ' <a href="',api_get_self(),'?',api_get_cidreq(),'&copy_question=',$row['id'],'&fromExercise=',$fromExercise,'">' .
  397. '<img src="../img/cd.gif" border="0" title="'.get_lang('ReUseACopyInCurrentTest').'" alt="'.get_lang('ReUseACopyInCurrentTest').'"></a>';
  398. }
  399. echo '</td>';
  400. echo '</tr>';
  401. // skips the last question, that is only used to know if we have or not to create a link "Next page"
  402. if($i == $limitQuestPage) {
  403. break;
  404. }
  405. $i++;
  406. }
  407. }
  408. if (!$nbrQuestions) {
  409. echo '<tr>',
  410. '<td colspan="',($fromExercise?4:4),'">',get_lang('NoQuestion'),'</td>',
  411. '</tr>';
  412. }
  413. echo '</table>';
  414. echo '<div style="width:100%; border-top:1px dotted #4171B5;">
  415. <button class="save" type="submit">'.get_lang('Reuse').'</button>
  416. </div></form>';
  417. Display::display_footer();
  418. } else {
  419. // if not admin of course
  420. api_not_allowed(true);
  421. }
  422. ?>