123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <?php
- $language_file = 'learnpath';
- if($_GET['origin']=='learnpath')
- {
- require_once ('../newscorm/learnpath.class.php');
- require_once ('../newscorm/learnpathItem.class.php');
- require_once ('../newscorm/scorm.class.php');
- require_once ('../newscorm/scormItem.class.php');
- require_once ('../newscorm/aicc.class.php');
- require_once ('../newscorm/aiccItem.class.php');
- }
- include ('../inc/global.inc.php');
- $this_section=SECTION_COURSES;
- include_once (api_get_path(LIBRARY_PATH).'fileManage.lib.php');
- $documentPath = api_get_path(SYS_COURSE_PATH).$_course['path']."/document";
- $full_file_path = $documentPath.$test;
- my_delete($full_file_path.$_user['user_id'].".t.html");
- $TABLETRACK_HOTPOTATOES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
- $tbl_learnpath_user = Database::get_course_table(TABLE_LEARNPATH_USER);
- $TABLE_LP_ITEM_VIEW = Database::get_course_table(TABLE_LP_ITEM_VIEW);
- $_cid = api_get_course_id();
- $test = mysql_real_escape_string($_REQUEST['test']);
- $score = mysql_real_escape_string($_REQUEST['score']);
- $origin = $_REQUEST['origin'];
- $jscript2run = '';
- function save_scores($file, $score)
- {
- global $_configuration, $origin,
- $_user, $_cid,
- $TABLETRACK_HOTPOTATOES;
-
- $weighting = 100;
- $reallyNow = time();
- $date = date("Y-m-d H:i:s", $reallyNow);
- if (!$_configuration['tracking_enabled'])
- {
- return 0;
- }
- if ($_user['user_id'])
- {
- $user_id = "'".$_user['user_id']."'";
- }
- else
- {
- $user_id = "NULL";
- }
- $sql = "INSERT INTO $TABLETRACK_HOTPOTATOES ".
- "(exe_name, exe_user_id, exe_date,exe_cours_id,exe_result,exe_weighting)" .
- "VALUES" .
- "('$file',$user_id,'$date','$_cid','$score','$weighting')";
- $res = api_sql_query($sql,__FILE__,__LINE__);
- if ($origin == 'learnpath')
- {
-
-
- global $jscript2run;
- $jscript2run .= '<script language="javascript" type="text/javascript">window.parent.API.void_save_asset('.$score.');</script>';
- }
-
- }
- save_scores($test, $score);
- if ($origin != 'learnpath')
- {
-
- $url = "exercice.php";
- $jscript2run .= '<script language="javascript" type="text/javascript">'."window.open('$url', '_top', '')".'</script>';
- echo $jscript2run;
- }
- else
- {
- ?>
- <html>
- <head>
- <link rel='stylesheet' type='text/css' href='../css/<?php echo api_get_setting('stylesheets');?>/scorm.css' />
- <?php echo $jscript2run; ?>
- </head>
- <body>
- <br />
- <div class='message'>
- <?php echo get_lang('HotPotatoesFinished'); ?>
- </div>
- </body>
- </html>
- <?php
- }
- ?>
|