admin.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Exercise administration
  5. * This script allows to manage (create, modify) an exercise and its questions
  6. *
  7. * Following scripts are includes for a best code understanding :
  8. *
  9. * - exercise.class.php : for the creation of an Exercise object
  10. * - question.class.php : for the creation of a Question object
  11. * - answer.class.php : for the creation of an Answer object
  12. * - exercise.lib.php : functions used in the exercise tool
  13. * - exercise_admin.inc.php : management of the exercise
  14. * - question_admin.inc.php : management of a question (statement & answers)
  15. * - statement_admin.inc.php : management of a statement
  16. * - answer_admin.inc.php : management of answers
  17. * - question_list_admin.inc.php : management of the question list
  18. *
  19. * Main variables used in this script :
  20. *
  21. * - $is_allowedToEdit : set to 1 if the user is allowed to manage the exercise
  22. * - $objExercise : exercise object
  23. * - $objQuestion : question object
  24. * - $objAnswer : answer object
  25. * - $aType : array with answer types
  26. * - $exerciseId : the exercise ID
  27. * - $picturePath : the path of question pictures
  28. * - $newQuestion : ask to create a new question
  29. * - $modifyQuestion : ID of the question to modify
  30. * - $editQuestion : ID of the question to edit
  31. * - $submitQuestion : ask to save question modifications
  32. * - $cancelQuestion : ask to cancel question modifications
  33. * - $deleteQuestion : ID of the question to delete
  34. * - $moveUp : ID of the question to move up
  35. * - $moveDown : ID of the question to move down
  36. * - $modifyExercise : ID of the exercise to modify
  37. * - $submitExercise : ask to save exercise modifications
  38. * - $cancelExercise : ask to cancel exercise modifications
  39. * - $modifyAnswers : ID of the question which we want to modify answers for
  40. * - $cancelAnswers : ask to cancel answer modifications
  41. * - $buttonBack : ask to go back to the previous page in answers of type "Fill in blanks"
  42. *
  43. * @package chamilo.exercise
  44. * @author Olivier Brouckaert
  45. * Modified by Hubert Borderiou 21-10-2011 Question by category
  46. */
  47. /**
  48. * Code
  49. */
  50. use \ChamiloSession as Session;
  51. require_once 'exercise.class.php';
  52. require_once 'question.class.php';
  53. require_once 'answer.class.php';
  54. // Name of the language file that needs to be included
  55. $language_file = 'exercice';
  56. require_once '../inc/global.inc.php';
  57. require_once 'exercise.lib.php';
  58. $current_course_tool = TOOL_QUIZ;
  59. $this_section = SECTION_COURSES;
  60. // Access control
  61. api_protect_course_script(true);
  62. $is_allowedToEdit = api_is_allowed_to_edit(null, true);
  63. if (!$is_allowedToEdit) {
  64. api_not_allowed(true);
  65. }
  66. /* stripslashes POST data */
  67. if ($_SERVER['REQUEST_METHOD'] == 'POST') {
  68. foreach ($_POST as $key => $val) {
  69. if (is_string($val)) {
  70. $_POST[$key] = stripslashes($val);
  71. } elseif (is_array($val)) {
  72. foreach ($val as $key2 => $val2) {
  73. $_POST[$key][$key2] = stripslashes($val2);
  74. }
  75. }
  76. $GLOBALS[$key] = $_POST[$key];
  77. }
  78. }
  79. // get vars from GET
  80. if (empty($exerciseId)) {
  81. $exerciseId = isset($_GET['exerciseId'])?intval($_GET['exerciseId']):'0';
  82. }
  83. if (empty($newQuestion)) {
  84. $newQuestion = isset($_GET['newQuestion'])?$_GET['newQuestion']:0;
  85. }
  86. if (empty($modifyAnswers)) {
  87. $modifyAnswers = isset($_GET['modifyAnswers'])?$_GET['modifyAnswers']:0;
  88. }
  89. if (empty($editQuestion)) {
  90. $editQuestion = isset($_GET['editQuestion'])?$_GET['editQuestion']:0;
  91. }
  92. if (empty($modifyQuestion)) {
  93. $modifyQuestion = isset($_GET['modifyQuestion'])?$_GET['modifyQuestion']:0;
  94. }
  95. if (empty($deleteQuestion)) {
  96. $deleteQuestion = isset($_GET['deleteQuestion'])?$_GET['deleteQuestion']:0;
  97. }
  98. if (empty($clone_question)) {
  99. $clone_question = isset($_GET['clone_question'])?$_GET['clone_question']:0;
  100. }
  101. if (empty($questionId)) {
  102. $questionId = isset($_SESSION['questionId'])?$_SESSION['questionId']:0;
  103. }
  104. if (empty($modifyExercise)) {
  105. $modifyExercise = isset($_GET['modifyExercise'])?$_GET['modifyExercise']:0;
  106. }
  107. //Cleaning all incomplete attempts of the admin/teacher to avoid weird problems when changing the exercise settings, number of questions, etc
  108. delete_all_incomplete_attempts(api_get_user_id(), $exerciseId, api_get_course_id(), api_get_session_id());
  109. // get from session
  110. $objExercise = isset($_SESSION['objExercise'])?$_SESSION['objExercise']:0;
  111. $objQuestion = isset($_SESSION['objQuestion'])?$_SESSION['objQuestion']:0;
  112. $objAnswer = isset($_SESSION['objAnswer'])?$_SESSION['objAnswer']:0;
  113. // document path
  114. $documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
  115. // picture path
  116. $picturePath = $documentPath.'/images';
  117. // audio path
  118. $audioPath = $documentPath.'/audio';
  119. // the 5 types of answers
  120. $aType = array(
  121. get_lang('UniqueSelect'),
  122. get_lang('MultipleSelect'),
  123. get_lang('FillBlanks'),
  124. get_lang('Matching'),
  125. get_lang('FreeAnswer')
  126. );
  127. $fastEdition = api_get_course_setting('allow_fast_exercise_edition') == 1 ? true : false;
  128. //$fastEdition = false;
  129. if ($fastEdition) {
  130. $htmlHeadXtra[] = api_get_jqgrid_js();
  131. }
  132. // tables used in the exercise tool
  133. if (!empty($_GET['action']) && $_GET['action'] == 'exportqti2' && !empty($_GET['questionId'])) {
  134. require_once 'export/qti2/qti2_export.php';
  135. $export = export_question($_GET['questionId'], true);
  136. $qid = (int)$_GET['questionId'];
  137. $archive_path = api_get_path(SYS_ARCHIVE_PATH);
  138. $temp_dir_short = uniqid();
  139. $temp_zip_dir = $archive_path."/".$temp_dir_short;
  140. if (!is_dir($temp_zip_dir)) {
  141. mkdir($temp_zip_dir, api_get_permissions_for_new_directories());
  142. }
  143. $temp_zip_file = $temp_zip_dir."/".api_get_unique_id().".zip";
  144. $temp_xml_file = $temp_zip_dir."/qti2export_".$qid.'.xml';
  145. file_put_contents($temp_xml_file, $export);
  146. $zip_folder = new PclZip($temp_zip_file);
  147. $zip_folder->add($temp_xml_file, PCLZIP_OPT_REMOVE_ALL_PATH);
  148. $name = 'qti2_export_'.$qid.'.zip';
  149. DocumentManager::file_send_for_download($temp_zip_file, true, $name);
  150. unlink($temp_zip_file);
  151. unlink($temp_xml_file);
  152. rmdir($temp_zip_dir);
  153. //DocumentManager::string_send_for_download($export,true,'qti2export_q'.$_GET['questionId'].'.xml');
  154. exit; //otherwise following clicks may become buggy
  155. }
  156. // intializes the Exercise object
  157. if (!is_object($objExercise)) {
  158. // construction of the Exercise object
  159. $objExercise = new Exercise();
  160. // creation of a new exercise if wrong or not specified exercise ID
  161. if ($exerciseId) {
  162. $objExercise->read($exerciseId);
  163. }
  164. // saves the object into the session
  165. Session::write('objExercise', $objExercise);
  166. }
  167. // doesn't select the exercise ID if we come from the question pool
  168. if (!isset($fromExercise) or !$fromExercise) {
  169. // gets the right exercise ID, and if 0 creates a new exercise
  170. if (!$exerciseId = $objExercise->selectId()) {
  171. $modifyExercise = 'yes';
  172. }
  173. }
  174. $nbrQuestions = $objExercise->selectNbrQuestions();
  175. // intializes the Question object
  176. if ($editQuestion || $newQuestion || $modifyQuestion || $modifyAnswers) {
  177. if ($editQuestion || $newQuestion) {
  178. // reads question data
  179. if ($editQuestion) {
  180. // question not found
  181. if (!$objQuestion = Question::read($editQuestion)) {
  182. api_not_allowed();
  183. }
  184. // saves the object into the session
  185. Session::write('objQuestion', $objQuestion);
  186. }
  187. }
  188. // checks if the object exists
  189. if (is_object($objQuestion)) {
  190. // gets the question ID
  191. $questionId = $objQuestion->selectId();
  192. }
  193. }
  194. // if cancelling an exercise
  195. if (!empty($cancelExercise)) {
  196. // existing exercise
  197. if ($exerciseId) {
  198. unset($modifyExercise);
  199. } else {
  200. // new exercise
  201. // goes back to the exercise list
  202. header('Location: exercice.php');
  203. exit();
  204. }
  205. }
  206. // if cancelling question creation/modification
  207. if (!empty($cancelQuestion)) {
  208. // if we are creating a new question from the question pool
  209. if (!$exerciseId && !$questionId) {
  210. // goes back to the question pool
  211. header('Location: question_pool.php');
  212. exit();
  213. } else {
  214. // goes back to the question viewing
  215. $editQuestion = $modifyQuestion;
  216. unset($newQuestion, $modifyQuestion);
  217. }
  218. }
  219. if (!empty($clone_question) && !empty($objExercise->id)) {
  220. $old_question_obj = Question::read($clone_question);
  221. $old_question_obj->question = $old_question_obj->question.' - '.get_lang('Copy');
  222. $new_id = $old_question_obj->duplicate();
  223. $new_question_obj = Question::read($new_id);
  224. $new_question_obj->addToList($exerciseId);
  225. // This should be moved to the duplicate function
  226. $new_answer_obj = new Answer($clone_question);
  227. $new_answer_obj->read();
  228. $new_answer_obj->duplicate($new_id);
  229. //Reloading tne $objExercise obj
  230. $objExercise->read($objExercise->id);
  231. header('Location: admin.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id);
  232. exit;
  233. }
  234. // if cancelling answer creation/modification
  235. if (!empty($cancelAnswers)) {
  236. // goes back to the question viewing
  237. $editQuestion = $modifyAnswers;
  238. unset($modifyAnswers);
  239. }
  240. $nameTools = get_lang('ExerciseManagement');
  241. // modifies the query string that is used in the link of tool name
  242. if ($editQuestion || $modifyQuestion || $newQuestion || $modifyAnswers) {
  243. $nameTools = get_lang('QuestionManagement');
  244. }
  245. if (isset($_SESSION['gradebook'])) {
  246. $gradebook = $_SESSION['gradebook'];
  247. }
  248. if (!empty($gradebook) && $gradebook == 'view') {
  249. $interbreadcrumb[] = array(
  250. 'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
  251. 'name' => get_lang('ToolGradebook')
  252. );
  253. }
  254. $interbreadcrumb[] = array("url" => "exercice.php", "name" => get_lang('Exercices'));
  255. if (isset($_GET['newQuestion']) || isset($_GET['editQuestion'])) {
  256. $interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$objExercise->id, "name" => $objExercise->name);
  257. } else {
  258. $interbreadcrumb[] = array("url" => "#", "name" => $objExercise->name);
  259. }
  260. // shows a link to go back to the question pool
  261. if (!$exerciseId && $nameTools != get_lang('ExerciseManagement')) {
  262. $interbreadcrumb[] = array(
  263. "url" => "question_pool.php?fromExercise=$fromExercise",
  264. "name" => get_lang('QuestionPool')
  265. );
  266. }
  267. // if the question is duplicated, disable the link of tool name
  268. if (!empty($modifyIn) && $modifyIn == 'thisExercise') {
  269. if ($buttonBack) {
  270. $modifyIn = 'allExercises';
  271. } else {
  272. $noPHP_SELF = true;
  273. }
  274. }
  275. $htmlHeadXtra[] = '<script>
  276. function multiple_answer_true_false_onchange(variable) {
  277. var result = variable.checked;
  278. var id = variable.id;
  279. var weight_id = "weighting_" + id;
  280. var array_result=new Array(); array_result[1]="1"; array_result[0]= "-0.50"; array_result[-1]= "0";
  281. if (result) {
  282. result = 1;
  283. } else {
  284. result = 0;
  285. }
  286. document.getElementById(weight_id).value = array_result[result];
  287. }
  288. </script>';
  289. $htmlHeadXtra[] = "<script type=\"text/javascript\" src=\"../plugin/hotspot/JavaScriptFlashGateway.js\"></script>
  290. <script src=\"../plugin/hotspot/hotspot.js\" type=\"text/javascript\"></script>
  291. <script language=\"JavaScript\" type=\"text/javascript\">
  292. <!--
  293. // Globals
  294. // Major version of Flash required
  295. var requiredMajorVersion = 7;
  296. // Minor version of Flash required
  297. var requiredMinorVersion = 0;
  298. // Minor version of Flash required
  299. var requiredRevision = 0;
  300. // the version of javascript supported
  301. var jsVersion = 1.0;
  302. // -->
  303. </script>
  304. <script language=\"VBScript\" type=\"text/vbscript\">
  305. <!-- // Visual basic helper required to detect Flash Player ActiveX control version information
  306. Function VBGetSwfVer(i)
  307. on error resume next
  308. Dim swControl, swVersion
  309. swVersion = 0
  310. set swControl = CreateObject(\"ShockwaveFlash.ShockwaveFlash.\" + CStr(i))
  311. if (IsObject(swControl)) then
  312. swVersion = swControl.GetVariable(\"\$version\")
  313. end if
  314. VBGetSwfVer = swVersion
  315. End Function
  316. // -->
  317. </script>
  318. <script language=\"JavaScript1.1\" type=\"text/javascript\">
  319. <!-- // Detect Client Browser type
  320. var isIE = (navigator.appVersion.indexOf(\"MSIE\") != -1) ? true : false;
  321. var isWin = (navigator.appVersion.toLowerCase().indexOf(\"win\") != -1) ? true : false;
  322. var isOpera = (navigator.userAgent.indexOf(\"Opera\") != -1) ? true : false;
  323. jsVersion = 1.1;
  324. // JavaScript helper required to detect Flash Player PlugIn version information
  325. function JSGetSwfVer(i){
  326. // NS/Opera version >= 3 check for Flash plugin in plugin array
  327. if (navigator.plugins != null && navigator.plugins.length > 0) {
  328. if (navigator.plugins[\"Shockwave Flash 2.0\"] || navigator.plugins[\"Shockwave Flash\"]) {
  329. var swVer2 = navigator.plugins[\"Shockwave Flash 2.0\"] ? \" 2.0\" : \"\";
  330. var flashDescription = navigator.plugins[\"Shockwave Flash\" + swVer2].description;
  331. descArray = flashDescription.split(\" \");
  332. tempArrayMajor = descArray[2].split(\".\");
  333. versionMajor = tempArrayMajor[0];
  334. versionMinor = tempArrayMajor[1];
  335. if ( descArray[3] != \"\" ) {
  336. tempArrayMinor = descArray[3].split(\"r\");
  337. } else {
  338. tempArrayMinor = descArray[4].split(\"r\");
  339. }
  340. versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
  341. flashVer = versionMajor + \".\" + versionMinor + \".\" + versionRevision;
  342. } else {
  343. flashVer = -1;
  344. }
  345. }
  346. // MSN/WebTV 2.6 supports Flash 4
  347. else if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.6\") != -1) flashVer = 4;
  348. // WebTV 2.5 supports Flash 3
  349. else if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.5\") != -1) flashVer = 3;
  350. // older WebTV supports Flash 2
  351. else if (navigator.userAgent.toLowerCase().indexOf(\"webtv\") != -1) flashVer = 2;
  352. // Can't detect in all other cases
  353. else {
  354. flashVer = -1;
  355. }
  356. return flashVer;
  357. }
  358. // When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
  359. function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
  360. {
  361. reqVer = parseFloat(reqMajorVer + \".\" + reqRevision);
  362. // loop backwards through the versions until we find the newest version
  363. for (i=25;i>0;i--) {
  364. if (isIE && isWin && !isOpera) {
  365. versionStr = VBGetSwfVer(i);
  366. } else {
  367. versionStr = JSGetSwfVer(i);
  368. }
  369. if (versionStr == -1 ) {
  370. return false;
  371. } else if (versionStr != 0) {
  372. if(isIE && isWin && !isOpera) {
  373. tempArray = versionStr.split(\" \");
  374. tempString = tempArray[1];
  375. versionArray = tempString .split(\",\");
  376. } else {
  377. versionArray = versionStr.split(\".\");
  378. }
  379. versionMajor = versionArray[0];
  380. versionMinor = versionArray[1];
  381. versionRevision = versionArray[2];
  382. versionString = versionMajor + \".\" + versionRevision; // 7.0r24 == 7.24
  383. versionNum = parseFloat(versionString);
  384. // is the major.revision >= requested major.revision AND the minor version >= requested minor
  385. if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
  386. return true;
  387. } else {
  388. return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );
  389. }
  390. }
  391. }
  392. }
  393. // -->
  394. </script>";
  395. Display::display_header($nameTools, 'Exercise');
  396. if ($objExercise->exercise_was_added_in_lp) {
  397. if ($objExercise->force_edit_exercise_in_lp == true) {
  398. Display::display_warning_message(get_lang('ForceEditingExerciseInLPWarning'));
  399. } else {
  400. Display::display_warning_message(get_lang('EditingExerciseCauseProblemsInLP'));
  401. }
  402. }
  403. // If we are in a test
  404. $inATest = isset($exerciseId) && $exerciseId > 0;
  405. if ($inATest) {
  406. echo '<div class="actions">';
  407. if (isset($_GET['hotspotadmin']) || isset($_GET['newQuestion']) || isset($_GET['myid'])) {
  408. echo '<a href="admin.php?exerciseId='.$exerciseId.'">'.Display::return_icon(
  409. 'back.png',
  410. get_lang('GoBackToQuestionList'),
  411. '',
  412. ICON_SIZE_MEDIUM
  413. ).'</a>';
  414. }
  415. if (!isset($_GET['hotspotadmin']) && !isset($_GET['newQuestion']) && !isset($_GET['myid']) && !isset($_GET['editQuestion'])) {
  416. echo '<a href="exercice.php?'.api_get_cidReq().'">'.Display::return_icon(
  417. 'back.png',
  418. get_lang('BackToExercisesList'),
  419. '',
  420. ICON_SIZE_MEDIUM
  421. ).'</a>';
  422. }
  423. echo '<a href="overview.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id.'&preview=1">'.Display::return_icon(
  424. 'preview_view.png',
  425. get_lang('Preview'),
  426. '',
  427. ICON_SIZE_MEDIUM
  428. ).'</a>';
  429. echo Display::url(
  430. Display::return_icon('test_results.png', get_lang('Results'), '', ICON_SIZE_MEDIUM),
  431. 'exercise_report.php?'.api_get_cidReq().'&exerciseId='.$objExercise->id
  432. );
  433. if ($objExercise->edit_exercise_in_lp == false) {
  434. echo '<a href="">'.Display::return_icon(
  435. 'settings_na.png',
  436. get_lang('ModifyExercise'),
  437. '',
  438. ICON_SIZE_MEDIUM
  439. ).'</a>';
  440. } else {
  441. echo '<a href="exercise_admin.php?'.api_get_cidreq(
  442. ).'&modifyExercise=yes&exerciseId='.$objExercise->id.'">'.Display::return_icon(
  443. 'settings.png',
  444. get_lang('ModifyExercise'),
  445. '',
  446. ICON_SIZE_MEDIUM
  447. ).'</a>';
  448. }
  449. $maxScoreAllQuestions = 0;
  450. if (!empty($objExercise->questionList)) {
  451. foreach ($objExercise->questionList as $q) {
  452. $question = Question::read($q);
  453. if ($question) {
  454. $maxScoreAllQuestions += $question->selectWeighting();
  455. }
  456. }
  457. }
  458. echo '<span style="float:right">'.sprintf(
  459. get_lang('XQuestionsWithTotalScoreY'),
  460. $objExercise->selectNbrQuestions(),
  461. $maxScoreAllQuestions
  462. ).'</span>';
  463. echo '</div>';
  464. } else {
  465. if (isset($_GET['newQuestion'])) {
  466. // we are in create a new question from question pool not in a test
  467. echo '<div class="actions">';
  468. echo '<a href="admin.php?'.api_get_cidreq().'">.'.Display::return_icon(
  469. 'back.png',
  470. get_lang('GoBackToQuestionList'),
  471. '',
  472. ICON_SIZE_MEDIUM
  473. ).'</a>';
  474. echo '</div>';
  475. } else {
  476. // If we are in question_poolbut not in an test, go back to question create in pool
  477. echo '<div class="actions">';
  478. echo '<a href="question_pool.php">'.Display::return_icon(
  479. 'back.png',
  480. get_lang('GoBackToQuestionList'),
  481. '',
  482. ICON_SIZE_MEDIUM
  483. ).'</a>';
  484. echo '</div>';
  485. }
  486. }
  487. if (isset($_GET['message'])) {
  488. if (in_array($_GET['message'], array('ExerciseStored', 'ItemUpdated', 'ItemAdded'))) {
  489. Display::display_confirmation_message(get_lang($_GET['message']));
  490. }
  491. }
  492. if ($newQuestion || $editQuestion) {
  493. // statement management
  494. if ($editQuestion) {
  495. $type = $objQuestion->selectType();
  496. } else {
  497. $type = Security::remove_XSS($_REQUEST['answerType']);
  498. }
  499. echo '<input type="hidden" name="Type" value="'.$type.'" />';
  500. require 'question_admin.inc.php';
  501. }
  502. if (isset($_GET['hotspotadmin'])) {
  503. if (!is_object($objQuestion)) {
  504. $objQuestion = Question :: read($_GET['hotspotadmin']);
  505. }
  506. if (!$objQuestion) {
  507. api_not_allowed();
  508. }
  509. require 'hotspot_admin.inc.php';
  510. }
  511. if (!$newQuestion && !$modifyQuestion && !$editQuestion && !isset($_GET['hotspotadmin'])) {
  512. // question list management
  513. if ($fastEdition) {
  514. require 'question_list_pagination_admin.inc.php';
  515. } else {
  516. require 'question_list_admin.inc.php';
  517. }
  518. }
  519. Session::write('objExercise', $objExercise);
  520. Session::write('objQuestion', $objQuestion);
  521. Session::write('objAnswer', $objAnswer);
  522. Display::display_footer();