exercice.php 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049
  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 du Corbeau, 108
  13. B-1030 Brussels - Belgium
  14. info@dokeos.com
  15. */
  16. /**
  17. * Exercise list: This script shows the list of exercises for administrators and students.
  18. * @package dokeos.exercise
  19. * @author Olivier Brouckaert, original author
  20. * @author Denes Nagy, HotPotatoes integration
  21. * @author Wolfgang Schneider, code/html cleanup
  22. * @version $Id:exercice.php 12269 2007-05-03 14:17:37Z elixir_julian $
  23. */
  24. // name of the language file that needs to be included
  25. $language_file='exercice';
  26. require_once('../inc/global.inc.php');
  27. $this_section=SECTION_COURSES;
  28. api_protect_course_script(true);
  29. $show=(isset($_GET['show']) && $_GET['show'] == 'result')?'result':'test'; // moved down to fix bug: http://www.dokeos.com/forum/viewtopic.php?p=18609#18609
  30. /*
  31. -----------------------------------------------------------
  32. Libraries
  33. -----------------------------------------------------------
  34. */
  35. require_once('exercise.class.php');
  36. require_once('question.class.php');
  37. require_once('answer.class.php');
  38. require_once(api_get_path(LIBRARY_PATH).'fileManage.lib.php');
  39. require_once(api_get_path(LIBRARY_PATH).'fileUpload.lib.php');
  40. require_once('hotpotatoes.lib.php');
  41. require_once(api_get_path(LIBRARY_PATH).'document.lib.php');
  42. include(api_get_path(LIBRARY_PATH).'mail.lib.inc.php');
  43. include(api_get_path(LIBRARY_PATH).'usermanager.lib.php');
  44. /*
  45. -----------------------------------------------------------
  46. Constants and variables
  47. -----------------------------------------------------------
  48. */
  49. $is_allowedToEdit = api_is_allowed_to_edit();
  50. $is_tutor = api_is_allowed_to_edit(true);
  51. $TBL_USER = Database::get_main_table(TABLE_MAIN_USER);
  52. $TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT);
  53. $TBL_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY);
  54. $TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
  55. $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
  56. $TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
  57. $TBL_TRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
  58. $TBL_TRACK_HOTPOTATOES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
  59. $TBL_TRACK_ATTEMPT = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
  60. // document path
  61. $documentPath= api_get_path(SYS_COURSE_PATH).$_course['path']."/document";
  62. // picture path
  63. $picturePath=$documentPath.'/images';
  64. // audio path
  65. $audioPath=$documentPath.'/audio';
  66. // hotpotatoes
  67. $uploadPath = DIR_HOTPOTATOES; //defined in main_api
  68. $exercicePath = api_get_self();
  69. $exfile = explode('/',$exercicePath);
  70. $exfile = strtolower($exfile[sizeof($exfile)-1]);
  71. $exercicePath = substr($exercicePath,0,strpos($exercicePath,$exfile));
  72. $exercicePath = $exercicePath."exercice.php";
  73. // maximum number of exercises on a same page
  74. $limitExPage=50;
  75. // Clear the exercise session
  76. if(isset($_SESSION['objExercise'])) { api_session_unregister('objExercise'); }
  77. if(isset($_SESSION['objQuestion'])) { api_session_unregister('objQuestion'); }
  78. if(isset($_SESSION['objAnswer'])) { api_session_unregister('objAnswer'); }
  79. if(isset($_SESSION['questionList'])) { api_session_unregister('questionList'); }
  80. if(isset($_SESSION['exerciseResult'])) { api_session_unregister('exerciseResult'); }
  81. //general POST/GET/SESSION/COOKIES parameters recovery
  82. if ( empty ( $origin ) ) {
  83. $origin = $_REQUEST['origin'];
  84. }
  85. if ( empty ($choice ) ) {
  86. $choice = $_REQUEST['choice'];
  87. }
  88. if ( empty ( $hpchoice ) ) {
  89. $hpchoice = $_REQUEST['hpchoice'];
  90. }
  91. if ( empty ($exerciseId ) ) {
  92. $exerciseId = Database::escape_string($_REQUEST['exerciseId']);
  93. }
  94. if ( empty ( $file ) ) {
  95. $file = Database::escape_string($_REQUEST['file']);
  96. }
  97. $learnpath_id = Database::escape_string($_REQUEST['learnpath_id']);
  98. $learnpath_item_id = Database::escape_string($_REQUEST['learnpath_item_id']);
  99. $page = Database::escape_string($_REQUEST['page']);
  100. if($origin == 'learnpath'){
  101. $show = 'result';
  102. }
  103. $htmlHeadXtra[]='<style type="text/css">
  104. <!--
  105. a.invisible
  106. {
  107. color: #999999;
  108. }
  109. a.invisible:visited
  110. {
  111. color: #999999;
  112. }
  113. a.invisible:active
  114. {
  115. color: #999999;
  116. }
  117. a.invisible:hover
  118. {
  119. color: #999999;
  120. }
  121. -->
  122. </style>';
  123. if ($show=='result' && $_REQUEST['comments']=='update' && ($is_allowedToEdit || $is_tutor))
  124. {
  125. $id = $_GET['exeid'];
  126. $emailid = $_GET['emailid'];
  127. $test = $_GET['test'];
  128. $from = $_SESSION['_user']['mail'];
  129. $from_name = $_SESSION['_user']['firstName']." ".$_SESSION['_user']['lastName'];
  130. $url = api_get_path(WEB_CODE_PATH).'exercice/exercice.php?'.api_get_cidreq().'&show=result';
  131. foreach ($_POST as $key=>$v)
  132. {
  133. $keyexp = explode('_',$key);
  134. if ($keyexp[0] == "marks")
  135. {
  136. $sql = "select question from $TBL_QUESTIONS where id = '$keyexp[1]'";
  137. $result =api_sql_query($sql, __FILE__, __LINE__);
  138. $ques_name = mysql_result($result,0,"question");
  139. $query = "update $TBL_TRACK_ATTEMPT set marks = '$v' where question_id = $keyexp[1] and exe_id=$id";
  140. api_sql_query($query, __FILE__, __LINE__);
  141. $qry = 'SELECT sum(marks) as tot
  142. FROM '.$TBL_TRACK_ATTEMPT.' where exe_id = '.intval($id).'
  143. GROUP BY question_id';
  144. $res = api_sql_query($qry,__FILE__,__LINE__);
  145. $tot = mysql_result($res,0,'tot');
  146. $totquery = "update $TBL_TRACK_EXERCICES set exe_result = $tot where exe_Id=$id";
  147. api_sql_query($totquery, __FILE__, __LINE__);
  148. }
  149. else
  150. {
  151. $query = "update $TBL_TRACK_ATTEMPT set teacher_comment = '$v' where question_id = $keyexp[1] and exe_id = $id ";
  152. api_sql_query($query, __FILE__, __LINE__);
  153. }
  154. }
  155. $qry = 'SELECT DISTINCT question_id, marks
  156. FROM '.$TBL_TRACK_ATTEMPT.' where exe_id = '.intval($id).'
  157. GROUP BY question_id';
  158. $res = api_sql_query($qry,__FILE__,__LINE__);
  159. $tot = 0;
  160. while($row = Database::fetch_array($res,'ASSOC'))
  161. {
  162. $tot += $row ['marks'];
  163. }
  164. $totquery = "update $TBL_TRACK_EXERCICES set exe_result = $tot where exe_Id=$id";
  165. api_sql_query($totquery, __FILE__, __LINE__);
  166. $subject = get_lang('ExamSheetVCC');
  167. $htmlmessage = '<html>'.
  168. '<head>' .
  169. '<style type="text/css">' .
  170. '<!--' .
  171. '.body{' .
  172. 'font-family: Verdana, Arial, Helvetica, sans-serif;' .
  173. 'font-weight: Normal;' .
  174. 'color: #000000;' .
  175. '}' .
  176. '.style8 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #006699; }' .
  177. '.style10 {' .
  178. ' font-family: Verdana, Arial, Helvetica, sans-serif;' .
  179. ' font-size: 12px;' .
  180. ' font-weight: bold;' .
  181. '}' .
  182. '.style16 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }' .
  183. '-->' .
  184. '</style>' .
  185. '</head>' .
  186. '<body>' .
  187. '<div>' .
  188. ' <p>'.get_lang('DearStudentEmailIntroduction').'</p>' .
  189. ' <p class="style10"> '.get_lang('AttemptVCC').' </p>' .
  190. ' <table width="417">' .
  191. ' <tr>' .
  192. ' <td width="229" valign="top" bgcolor="E5EDF8">&nbsp;&nbsp;<span class="style10">'.get_lang('Question').'</span></td>' .
  193. ' <td width="469" valign="top" bgcolor="#F3F3F3"><span class="style16">#ques_name#</span></td>' .
  194. ' </tr>' .
  195. ' <tr>' .
  196. ' <td width="229" valign="top" bgcolor="E5EDF8">&nbsp;&nbsp;<span class="style10">'.get_lang('Exercice').'</span></td>' .
  197. ' <td width="469" valign="top" bgcolor="#F3F3F3"><span class="style16">#test#</span></td>' .
  198. ' </tr>' .
  199. ' </table>' .
  200. ' <p>'.get_lang('ClickLinkToViewComment').' <a href="#url#">#url#</a><br />' .
  201. ' <br />' .
  202. ' '.get_lang('Regards').' </p>' .
  203. ' </div>' .
  204. ' </body>' .
  205. ' </html>';
  206. $message = '<p>'.sprintf(get_lang('AttemptVCCLong'),$test).' <A href="#url#">#url#</A></p><br />';
  207. $mess= str_replace("#test#",$test,$message);
  208. //$message= str_replace("#ques_name#",$ques_name,$mess);
  209. $message = str_replace("#url#",$url,$mess);
  210. $mess = stripslashes($message);
  211. $headers = " MIME-Version: 1.0 \r\n";
  212. $headers .= "User-Agent: Dokeos/1.6";
  213. $headers .= "Content-Transfer-Encoding: 7bit";
  214. $headers .= 'From: '.$from_name.' <'.$from.'>' . "\r\n";
  215. $headers="From:$from_name\r\nReply-to: $to\r\nContent-type: text/html; charset=".($charset?$charset:'ISO-8859-15');
  216. //mail($emailid, $subject, $mess,$headers);
  217. api_mail_html($emailid, $emailid, $subject, $mess, $from_name, $from);
  218. if(in_array($origin, array('tracking_course','user_course'))){
  219. //Redirect to the reporting
  220. header('location: ../mySpace/myStudents.php?origin='.$origin.'&student='.$_GET['student'].'&details=true&course='.$_GET['course']);
  221. }
  222. }
  223. if($show!='result')
  224. {
  225. $nameTools=get_lang('Exercices');
  226. }
  227. else
  228. {
  229. if($is_allowedToEdit || $is_tutor)
  230. {
  231. $nameTools=get_lang('StudentScore');
  232. $interbreadcrumb[]=array("url" => "exercice.php","name" => get_lang('Exercices'));
  233. }
  234. else
  235. {
  236. $nameTools=get_lang('YourScore');
  237. $interbreadcrumb[]=array("url" => "exercice.php","name" => get_lang('Exercices'));
  238. }
  239. }
  240. // need functions of statsutils lib to display previous exercices scores
  241. include_once(api_get_path(LIBRARY_PATH).'statsUtils.lib.inc.php');
  242. if($is_allowedToEdit && !empty($choice) && $choice == 'exportqti2')
  243. {
  244. require_once('export/qti2/qti2_export.php');
  245. $export = export_exercise($exerciseId,true);
  246. require_once(api_get_path(LIBRARY_PATH).'pclzip/pclzip.lib.php');
  247. $garbage_path = api_get_path(GARBAGE_PATH);
  248. $temp_dir_short = uniqid();
  249. $temp_zip_dir = $garbage_path."/".$temp_dir_short;
  250. if(!is_dir($temp_zip_dir)) mkdir($temp_zip_dir);
  251. $temp_zip_file = $temp_zip_dir."/".md5(time()).".zip";
  252. $temp_xml_file = $temp_zip_dir."/qti2export_".$exerciseId.'.xml';
  253. file_put_contents($temp_xml_file,$export);
  254. $zip_folder=new PclZip($temp_zip_file);
  255. $zip_folder->add($temp_zip_dir, PCLZIP_OPT_REMOVE_PATH, $temp_zip_dir);
  256. $name = 'qti2_export_'.$exerciseId.'.zip';
  257. //DocumentManager::string_send_for_download($export,true,'qti2export_'.$exerciseId.'.xml');
  258. DocumentManager::file_send_for_download($temp_zip_file,true,$name);
  259. unlink($temp_zip_file);
  260. unlink($temp_xml_file);
  261. rmdir($temp_zip_dir);
  262. exit(); //otherwise following clicks may become buggy
  263. }
  264. if(!empty($_POST['export_user_fields']))
  265. {
  266. switch($_POST['export_user_fields'])
  267. {
  268. case 'export_user_fields':
  269. $_SESSION['export_user_fields'] = true;
  270. break;
  271. case 'do_not_export_user_fields':
  272. default:
  273. $_SESSION['export_user_fields'] = false;
  274. break;
  275. }
  276. }
  277. if(!empty($_POST['export_report']) && $_POST['export_report'] == 'export_report')
  278. {
  279. $user_id = null;
  280. if(empty($_SESSION['export_user_fields'])) $_SESSION['export_user_fields'] = false;
  281. if(!$is_allowedToEdit and !$is_tutor)
  282. {
  283. $user_id = api_get_user_id();
  284. }
  285. require_once('exercise_result.class.php');
  286. switch($_POST['export_format'])
  287. {
  288. case 'xls':
  289. $export = new ExerciseResult();
  290. $export->exportCompleteReportXLS($documentPath, $user_id, $_SESSION['export_user_fields']);
  291. exit;
  292. break;
  293. case 'csv':
  294. default:
  295. $export = new ExerciseResult();
  296. $export->exportCompleteReportCSV($documentPath, $user_id, $_SESSION['export_user_fields']);
  297. exit;
  298. break;
  299. }
  300. }
  301. if ($origin != 'learnpath')
  302. {
  303. //so we are not in learnpath tool
  304. Display::display_header($nameTools,"Exercise");
  305. if(isset($_GET['message']))
  306. {
  307. if (in_array($_GET['message'], array('ExerciseEdited')))
  308. {
  309. Display::display_confirmation_message(get_lang($_GET['message']));
  310. }
  311. }
  312. }
  313. else
  314. {
  315. echo '<link rel="stylesheet" type="text/css" href="'.api_get_path(WEB_CODE_PATH).'css/default.css"/>';
  316. }
  317. // used for stats
  318. include_once(api_get_path(LIBRARY_PATH).'events.lib.inc.php');
  319. event_access_tool(TOOL_QUIZ);
  320. Display::display_introduction_section(TOOL_QUIZ);
  321. // selects $limitExPage exercises at the same time
  322. $from=$page*$limitExPage;
  323. $sql="SELECT count(id) FROM $TBL_EXERCICES";
  324. $res = api_sql_query($sql,__FILE__,__LINE__);
  325. list($nbrexerc) = Database::fetch_array($res);
  326. HotPotGCt($documentPath,1,$_user['user_id']);
  327. // only for administrator
  328. if($is_allowedToEdit)
  329. {
  330. if(!empty($choice))
  331. {
  332. // construction of Exercise
  333. $objExerciseTmp=new Exercise();
  334. if($objExerciseTmp->read($exerciseId))
  335. {
  336. switch($choice)
  337. {
  338. case 'delete': // deletes an exercise
  339. $objExerciseTmp->delete();
  340. Display::display_confirmation_message(get_lang('ExerciseDeleted'));
  341. break;
  342. case 'enable': // enables an exercise
  343. $objExerciseTmp->enable();
  344. $objExerciseTmp->save();
  345. // "WHAT'S NEW" notification: update table item_property (previously last_tooledit)
  346. api_item_property_update($_course, TOOL_QUIZ, $exerciseId, "QuizAdded", $_user['user_id']);
  347. Display::display_confirmation_message(get_lang('VisibilityChanged'));
  348. break;
  349. case 'disable': // disables an exercise
  350. $objExerciseTmp->disable();
  351. $objExerciseTmp->save();
  352. Display::display_confirmation_message(get_lang('VisibilityChanged'));
  353. break;
  354. case 'disable_results' : //disable the results for the learners
  355. $objExerciseTmp->disable_results();
  356. $objExerciseTmp->save();
  357. Display::display_confirmation_message(get_lang('ResultsDisabled'));
  358. break;
  359. case 'enable_results' : //disable the results for the learners
  360. $objExerciseTmp->enable_results();
  361. $objExerciseTmp->save();
  362. Display::display_confirmation_message(get_lang('ResultsEnabled'));
  363. break;
  364. }
  365. }
  366. // destruction of Exercise
  367. unset($objExerciseTmp);
  368. }
  369. //$sql="SELECT id,title,type,active FROM $TBL_EXERCICES ORDER BY title LIMIT $from,".($limitExPage+1);
  370. //$result=api_sql_query($sql,__FILE__,__LINE__);
  371. if(!empty($hpchoice))
  372. {
  373. switch($hpchoice)
  374. {
  375. case 'delete': // deletes an exercise
  376. $imgparams = array();
  377. $imgcount = 0;
  378. GetImgParams($file,$documentPath,$imgparams,$imgcount);
  379. $fld = GetFolderName($file);
  380. for($i=0;$i < $imgcount;$i++)
  381. {
  382. my_delete($documentPath.$uploadPath."/".$fld."/".$imgparams[$i]);
  383. update_db_info("delete", $uploadPath."/".$fld."/".$imgparams[$i]);
  384. }
  385. if ( my_delete($documentPath.$file))
  386. {
  387. update_db_info("delete", $file);
  388. }
  389. my_delete($documentPath.$uploadPath."/".$fld."/");
  390. break;
  391. case 'enable': // enables an exercise
  392. $newVisibilityStatus = "1"; //"visible"
  393. $query = "SELECT id FROM $TBL_DOCUMENT WHERE path='$file'";
  394. $res = api_sql_query($query,__FILE__,__LINE__);
  395. $row = Database::fetch_array($res, 'ASSOC');
  396. api_item_property_update($_course, TOOL_DOCUMENT, $row['id'], 'visible', $_user['user_id']);
  397. //$dialogBox = get_lang('ViMod');
  398. break;
  399. case 'disable': // disables an exercise
  400. $newVisibilityStatus = "0"; //"invisible"
  401. $query = "SELECT id FROM $TBL_DOCUMENT WHERE path='$file'";
  402. $res = api_sql_query($query,__FILE__,__LINE__);
  403. $row = Database::fetch_array($res, 'ASSOC');
  404. api_item_property_update($_course, TOOL_DOCUMENT, $row['id'], 'invisible', $_user['user_id']);
  405. #$query = "UPDATE $TBL_DOCUMENT SET visibility='$newVisibilityStatus' WHERE path=\"".$file."\""; //added by Toon
  406. #api_sql_query($query,__FILE__,__LINE__);
  407. //$dialogBox = get_lang('ViMod');
  408. break;
  409. default:
  410. break;
  411. }
  412. }
  413. if($show == 'test')
  414. {
  415. $sql="SELECT id,title,type,active,description, results_disabled FROM $TBL_EXERCICES WHERE active<>'-1' ORDER BY title LIMIT $from,".($limitExPage+1);
  416. $result=api_sql_query($sql,__FILE__,__LINE__);
  417. }
  418. }
  419. // only for students
  420. elseif($show == 'test')
  421. {
  422. $sql="SELECT id,title,type,description, results_disabled FROM $TBL_EXERCICES WHERE active='1' ORDER BY title LIMIT $from,".($limitExPage+1);
  423. $result=api_sql_query($sql,__FILE__,__LINE__);
  424. }
  425. if($show == 'test'){
  426. $nbrExercises=Database::num_rows($result);
  427. echo '<table border="0" align="center" cellpadding="2" cellspacing="2" width="100%">'.
  428. '<tr>';
  429. if (($is_allowedToEdit) and ($origin != 'learnpath'))
  430. {
  431. echo '<td width="50%" nowrap="nowrap">'.
  432. '<img src="../img/new_test.gif" alt="new test" align="absbottom">&nbsp;<a href="exercise_admin.php?'.api_get_cidreq().'">'.get_lang('NewEx').'</a>'.
  433. ' | <img src="../img/jqz.jpg" alt="HotPotatoes" valign="ABSMIDDLE">&nbsp;<a href="hotpotatoes.php">'.get_lang('ImportHotPotatoesQuiz').'</a>'.
  434. '</td>'.
  435. '<td width="50%" align="right">';
  436. }
  437. else
  438. {
  439. echo '<td align="right">';
  440. }
  441. //get HotPotatoes files (active and inactive)
  442. $res = api_sql_query ("SELECT *
  443. FROM $TBL_DOCUMENT
  444. WHERE
  445. path LIKE '".$uploadPath."/%/%'",__FILE__,__LINE__);
  446. $nbrTests = Database::num_rows($res);
  447. $res = api_sql_query ("SELECT *
  448. FROM $TBL_DOCUMENT d, $TBL_ITEM_PROPERTY ip
  449. WHERE d.id = ip.ref
  450. AND ip.tool = '".TOOL_DOCUMENT."'
  451. AND d.path LIKE '".$uploadPath."/%/%'
  452. AND ip.visibility='1'", __FILE__,__LINE__);
  453. $nbrActiveTests = Database::num_rows($res);
  454. if($is_allowedToEdit)
  455. {//if user is allowed to edit, also show hidden HP tests
  456. $nbrHpTests = $nbrTests;
  457. }else
  458. {
  459. $nbrHpTests = $nbrActiveTests;
  460. }
  461. $nbrNextTests = $nbrexerc-$nbrHpTests-(($page*$limitExPage));
  462. //show pages navigation link for previous page
  463. if($page)
  464. {
  465. echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&page=".($page-1)."\">&lt;&lt; ",get_lang("PreviousPage")."</a> | ";
  466. }
  467. elseif($nbrExercises+$nbrNextTests > $limitExPage)
  468. {
  469. echo "&lt;&lt; ",get_lang("PreviousPage")." | ";
  470. }
  471. //show pages navigation link for previous page
  472. if($nbrExercises+$nbrNextTests > $limitExPage)
  473. {
  474. echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&page=".($page+1)."\">&gt;&gt; ",get_lang("NextPage")."</a>";
  475. }
  476. elseif($page)
  477. {
  478. echo get_lang("NextPage") . " &gt;&gt;";
  479. }
  480. echo '</td>',
  481. '</tr>',
  482. '</table>';
  483. ?>
  484. <table class="data_table">
  485. <?php
  486. if (($is_allowedToEdit) and ($origin != 'learnpath'))
  487. {
  488. ?>
  489. <tr class="row_odd">
  490. <th colspan="2"><?php echo get_lang("ExerciseName");?></th>
  491. <th><?php echo get_lang("Description");?></th>
  492. <th><?php echo get_lang('Export');?></th>
  493. <th><?php echo get_lang("Modify");?></th>
  494. </tr>
  495. <?php
  496. }
  497. else
  498. {
  499. ?> <tr bgcolor="#e6e6e6">
  500. <th><?php echo get_lang("ExerciseName");?></th>
  501. <th><?php echo get_lang("Description");?></th>
  502. <th><?php echo get_lang("State");?></th>
  503. </tr>
  504. <?php }
  505. // show message if no HP test to show
  506. if(!($nbrExercises+$nbrHpTests) )
  507. {
  508. ?>
  509. <tr>
  510. <td <?php echo ($is_allowedToEdit?'colspan="5"':'colspan="3"'); ?>><?php echo get_lang("NoEx"); ?></td>
  511. </tr>
  512. <?php
  513. }
  514. $i=1;
  515. // while list exercises
  516. if ($origin != 'learnpath')
  517. {
  518. //avoid sending empty parameters
  519. $myorigin = (empty($origin)?'':'&origin='.$origin);
  520. $mylpid = (empty($learnpath_id)?'':'&learnpath_id='.$learnpath_id);
  521. $mylpitemid = (empty($learnpath_item_id)?'':'&learnpath_item_id='.$learnpath_item_id);
  522. while($row=Database::fetch_array($result))
  523. {
  524. if($i%2==0) $s_class="row_odd"; else $s_class="row_even";
  525. echo '<tr class="'.$s_class.'">'."\n";
  526. // prof only
  527. if($is_allowedToEdit)
  528. {
  529. ?>
  530. <td width="27%" colspan="2">
  531. <table border="0" cellpadding="0" cellspacing="0" width="100%">
  532. <tr>
  533. <td width="30" align="left"><img src="../img/quiz.gif"></td>
  534. <td width="15" valign="left" align="center"><?php echo ($i+($page*$limitExPage)).'.'; ?></td>
  535. <?php $row['title']=api_parse_tex($row['title']); ?>
  536. <td>
  537. <a href="exercice_submit.php?<?php echo api_get_cidreq().$myorigin.$mylpid.$mylpitemid; ?>&exerciseId=<?php echo $row['id']; ?>" <?php if(!$row['active']) echo 'class="invisible"'; ?>><?php echo $row['title']; ?></a>
  538. </td>
  539. </tr>
  540. </table>
  541. </td>
  542. <td width="8%" align="center"> <?php
  543. $exid = $row['id'];
  544. $sqlquery = "SELECT count(*) FROM $TBL_EXERCICE_QUESTION WHERE exercice_id = '$exid'";
  545. $sqlresult =api_sql_query($sqlquery);
  546. $rowi = mysql_result($sqlresult,0);
  547. echo $rowi.' '.strtolower(get_lang(($rowi>1?'Questions':'Question'))).'</td>';
  548. echo '<td width="5%" align="center"><a href="exercice.php?choice=exportqti2&exerciseId='.$row['id'].'"><img src="../img/export.png" border="0" title="IMS/QTI" /></a></td>';
  549. ?>
  550. <td width="12%" align="center">
  551. <a href="exercise_admin.php?modifyExercise=yes&exerciseId=<?php echo $row['id']; ?>"> <img src="../img/edit.gif" border="0" title="<?php echo htmlentities(get_lang('Modify'),ENT_QUOTES,$charset); ?>" alt="<?php echo htmlentities(get_lang('Modify'),ENT_QUOTES,$charset); ?>" /></a>
  552. <a href="admin.php?exerciseId=<?php echo $row['id']; ?>"><img src="../img/wizard_small.gif" border="0" title="<?php echo htmlentities(get_lang('Build'),ENT_QUOTES,$charset); ?>" alt="<?php echo htmlentities(get_lang('Build'),ENT_QUOTES,$charset); ?>" /></a>
  553. <a href="exercice.php?choice=delete&exerciseId=<?php echo $row['id']; ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('AreYouSureToDelete'),ENT_QUOTES,$charset)); echo " ".$row['title']; echo "?"; ?>')) return false;"> <img src="../img/delete.gif" border="0" alt="<?php echo htmlentities(get_lang('Delete'),ENT_QUOTES,$charset); ?>" /></a>
  554. <?php
  555. // if active
  556. if($row['active'])
  557. {
  558. ?>
  559. <a href="exercice.php?choice=disable&page=<?php echo $page; ?>&exerciseId=<?php echo $row['id']; ?>"> <img src="../img/visible.gif" border="0" alt="<?php echo htmlentities(get_lang('Deactivate'),ENT_QUOTES,$charset); ?>" /></a>
  560. <?php
  561. }
  562. // else if not active
  563. else
  564. {
  565. ?>
  566. <a href="exercice.php?choice=enable&page=<?php echo $page; ?>&exerciseId=<?php echo $row['id']; ?>"> <img src="../img/invisible.gif" border="0" alt="<?php echo htmlentities(get_lang('Activate'),ENT_QUOTES,$charset); ?>" /></a>
  567. <?php
  568. }
  569. if($row['results_disabled'])
  570. echo '<a href="exercice.php?choice=enable_results&page='.$page.'&exerciseId='.$row['id'].'" title="'.get_lang('EnableResults').'" alt="'.get_lang('EnableResults').'"><img src="../img/lp_quiz_na.gif" border="0" alt="'.htmlentities(get_lang('EnableResults'),ENT_QUOTES,$charset).'" /></a>';
  571. else
  572. echo '<a href="exercice.php?choice=disable_results&page='.$page.'&exerciseId='.$row['id'].'" title="'.get_lang('DisableResults').'" alt="'.get_lang('DisableResults').'"><img src="../img/lp_quiz.gif" border="0" alt="'.htmlentities(get_lang('DisableResults'),ENT_QUOTES,$charset).'" /></a>';
  573. echo "</td>";
  574. echo "</tr>\n";
  575. }
  576. // student only
  577. else
  578. {
  579. ?>
  580. <td width="40%"><table border="0" cellpadding="0" cellspacing="0" width="100%">
  581. <tr>
  582. <td width="20" valign="top" align="right"><?php echo ($i+($page*$limitExPage)).'.'; ?></td>
  583. <td width="1">&nbsp;</td>
  584. <?php $row['title']=api_parse_tex($row['title']);?>
  585. <td><a href="exercice_submit.php?<?php echo api_get_cidreq().$myorigin.$mylpid.$myllpitemid; ?>&exerciseId=<?php echo $row['id']; ?>"><?php echo $row['title']; ?></a></td>
  586. </tr>
  587. </table></td>
  588. <td align="center"> <?php
  589. $exid = $row['id'];
  590. $sqlquery = "SELECT count(*) FROM $TBL_EXERCICE_QUESTION WHERE exercice_id = '$exid'";
  591. $sqlresult =api_sql_query($sqlquery);
  592. $rowi = mysql_result($sqlresult,0);
  593. echo ($rowi>1?get_lang('Questions'):get_lang('Question')); ?> </td>
  594. <td align="center"><?php
  595. $eid = $row['id'];
  596. $uid= api_get_user_id();
  597. $qry = "select * from $TBL_TRACK_EXERCICES where exe_exo_id = $eid and exe_user_id = $uid and exe_cours_id = '".api_get_course_id()."'";
  598. $qryres = api_sql_query($qry);
  599. $num = Database::num_rows($qryres);
  600. $row = Database::fetch_array($qryres);
  601. $percentage = 0;
  602. if($row['exe_weighting'] != 0)
  603. {
  604. $percentage = ($row['exe_result']/$row['exe_weighting'])*100;
  605. }
  606. if ($num>0)
  607. {
  608. echo get_lang('Attempted').' ('.get_lang('Score').':';
  609. printf("%1.2f\n",$percentage);
  610. echo " %)";
  611. }
  612. else
  613. {
  614. echo get_lang('NotAttempted');
  615. }
  616. ?></td>
  617. </tr>
  618. <?php
  619. }
  620. // skips the last exercise, that is only used to know if we have or not to create a link "Next page"
  621. if($i == $limitExPage)
  622. {
  623. break;
  624. }
  625. $i++;
  626. } // end while()
  627. $ind = $i;
  628. if (($from+$limitExPage-1)>$nbrexerc)
  629. {
  630. if($from>$nbrexerc)
  631. {
  632. $from = $from - $nbrexerc;
  633. $to = $limitExPage;
  634. }
  635. else
  636. {
  637. $to = $limitExPage-($nbrexerc-$from);
  638. $from = 0;
  639. }
  640. }
  641. else{
  642. $to = $limitExPage;
  643. }
  644. if($is_allowedToEdit)
  645. {
  646. $sql = "SELECT d.path as path, d.comment as comment, ip.visibility as visibility
  647. FROM $TBL_DOCUMENT d, $TBL_ITEM_PROPERTY ip
  648. WHERE d.id = ip.ref AND ip.tool = '".TOOL_DOCUMENT."' AND
  649. (d.path LIKE '%htm%')
  650. AND d.path LIKE '".$uploadPath."/%/%' LIMIT $from,$to"; // only .htm or .html files listed
  651. }
  652. else
  653. {
  654. $sql = "SELECT d.path as path, d.comment as comment, ip.visibility as visibility
  655. FROM $TBL_DOCUMENT d, $TBL_ITEM_PROPERTY ip
  656. WHERE d.id = ip.ref AND ip.tool = '".TOOL_DOCUMENT."' AND
  657. (d.path LIKE '%htm%')
  658. AND d.path LIKE '".$uploadPath."/%/%' AND ip.visibility='1' LIMIT $from,$to";
  659. }
  660. $result = api_sql_query ($sql,__FILE__,__LINE__);
  661. while($row = Database::fetch_array($result, 'ASSOC'))
  662. {
  663. $attribute['path' ][] = $row['path' ];
  664. $attribute['visibility'][] = $row['visibility'];
  665. $attribute['comment' ][] = $row['comment' ];
  666. }
  667. $nbrActiveTests = 0;
  668. if(is_array($attribute['path']))
  669. {
  670. while(list($key,$path) = each($attribute['path']))
  671. {
  672. list($a,$vis)=each($attribute['visibility']);
  673. if (strcmp($vis,"1")==0)
  674. { $active=1;}
  675. else
  676. { $active=0;}
  677. echo "<tr>\n";
  678. $title = GetQuizName($path,$documentPath);
  679. if ($title =='')
  680. {
  681. $title = GetFileName($path);
  682. }
  683. // prof only
  684. if($is_allowedToEdit)
  685. {
  686. /************/
  687. ?>
  688. <td width="27%" colspan="2">
  689. <table border="0" cellpadding="0" cellspacing="0" width="100%">
  690. <tr>
  691. <td width="30" align="left"><img src="../img/jqz.jpg" alt="HotPotatoes" /></td>
  692. <td width="15" align="center"><?php echo ($ind+($page*$limitExPage)).'.'; ?></td>
  693. <td><a href="showinframes.php?file=<?php echo $path?>&cid=<?php echo $_course['official_code'];?>&uid=<?php echo $_user['user_id'];?>" <?php if(!$active) echo 'class="invisible"'; ?>><?php echo $title?></a></td>
  694. </tr>
  695. </table></td>
  696. <td></td><td></td>
  697. <td width="12%" align="center"><a href="adminhp.php?hotpotatoesName=<?php echo $path; ?>"> <img src="../img/edit.gif" border="0" alt="<?php echo htmlentities(get_lang('Modify'),ENT_QUOTES,$charset); ?>" /></a>
  698. <a href="<?php echo $exercicePath; ?>?hpchoice=delete&file=<?php echo $path; ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('AreYouSure'),ENT_QUOTES,$charset).$title."?"); ?>')) return false;"><img src="../img/delete.gif" border="0" alt="<?php echo htmlentities(get_lang('Delete'),ENT_QUOTES,$charset); ?>" /></a>
  699. <?php
  700. // if active
  701. if($active)
  702. {
  703. $nbrActiveTests = $nbrActiveTests + 1;
  704. ?>
  705. <a href="<?php echo $exercicePath; ?>?hpchoice=disable&page=<?php echo $page; ?>&file=<?php echo $path; ?>"><img src="../img/visible.gif" border="0" alt="<?php echo htmlentities(get_lang('Deactivate'),ENT_QUOTES,$charset); ?>" /></a>
  706. <?php
  707. }
  708. // else if not active
  709. else
  710. {
  711. ?>
  712. <a href="<?php echo $exercicePath; ?>?hpchoice=enable&page=<?php echo $page; ?>&file=<?php echo $path; ?>"><img src="../img/invisible.gif" border="0" alt="<?php echo htmlentities(get_lang('Activate'),ENT_QUOTES,$charset); ?>" /></a>
  713. <?php
  714. }
  715. /****************/
  716. ?></td>
  717. <?php }
  718. // student only
  719. else
  720. {
  721. if ($active==1)
  722. {
  723. $nbrActiveTests = $nbrActiveTests + 1;
  724. ?>
  725. <td width="40%"><table border="0" cellpadding="0" cellspacing="0" width="100%">
  726. <td width="20" align="right"><?php echo ($ind+($page*$limitExPage)).'.'; ?><!--<img src="../img/jqz.jpg" alt="HotPotatoes" />--></td>
  727. <td width="1">&nbsp;</td>
  728. <td><a href="showinframes.php?<?php echo api_get_cidreq()."&file=".$path."&cid=".$_course['official_code']."&uid=".$_user['user_id'].'"'; if(!$active) echo 'class="invisible"'; ?>"><?php echo $title;?></a></td>
  729. </tr>
  730. </table></td>
  731. </tr>
  732. <?php
  733. }
  734. }
  735. ?>
  736. <?php
  737. if($ind == $limitExPage)
  738. {
  739. break;
  740. }
  741. if($is_allowedToEdit)
  742. {
  743. $ind++;
  744. }
  745. else
  746. {
  747. if ($active==1)
  748. {
  749. $ind++;
  750. }
  751. }
  752. }
  753. }
  754. } //end if ($origin != 'learnpath') {
  755. ?>
  756. </table>
  757. <?php
  758. }else{
  759. if($origin != 'learnpath'){
  760. echo '<a href="'.api_add_url_param($_SERVER['REQUEST_URI'],'show=test').'">&lt;&lt; '.get_lang('Back').'</a>';
  761. }
  762. }// end if($show == 'test')
  763. /*****************************************/
  764. /* Exercise Results (uses tracking tool) */
  765. /*****************************************/
  766. // if tracking is enabled
  767. if($_configuration['tracking_enabled'])
  768. {
  769. if($show == 'result')
  770. {
  771. // the form
  772. echo '<form id="form1a" name="form1a" method="post" action="'.api_get_self().'?show='.Security::remove_XSS($_GET['show']).'">';
  773. echo '<input type="hidden" name="export_report" value="export_report">';
  774. echo '<input type="hidden" name="export_format" value="csv">';
  775. echo '</form>';
  776. echo '<form id="form1b" name="form1b" method="post" action="'.api_get_self().'?show='.Security::remove_XSS($_GET['show']).'">';
  777. echo '<input type="hidden" name="export_report" value="export_report">';
  778. echo '<input type="hidden" name="export_format" value="xls">';
  779. echo '</form>';
  780. echo '<form id="form1c" name="form1c" method="post" action="'.api_get_self().'?show='.Security::remove_XSS($_GET['show']).'">';
  781. if($_SESSION['export_user_fields']==false)
  782. {
  783. $alt = get_lang('ExportWithUserFields');
  784. echo '<input type="hidden" name="export_user_fields" value="export_user_fields">';
  785. }
  786. else
  787. {
  788. $alt = get_lang('ExportWithoutUserFields');
  789. echo '<input type="hidden" name="export_user_fields" value="do_not_export_user_fields">';
  790. }
  791. echo '</form>';
  792. echo '<a class="quiz_export_link" href="#" onclick="document.form1a.submit();"><img align="absbottom" src="'.api_get_path(WEB_IMG_PATH).'excel.gif" alt="'.get_lang('ExportAsCSV').'">&nbsp;'.get_lang('ExportAsCSV').'</a>';
  793. echo '<a class="quiz_export_link" href="#" onclick="document.form1b.submit();"><img align="absbottom" src="'.api_get_path(WEB_IMG_PATH).'excel.gif" alt="'.get_lang('ExportAsXLS').'">&nbsp;'.get_lang('ExportAsXLS').'</a>';
  794. echo '<a class="quiz_export_link" href="#" onclick="document.form1c.submit();"><img align="absbottom" src="'.api_get_path(WEB_IMG_PATH).'synthese_view.gif" alt="'.$alt.'">&nbsp;'.$alt.'</a>';
  795. echo '<br /><br />';
  796. ?>
  797. <table class="data_table">
  798. <tr class="row_odd">
  799. <?php if($is_allowedToEdit || $is_tutor): ?>
  800. <th><?php echo get_lang("User"); ?></th><?php endif; ?>
  801. <th><?php echo get_lang("Exercice"); ?></th>
  802. <th><?php echo get_lang("Date"); ?></th>
  803. <th><?php echo get_lang("Result"); ?></th>
  804. <th><?php echo (($is_allowedToEdit||$is_tutor)?get_lang("CorrectTest"):get_lang("ViewTest")); ?></th>
  805. </tr>
  806. <?php
  807. if($is_allowedToEdit || $is_tutor)
  808. {
  809. //get all results (ourself and the others) as an admin should see them
  810. //AND exe_user_id <> $_user['user_id'] clause has been removed
  811. $sql="SELECT CONCAT(lastname,' ',firstname),ce.title, te.exe_result ,
  812. te.exe_weighting, UNIX_TIMESTAMP(te.exe_date),te.exe_id,email
  813. FROM $TBL_EXERCICES AS ce , $TBL_TRACK_EXERCICES AS te, $TBL_USER AS user
  814. WHERE te.exe_exo_id = ce.id AND user_id=te.exe_user_id AND te.exe_cours_id='$_cid'
  815. ORDER BY te.exe_cours_id ASC, ce.title ASC, te.exe_date ASC";
  816. $hpsql="SELECT CONCAT(tu.lastname,' ',tu.firstname), tth.exe_name,
  817. tth.exe_result , tth.exe_weighting, UNIX_TIMESTAMP(tth.exe_date)
  818. FROM $TBL_TRACK_HOTPOTATOES tth, $TBL_USER tu
  819. WHERE tu.user_id=tth.exe_user_id AND tth.exe_cours_id = '".$_cid."'
  820. ORDER BY tth.exe_cours_id ASC, tth.exe_date ASC";
  821. }
  822. else
  823. { // get only this user's results
  824. $sql="SELECT '',ce.title, te.exe_result , te.exe_weighting, UNIX_TIMESTAMP(te.exe_date),te.exe_id
  825. FROM $TBL_EXERCICES AS ce , $TBL_TRACK_EXERCICES AS te
  826. WHERE te.exe_exo_id = ce.id AND te.exe_user_id='".$_user['user_id']."' AND te.exe_cours_id='$_cid' AND results_disabled=0
  827. ORDER BY te.exe_cours_id ASC, ce.title ASC, te.exe_date ASC";
  828. $hpsql="SELECT '',exe_name, exe_result , exe_weighting, UNIX_TIMESTAMP(exe_date)
  829. FROM $TBL_TRACK_HOTPOTATOES
  830. WHERE exe_user_id = '".$_user['user_id']."' AND exe_cours_id = '".$_cid."'
  831. ORDER BY exe_cours_id ASC, exe_date ASC";
  832. }
  833. $results=getManyResultsXCol($sql,7);
  834. $hpresults=getManyResultsXCol($hpsql,5);
  835. $NoTestRes = 0;
  836. $NoHPTestRes = 0;
  837. //Print the results of tests
  838. if(is_array($results))
  839. {
  840. for($i = 0; $i < sizeof($results); $i++)
  841. {
  842. $id = $results[$i][5];
  843. $mailid = $results[$i][6];
  844. $user = $results[$i][0];
  845. $test = $results[$i][1];
  846. $dt = strftime($dateTimeFormatLong,$results[$i][4]);
  847. $res = $results[$i][2];
  848. echo '<tr';
  849. if($i%2==0) echo 'class="row_odd"'; else echo 'class="row_even"';
  850. echo '>';
  851. if($is_allowedToEdit || $is_tutor)
  852. {
  853. $user = $results[$i][0];
  854. echo '<td>'.$user.'</td>';
  855. }
  856. echo '<td>'.$test.'</td>';
  857. echo '<td>'.format_locale_date(get_lang('dateTimeFormatLong'),$results[$i][4]).'</td>';
  858. echo '<td>'.round(($res/($results[$i][3]!=0?$results[$i][3]:1))*100).'% ('.$res.' / '.$results[$i][3].')</td>';
  859. echo '<td>'.(($is_allowedToEdit||$is_tutor)?"<a href='exercise_show.php?user=$user&dt=$dt&res=$res&id=$id&email=$mailid'>".get_lang("Edit")."</a>":"<a href='exercise_show.php?dt=$dt&res=$res&id=$id'>".get_lang('Show')."</a>").'</td>';
  860. echo '</tr>';
  861. }
  862. }
  863. else
  864. {
  865. $NoTestRes = 1;
  866. }
  867. // Print the Result of Hotpotatoes Tests
  868. if(is_array($hpresults))
  869. {
  870. for($i = 0; $i < sizeof($hpresults); $i++)
  871. {
  872. $title = GetQuizName($hpresults[$i][1],$documentPath);
  873. if ($title =='')
  874. {
  875. $title = GetFileName($hpresults[$i][1]);
  876. }
  877. echo '<tr>';
  878. if($is_allowedToEdit)
  879. {
  880. echo '<td class="content">'.$hpresults[$i][0].'</td>';
  881. }
  882. echo '<td class="content">'.$title.'</td>';
  883. echo '<td class="content">'.strftime($dateTimeFormatLong,$hpresults[$i][4]).'</td>';
  884. echo '<td class="content">'.round(($hpresults[$i][2]/($hpresults[$i][3]!=0?$hpresults[$i][3]:1))*100).'% ('.$hpresults[$i][2].' / '.$hpresults[$i][3].')</td>';
  885. echo '<td></td>'; //there is no possibility to edit the results of a Hotpotatoes test
  886. echo '</tr>';
  887. }
  888. }
  889. else
  890. {
  891. $NoHPTestRes = 1;
  892. }
  893. if ($NoTestRes==1 && $NoHPTestRes==1)
  894. {
  895. ?>
  896. <tr>
  897. <td colspan="5"><?php echo get_lang("NoResult"); ?></td>
  898. </tr>
  899. <?php
  900. }
  901. ?>
  902. </table>
  903. <?php
  904. }else{
  905. echo '<p><img src="'.api_get_path(WEB_IMG_PATH).'show_test_results.gif" align="absbottom">&nbsp;<a href="'.api_add_url_param($_SERVER['REQUEST_URI'],'show=result').'">'.get_lang("Results").' &gt;&gt;</a></p>';
  906. }// end if($show == 'result')
  907. }// end if tracking is enabled
  908. if ($origin != 'learnpath') { //so we are not in learnpath tool
  909. Display::display_footer();
  910. }
  911. else
  912. {
  913. ?>
  914. <link rel="stylesheet" type="text/css" href="<?php echo $clarolineRepositoryWeb ?>css/default.css" />
  915. <?php
  916. }
  917. ?>