Task #1765 - Removing/changing obsolete code for encoding management (1). LP tool, Tracking tool.

skala
Ivan Tcholakov 15 years ago
parent bba47a8d68
commit e9a1213bd6
  1. 1
      main/newscorm/display_audiorecorder.php
  2. 3
      main/newscorm/learnpath.class.php
  3. 3
      main/newscorm/learnpathList.class.php
  4. 10
      main/newscorm/learnpath_functions.inc.php
  5. 1
      main/newscorm/lp_author_image.php
  6. 2
      main/newscorm/lp_controller.php
  7. 89
      main/newscorm/lp_stats.php
  8. 1
      main/newscorm/lp_toc.php
  9. 16
      main/newscorm/lp_view.php
  10. 10
      main/tracking/courseLog.php
  11. 13
      main/tracking/courseLogCSV.php
  12. 15
      main/tracking/userLog.php
  13. 14
      main/tracking/userlogCSV.php

@ -24,7 +24,6 @@ if (isset($_SESSION['lpobject'])) {
die('Could not instanciate lp object.');
}
}
$charset = $_SESSION['oLP']->encoding;
$lp_theme_css = $_SESSION['oLP']->get_theme();
$scorm_css_header = true;

@ -82,6 +82,7 @@ class learnpath {
* @return boolean True on success, false on error
*/
public function __construct($course, $lp_id, $user_id) {
$this->encoding = api_get_system_encoding(); // Chamilo 1.8.8: We intend always to use the system encoding.
// Check params.
// Check course code.
if ($this->debug > 0) {error_log('New LP - In learnpath::__construct('.$course.','.$lp_id.','.$user_id.')', 0); }
@ -120,7 +121,7 @@ class learnpath {
$row = Database::fetch_array($res);
$this->type = $row['lp_type'];
$this->name = stripslashes($row['name']);
$this->encoding = $row['default_encoding'];
//$this->encoding = $row['default_encoding']; // Chamilo 1.8.8: We intend not to use 'default_encoding' field anymore.
$this->proximity = $row['content_local'];
$this->theme = $row['theme'];
$this->maker = $row['content_maker'];

@ -84,7 +84,8 @@ class learnpathList {
'lp_force_commit' => $row['force_commit'],
'lp_maker' => stripslashes($row['content_maker']),
'lp_proximity' => $row['content_local'],
'lp_encoding' => $row['default_encoding'],
//'lp_encoding' => $row['default_encoding'],
'lp_encoding' => api_get_system_encoding(), // Chamilo 1.8.8: We intend always to use the system encoding.
'lp_visibility' => $vis,
'lp_published' => $pub,
'lp_prevent_reinit' => $row['prevent_reinit'],

@ -2111,15 +2111,9 @@ function createimsmanifest($circle1_files, $learnpath_id) {
include_once '../metadata/md_funcs.php'; // RH: export metadata
// 1.1 Header
/*
$header='<?xml version="1.0" encoding="UTF-8"?><manifest identifier="'.$LPnamesafe.'" xmlns="http://www.imsglobal.org/xsd/imscp_v1p1" xmlns:imsmd="http://www.imsglobal.org/xsd/imsmd_v1p2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.imsglobal.org/xsd/imscp_v1p1 imscp_v1p1.xsd http://www.imsglobal.org/xsd/imsmd_v1p2 imsmd_v1p2.xsd" version="IMS CP 1.1.3">'."\n";
*/
// 1.2
// Header
// Charset should be dependent on content.
$mycharset = api_get_system_encoding();
$header = '<?xml version="1.0" encoding="'.$mycharset.'"?>'."\n<manifest identifier='".$LPnamesafe."' version='1.1'\n xmlns='http://www.imsproject.org/xsd/imscp_rootv1p1p2'\n xmlns:adlcp='http://www.adlnet.org/xsd/adlcp_rootv1p2'\n xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'\n xsi:schemaLocation='http://www.imsproject.org/xsd/imscp_rootv1p1p2 imscp_rootv1p1p2.xsd\n http://www.imsglobal.org/xsd/imsmd_rootv1p2p1 imsmd_rootv1p2p1.xsd\n http://www.adlnet.org/xsd/adlcp_rootv1p2 adlcp_rootv1p2.xsd'>\n";
$header = '<?xml version="1.0" encoding="'.api_get_system_encoding().'"?>'."\n<manifest identifier='".$LPnamesafe."' version='1.1'\n xmlns='http://www.imsproject.org/xsd/imscp_rootv1p1p2'\n xmlns:adlcp='http://www.adlnet.org/xsd/adlcp_rootv1p2'\n xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'\n xsi:schemaLocation='http://www.imsproject.org/xsd/imscp_rootv1p1p2 imscp_rootv1p1p2.xsd\n http://www.imsglobal.org/xsd/imsmd_rootv1p2p1 imsmd_rootv1p2p1.xsd\n http://www.adlnet.org/xsd/adlcp_rootv1p2 adlcp_rootv1p2.xsd'>\n";
$org .= xmltagwrite('metadata', 'open');
$org .= ' '.xmltagwrite('schema', 'full', 'ADL SCORM');

@ -23,7 +23,6 @@ if (isset($_SESSION['lpobject'])) {
}
}
/*
$charset = $_SESSION['oLP']->encoding;
$lp_theme_css = $_SESSION['oLP']->get_theme();
*/

@ -748,7 +748,6 @@ switch ($action) {
$lp_id = $_SESSION['oLP']->get_id();
$list = $_SESSION['oLP']->get_flat_ordered_items_list($lp_id);
$user_id = api_get_user_id();
$stats_charset = $_SESSION['oLP']->encoding;
require 'lp_stats.php';
}
break;
@ -829,7 +828,6 @@ switch ($action) {
$lp_id = $_SESSION['oLP']->get_id();
$list = $_SESSION['oLP']->get_flat_ordered_items_list($lp_id);
$user_id = api_get_user_id();
$stats_charset = $_SESSION['oLP']->encoding;
header('location: '.api_get_path(WEB_COURSE_PATH).api_get_course_path().'/index.php');
}
break;

@ -30,38 +30,20 @@ $session_condition = api_get_session_condition($session_id);
//$lp_id = $_SESSION['oLP']->get_id();
//$list = $_SESSION['oLP']->get_flat_ordered_items_list($lp_id);
//$user_id = $_user['user_id'];
//$stats_charset = $_SESSION['oLP']->encoding
if (!isset($origin))
$origin = '';
if ($origin != 'tracking') {
if (!empty ($stats_charset)) {
$lp_charset = $stats_charset;
} else {
$lp_charset = api_get_system_encoding();
}
$charset = $lp_charset;
//$w = $tablewidth -20;
$htmlHeadXtra[] = ''.'<style type="text/css" media="screen, projection">
$htmlHeadXtra[] = '<style type="text/css" media="screen, projection">
/*<![CDATA[*/
@import "../css/public_admin/scorm.css";
/*]]>*/
</style>';
include_once api_get_path(INCLUDE_PATH).'reduced_header.inc.php';
echo '<body>';
} else {
// Get learning path's encoding.
$TBL_LP = Database :: get_course_table(TABLE_LP_MAIN);
$sql = "SELECT default_encoding FROM $TBL_LP " .
"WHERE id = '".(int)$_GET['lp_id']."'";
$res = Database::query($sql);
if (Database :: num_rows($res) > 0) {
$row = Database::fetch_array($res);
$lp_charset = $row['default_encoding'];
}
echo '<body dir="'.api_get_text_direction().'">';
}
// The Chamilo interface's encoding
$dokeos_charset = api_get_system_encoding();
$output = '';
// if display in fullscreen required.
if (!empty($_GET['fs']) && strcmp($_GET['fs'], 'true') == 0) {
@ -80,16 +62,16 @@ if ($origin == 'tracking') {
}
if (!empty ($_GET['extend_all'])) {
$extend_all_link = '<a href="' . api_get_self() . '?action=stats' . $url_suffix . '"><img src="../img/view_less_stats.gif" alt="fold_view" border="0" title="'.api_convert_encoding(get_lang('HideAllAttempts'), $lp_charset, $dokeos_charset).'"></a>';
$extend_all_link = '<a href="' . api_get_self() . '?action=stats' . $url_suffix . '"><img src="../img/view_less_stats.gif" alt="fold_view" border="0" title="'.get_lang('HideAllAttempts').'"></a>';
$extend_all = 1;
} else {
$extend_all_link = '<a href="' . api_get_self() . '?action=stats&extend_all=1' . $url_suffix . '"><img src="../img/view_more_stats.gif" alt="extend_view" border="0" title="'.api_convert_encoding(get_lang('ShowAllAttempts'), $lp_charset, $dokeos_charset).'"></a>';
$extend_all_link = '<a href="' . api_get_self() . '?action=stats&extend_all=1' . $url_suffix . '"><img src="../img/view_more_stats.gif" alt="extend_view" border="0" title="'.get_lang('ShowAllAttempts').'"></a>';
}
if ($origin != 'tracking') {
$output .= "<tr><td><div class='title'>" . api_convert_encoding(get_lang('ScormMystatus'), $lp_charset, $dokeos_charset) . "</div></td></tr>";
$output .= "<tr><td><div class='title'>" . get_lang('ScormMystatus') . "</div></td></tr>";
}
$output .= "<tr><td>&nbsp;</td></tr>" . "<tr><td>" . "<table border='0' class='data_table'><tr>\n" . '<td width="16">' . $extend_all_link . '</td>' . '<td colspan="4" class="title"><div class="mystatusfirstrow">' . api_convert_encoding(get_lang('ScormLessonTitle'), $lp_charset, $dokeos_charset) . "</div></td>\n" . '<td colspan="2" class="title"><div class="mystatusfirstrow">' . api_convert_encoding(get_lang('ScormStatus'), $lp_charset, $dokeos_charset) . "</div></td>\n" . '<td colspan="2" class="title"><div class="mystatusfirstrow">' . api_convert_encoding(get_lang('ScormScore'), $lp_charset, $dokeos_charset) . "</div></td>\n" . '<td colspan="2" class="title"><div class="mystatusfirstrow">' . api_convert_encoding(get_lang('ScormTime'), $lp_charset, $dokeos_charset) . "</div></td><td class='title'><div class='mystatusfirstrow'>" . api_convert_encoding(get_lang('Actions'), $lp_charset, $dokeos_charset) . "</div></td></tr>\n";
$output .= "<tr><td>&nbsp;</td></tr>" . "<tr><td>" . "<table border='0' class='data_table'><tr>\n" . '<td width="16">' . $extend_all_link . '</td>' . '<td colspan="4" class="title"><div class="mystatusfirstrow">' . get_lang('ScormLessonTitle') . "</div></td>\n" . '<td colspan="2" class="title"><div class="mystatusfirstrow">' . get_lang('ScormStatus') . "</div></td>\n" . '<td colspan="2" class="title"><div class="mystatusfirstrow">' . get_lang('ScormScore') . "</div></td>\n" . '<td colspan="2" class="title"><div class="mystatusfirstrow">' . get_lang('ScormTime') . "</div></td><td class='title'><div class='mystatusfirstrow'>" .get_lang('Actions') . "</div></td></tr>\n";
// Going through the items using the $items[] array instead of the database order ensures
// we get them in the same order as in the imsmanifest file, which is rather random when using
@ -115,14 +97,14 @@ $counter = 0;
$total_score = 0;
$total_max_score = 0;
$total_time = 0;
$h = api_convert_encoding(get_lang('h'), $lp_charset, $dokeos_charset);
$h = get_lang('h');
if (!empty($export_csv)) {
$csv_content[] = array (
api_convert_encoding(get_lang('ScormLessonTitle'), $lp_charset, $dokeos_charset),
api_convert_encoding(get_lang('ScormStatus'), $lp_charset, $dokeos_charset),
api_convert_encoding(get_lang('ScormScore'), $lp_charset, $dokeos_charset),
api_convert_encoding(get_lang('ScormTime'), $lp_charset, $dokeos_charset)
get_lang('ScormLessonTitle'),
get_lang('ScormStatus'),
get_lang('ScormScore'),
get_lang('ScormTime')
);
}
@ -221,7 +203,7 @@ if (is_array($list) && count($list) > 0) {
}
$extend_link = '';
if (!empty($inter_num)) {
$extend_link = '<a href="' . api_get_self() . '?action=stats&fold_id=' . $my_item_id . $url_suffix . '"><img src="../img/visible.gif" alt="'.api_convert_encoding(get_lang('HideAttemptView'), $lp_charset, $dokeos_charset).'" title="'.api_convert_encoding(get_lang('HideAttemptView'), $lp_charset, $dokeos_charset).'" border="0"></a>' . "\n";
$extend_link = '<a href="' . api_get_self() . '?action=stats&fold_id=' . $my_item_id . $url_suffix . '"><img src="../img/visible.gif" alt="'.get_lang('HideAttemptView').'" title="'.get_lang('HideAttemptView').'" border="0"></a>' . "\n";
}
$title = $row['mytitle'];
@ -231,7 +213,6 @@ if (is_array($list) && count($list) > 0) {
if ($row['item_type'] != 'dokeos_chapter') {
$correct_test_link = '-';
//api_convert_encoding($title, $lp_charset, $lp_charset)
$title = Security::remove_XSS($title);
$output .= "<tr class='$oddclass'>\n" . "<td>$extend_link</td>\n" . '<td colspan="4" class="content"><div class="mystatus">' . $title . "</div></td>\n" . '<td colspan="2" class="content"></td>' . "\n" . '<td colspan="2" class="content"></td>' . "\n" . '<td colspan="2" class="content"></td><td class="content"></td>' . "\n" . "</tr>\n";
}
@ -247,10 +228,10 @@ if (is_array($list) && count($list) > 0) {
if (!empty ($_GET['extend_attempt_id']) && $_GET['extend_attempt_id'] == $row['iv_id']) {
// The extend button for this attempt has been clicked.
$extend_this_attempt = 1;
$extend_attempt_link = '<a href="' . api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&fold_attempt_id=' . $row['iv_id'] . $url_suffix . '"><img src="../img/visible.gif" alt="'.api_convert_encoding(get_lang('HideAttemptView'), $lp_charset, $dokeos_charset).'" title="'.api_convert_encoding(get_lang('HideAttemptView'), $lp_charset, $dokeos_charset).'" border="0"></a>' . "\n";
$extend_attempt_link = '<a href="' . api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&fold_attempt_id=' . $row['iv_id'] . $url_suffix . '"><img src="../img/visible.gif" alt="'.get_lang('HideAttemptView').'" title="'.get_lang('HideAttemptView').'" border="0"></a>' . "\n";
} else { // Same case if fold_attempt_id is set, so not implemented explicitly.
// The extend button for this attempt has not been clicked.
$extend_attempt_link = '<a href="' . api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&extend_attempt_id=' . $row['iv_id'] . $url_suffix . '"><img src="../img/invisible.gif" alt="'.api_convert_encoding(get_lang('ExtendAttemptView'), $lp_charset, $dokeos_charset).'" title="'.api_convert_encoding(get_lang('ExtendAttemptView'), $lp_charset, $dokeos_charset).'" border="0"></a>' . "\n";
$extend_attempt_link = '<a href="' . api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&extend_attempt_id=' . $row['iv_id'] . $url_suffix . '"><img src="../img/invisible.gif" alt="'.get_lang('ExtendAttemptView').'" title="'.get_lang('ExtendAttemptView').'" border="0"></a>' . "\n";
}
}
@ -298,7 +279,7 @@ if (is_array($list) && count($list) > 0) {
'not attempted' => 'ScormNotAttempted'
);
$my_lesson_status = api_convert_encoding(get_lang($mylanglist[$lesson_status]), $lp_charset, $dokeos_charset);
$my_lesson_status = get_lang($mylanglist[$lesson_status]);
if ($row['item_type'] != 'dokeos_chapter') {
if (!$is_allowed_to_edit && $result_disabled_ext_all) {
@ -306,8 +287,7 @@ if (is_array($list) && count($list) > 0) {
} else {
$view_score = ($score == 0 ? '/' : ($maxscore === 0 ? $score : $score . '/' . float_format($maxscore, 1)));
}
$output .= "<tr class='$oddclass'>\n" . "<td></td>\n" . "<td>$extend_attempt_link</td>\n" . '<td colspan="3">' . api_convert_encoding(get_lang('Attempt'), $lp_charset, $dokeos_charset) . ' ' . $row['iv_view_count'] . "</td>\n"
//."<td><font color='$color'><div class='mystatus'>".api_htmlentities($array_status[$lesson_status],ENT_QUOTES,$lp_charset)."</div></font></td>\n"
$output .= "<tr class='$oddclass'>\n" . "<td></td>\n" . "<td>$extend_attempt_link</td>\n" . '<td colspan="3">' . get_lang('Attempt') . ' ' . $row['iv_view_count'] . "</td>\n"
. '<td colspan="2"><font color="' . $color . '"><div class="mystatus">' . $my_lesson_status . "</div></font></td>\n" . '<td colspan="2"><div class="mystatus" align="center">' . $view_score . "</div></td>\n" . '<td colspan="2"><div class="mystatus">'.$time.'</div></td><td></td></tr>';
if (!empty($export_csv)) {
@ -353,9 +333,7 @@ if (is_array($list) && count($list) > 0) {
$student_response = implode(',',$content_student_response);
}
$output .= "<tr class='$oddclass'>\n" . '<td></td>' . "\n" . '<td></td>' . "\n" . '<td>&nbsp;</td>' . "\n" . '<td>' . $interaction['order_id'] . '</td>' . "\n" . '<td>' . $interaction['id'] . '</td>' . "\n"
//."<td><font color='$color'><div class='mystatus'>".api_convert_encoding($array_status[$lesson_status],$lp_charset,$lp_charset)."</div></font></td>\n"
. '<td colspan="2">' . $interaction['type'] . "</td>\n"
//.'<td>'.$interaction['correct_responses']."</td>\n"
. '<td>' . $student_response . "</td>\n" . '<td>' . $interaction['result'] . "</td>\n" . '<td>' . $interaction['latency'] . "</td>\n" . '<td>' . $interaction['time'] . "</td>\n<td></td>\n</tr>\n";
$counter++;
}
@ -405,10 +383,10 @@ if (is_array($list) && count($list) > 0) {
if (!empty ($_GET['extend_attempt_id']) && $_GET['extend_attempt_id'] == $row['iv_id']) {
// The extend button for this attempt has been clicked.
$extend_this_attempt = 1;
$extend_attempt_link = '<a href="' . api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&fold_attempt_id=' . $row['iv_id'] . $url_suffix . '"><img src="../img/visible.gif" alt="'.api_convert_encoding(get_lang('HideAttemptView'),$lp_charset,$charset).'" title="'.api_convert_encoding(get_lang('HideAttemptView'),$lp_charset,$charset).'" border="0"></a>' . "\n";
$extend_attempt_link = '<a href="' . api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&fold_attempt_id=' . $row['iv_id'] . $url_suffix . '"><img src="../img/visible.gif" alt="'.get_lang('HideAttemptView').'" title="'.get_lang('HideAttemptView').'" border="0"></a>' . "\n";
} else { // Same case if fold_attempt_id is set, so not implemented explicitly.
// The extend button for this attempt has not been clicked.
$extend_attempt_link = '<a href="' . api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&extend_attempt_id=' . $row['iv_id'] . $url_suffix . '"><img src="../img/invisible.gif" alt="'.api_convert_encoding(get_lang('ExtendAttemptView'),$lp_charset,$charset).'" title="'.api_convert_encoding(get_lang('ExtendAttemptView'),$lp_charset,$charset).'" border="0"></a>' . "\n";
$extend_attempt_link = '<a href="' . api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&extend_attempt_id=' . $row['iv_id'] . $url_suffix . '"><img src="../img/invisible.gif" alt="'.get_lang('ExtendAttemptView').'" title="'.get_lang('ExtendAttemptView').'" border="0"></a>' . "\n";
}
}
@ -420,7 +398,7 @@ if (is_array($list) && count($list) > 0) {
//$extend_link = '<img src="../img/invisible.gif" alt="extend_disabled">';
$extend_link = '';
if ($inter_num > 1) {
$extend_link = '<a href="' . api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&extend_attempt_id=' . $row['iv_id'] . $url_suffix . '"><img src="../img/invisible.gif" alt="'.api_convert_encoding(get_lang('ExtendAttemptView'),$lp_charset,$charset).'" title="'.api_convert_encoding(get_lang('ExtendAttemptView'),$lp_charset,$charset).'" border="0"></a>';
$extend_link = '<a href="' . api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&extend_attempt_id=' . $row['iv_id'] . $url_suffix . '"><img src="../img/invisible.gif" alt="'.get_lang('ExtendAttemptView').'" title="'.get_lang('ExtendAttemptView').'" border="0"></a>';
}
if (($counter % 2) == 0) {
$oddclass = 'row_odd';
@ -524,7 +502,7 @@ if (is_array($list) && count($list) > 0) {
'not attempted' => 'ScormNotAttempted',
);
$my_lesson_status = api_convert_encoding(get_lang($mylanglist[$lesson_status]), $lp_charset, $dokeos_charset);
$my_lesson_status = get_lang($mylanglist[$lesson_status]);
if ($row['item_type'] != 'dokeos_chapter') {
if ($row['item_type'] == 'quiz') {
@ -542,10 +520,10 @@ if (is_array($list) && count($list) > 0) {
$num = Database :: num_rows($resultLastAttempt);
if ($num > 0) {
if (isset($_GET['extend_attempt']) && $_GET['extend_attempt'] == 1 && (isset($_GET['lp_id']) && $_GET['lp_id'] == $my_lp_id) && (isset($_GET['my_lp_id']) && $_GET['my_lp_id'] == $my_id) ) {
$correct_test_link = '<a href="' . api_get_self() . '?action=stats' . $my_url_suffix . '&my_ext_lp_id='.$my_id.'"><img src="../img/view_less_stats.gif" alt="fold_view" border="0" title="'.api_convert_encoding(get_lang('HideAllAttempts'),$lp_charset,$charset).'"></a>';
$correct_test_link = '<a href="' . api_get_self() . '?action=stats' . $my_url_suffix . '&my_ext_lp_id='.$my_id.'"><img src="../img/view_less_stats.gif" alt="fold_view" border="0" title="'.get_lang('HideAllAttempts').'"></a>';
$extend_attempt = 1;
} else {
$correct_test_link = '<a href="' . api_get_self() . '?action=stats&extend_attempt=1'.$my_url_suffix.'&my_lp_id='.$my_id.'"><img src="../img/view_more_stats.gif" alt="extend_view" border="0" title="'.api_convert_encoding(get_lang('ShowAllAttemptsByExercise'),$lp_charset,$charset).'"></a>';
$correct_test_link = '<a href="' . api_get_self() . '?action=stats&extend_attempt=1'.$my_url_suffix.'&my_lp_id='.$my_id.'"><img src="../img/view_more_stats.gif" alt="extend_view" border="0" title="'.get_lang('ShowAllAttemptsByExercise').'"></a>';
}
} else {
$correct_test_link = '-';
@ -554,7 +532,6 @@ if (is_array($list) && count($list) > 0) {
$correct_test_link = '-';
}
//."<td><font color='$color'><div class='mystatus'>".api_htmlentities($array_status[$lesson_status],ENT_QUOTES,$lp_charset)."</div></font></td>\n"
$title = Security::remove_XSS($title);
if ( (isset($_GET['lp_id']) && $_GET['lp_id'] == $my_lp_id ) && (isset($_GET['my_lp_id']) && $_GET['my_lp_id'] == $my_id)) {
$output .= "<tr class='$oddclass' >\n" . "<td>$extend_link</td>\n" . '<td colspan="4"><div class="mystatus">' .$title. '</div></td>' . "\n";
@ -585,8 +562,8 @@ if (is_array($list) && count($list) > 0) {
if (!empty($export_csv)) {
$temp = array ();
$temp[] = api_html_entity_decode($title, ENT_QUOTES, $lp_charset);
$temp[] = api_html_entity_decode($my_lesson_status, ENT_QUOTES, $lp_charset);
$temp[] = api_html_entity_decode($title, ENT_QUOTES);
$temp[] = api_html_entity_decode($my_lesson_status, ENT_QUOTES);
if ($row['item_type'] == 'quiz') {
@ -614,9 +591,7 @@ if (is_array($list) && count($list) > 0) {
$oddclass = 'row_even';
}
$output .= "<tr class='$oddclass'>\n" . '<td></td>' . "\n" . '<td></td>' . "\n" . '<td>&nbsp;</td>' . "\n" . '<td>' . $interaction['order_id'] . '</td>' . "\n" . '<td>' . $interaction['id'] . '</td>' . "\n"
//."<td><font color='$color'><div class='mystatus'>"api_convert_encoding($array_status[$lesson_status],$lp_charset,$lp_charset)."</div></font></td>\n"
. '<td colspan="2">' . $interaction['type'] . "</td>\n"
//.'<td>'.$interaction['correct_responses']."</td>\n"
. '<td>' . urldecode($interaction['student_response']) . "</td>\n" . '<td>' . $interaction['result'] . "</td>\n" . '<td>' . $interaction['latency'] . "</td>\n" . '<td>' . $interaction['time'] . "</td>\n<td></td>\n</tr>\n";
$counter++;
}
@ -672,19 +647,19 @@ if (is_array($list) && count($list) > 0) {
//$view_score = ($my_score == 0 ? '0.00/'.$my_maxscore : ($my_maxscore == 0 ? $my_score : $my_score . '/' . $my_maxscore));
}
$time_attemp;
$output .= '<tr class="'.$oddclass.'" ><td>&nbsp;</td><td>'.$extend_attempt_link.'</td><td colspan="3">' . api_convert_encoding(get_lang('Attempt'), $lp_charset, $dokeos_charset) . ' ' . $n . '</td>'
$output .= '<tr class="'.$oddclass.'" ><td>&nbsp;</td><td>'.$extend_attempt_link.'</td><td colspan="3">' . get_lang('Attempt') . ' ' . $n . '</td>'
. '<td colspan="2"><font color="' . $color . '"><div class="mystatus">' . $my_lesson_status . '</div></font></td><td colspan="2"><div class="mystatus" align="center">' . $view_score . '</div></td><td colspan="2"><div class="mystatus">' . $time_attemp . '</div></td>';
if ($origin != 'tracking') {
if (!$is_allowed_to_edit && $result_disabled_ext_all) {
$output .= '<td><img src="' . api_get_path(WEB_IMG_PATH) . 'quiz_na.gif" alt="'.api_convert_encoding(get_lang('ShowAttempt'), $lp_charset, $dokeos_charset).'" title="'.api_convert_encoding(get_lang('ShowAttempt'), $lp_charset, $dokeos_charset).'"></td>';
$output .= '<td><img src="' . api_get_path(WEB_IMG_PATH) . 'quiz_na.gif" alt="'.get_lang('ShowAttempt').'" title="'.get_lang('ShowAttempt').'"></td>';
} else {
$output .= '<td><a href="../exercice/exercise_show.php?origin=student_progress&myid='.$my_orig_lp.'&my_lp_id='.$my_orig_lp_item.'&id=' . $my_exe_id . '&cidReq=' . $course_code . '&student=' . $student_id .$from_link. '" target="_parent"><img src="' . api_get_path(WEB_IMG_PATH) . 'quiz.gif" alt="'.api_convert_encoding(get_lang('ShowAttempt'), $lp_charset, $dokeos_charset).'" title="'.api_convert_encoding(get_lang('ShowAttempt'), $lp_charset, $dokeos_charset).'"></a></td>';
$output .= '<td><a href="../exercice/exercise_show.php?origin=student_progress&myid='.$my_orig_lp.'&my_lp_id='.$my_orig_lp_item.'&id=' . $my_exe_id . '&cidReq=' . $course_code . '&student=' . $student_id .$from_link. '" target="_parent"><img src="' . api_get_path(WEB_IMG_PATH) . 'quiz.gif" alt="'.get_lang('ShowAttempt').'" title="'.get_lang('ShowAttempt').'"></a></td>';
}
} else {
if (!$is_allowed_to_edit && $result_disabled_ext_all ) {
$output .= '<td><img src="' . api_get_path(WEB_IMG_PATH) . 'quiz_na.gif" alt="'.api_convert_encoding(get_lang('ShowAndQualifyAttempt'), $lp_charset, $dokeos_charset).'" title="'.api_convert_encoding(get_lang('ShowAndQualifyAttempt'), $lp_charset, $dokeos_charset).'"></td>';
$output .= '<td><img src="' . api_get_path(WEB_IMG_PATH) . 'quiz_na.gif" alt="'.get_lang('ShowAndQualifyAttempt').'" title="'.get_lang('ShowAndQualifyAttempt').'"></td>';
} else {
$output .= '<td><a href="../exercice/exercise_show.php?origin=tracking_course&myid='.$my_orig_lp.'&my_lp_id='.$my_orig_lp_item.'&id=' . $my_exe_id . '&cidReq=' . $course_code . '&student=' . $student_id . '&total_time='.$mytime.'&my_exe_exo_id='.$my_exo_exe_id.$from_link.' " target="_parent"><img src="' . api_get_path(WEB_IMG_PATH) . 'quiz.gif" alt="'.api_convert_encoding(get_lang('ShowAndQualifyAttempt'), $lp_charset, $dokeos_charset).'" title="'.api_convert_encoding(get_lang('ShowAndQualifyAttempt'), $lp_charset, $dokeos_charset).'"></a></td>';
$output .= '<td><a href="../exercice/exercise_show.php?origin=tracking_course&myid='.$my_orig_lp.'&my_lp_id='.$my_orig_lp_item.'&id=' . $my_exe_id . '&cidReq=' . $course_code . '&student=' . $student_id . '&total_time='.$mytime.'&my_exe_exo_id='.$my_exo_exe_id.$from_link.' " target="_parent"><img src="' . api_get_path(WEB_IMG_PATH) . 'quiz.gif" alt="'.get_lang('ShowAndQualifyAttempt').'" title="'.get_lang('ShowAndQualifyAttempt').'"></a></td>';
}
}
$output .= '</tr>';
@ -752,7 +727,7 @@ if (($counter % 2) == 0) {
}
if (empty($extend_all)) {
$output .= "<tr class='$oddclass'>\n" . "<td></td>\n" . '<td colspan="4"><div class="mystatus"><i>' . api_convert_encoding(get_lang('AccomplishedStepsTotal') , $lp_charset, $dokeos_charset) . "</i></div></td>\n"
$output .= "<tr class='$oddclass'>\n" . "<td></td>\n" . '<td colspan="4"><div class="mystatus"><i>' . get_lang('AccomplishedStepsTotal') . "</i></div></td>\n"
. '<td colspan="2"></td>' . "\n" . '<td colspan="2"><div class="mystatus" align="center">' . $final_score . "</div></td>\n" . '<td colspan="2"><div class="mystatus">' . $total_time . '</div></td><td></td>' . "\n" . "</tr>\n";
}
@ -767,7 +742,7 @@ if (!empty($export_csv)) {
);
$csv_content[] = $temp;
$temp = array (
api_convert_encoding(get_lang('AccomplishedStepsTotal') , $lp_charset, $dokeos_charset),
get_lang('AccomplishedStepsTotal'),
'',
$final_score,
$total_time

@ -29,7 +29,6 @@ if (isset($_SESSION['lpobject'])) {
die('Could not instanciate lp object');
}
}
$charset = $_SESSION['oLP']->encoding;
$htmlHeadXtra[] = '<script language="JavaScript" type="text/javascript">
var dokeos_xajax_handler = window.parent.oxajax;

@ -24,9 +24,8 @@ if ($lp_controller_touched != 1){
exit;
}
/*
Libraries
*/
/* Libraries */
require_once 'back_compat.inc.php';
//require_once '../learnpath/learnpath_functions.inc.php';
require_once 'scorm.lib.php';
@ -36,13 +35,6 @@ require_once 'learnpathItem.class.php';
if (!$is_allowed_in_course) api_not_allowed();
// We set the encoding of the lp.
if (!empty($_SESSION['oLP']->encoding)) {
$charset = $_SESSION['oLP']->encoding;
} else {
$charset = api_get_system_encoding();
}
$oLearnpath = false;
$course_code = api_get_course_id();
$user_id = api_get_user_id();
@ -200,7 +192,7 @@ if ($type_quiz && !empty($_REQUEST['exeId']) && isset($_GET['lp_id']) && isset($
}
$_SESSION['oLP']->set_previous_item($lp_item_id);
$nameTools = Security :: remove_XSS(api_convert_encoding($_SESSION['oLP']->get_name(), $charset, api_get_system_encoding()));
$nameTools = Security :: remove_XSS($_SESSION['oLP']->get_name());
$save_setting = api_get_setting('show_navigation_menu');
global $_setting;
@ -240,7 +232,7 @@ if ($_SESSION['oLP']->mode == 'fullscreen') {
</td>
<td>
<a class="link" href="lp_controller.php?action=return_to_course_homepage&<?php echo api_get_cidreq(); ?>" target="_self" onclick="javascript: window.parent.API.save_asset();">
<?php echo api_convert_encoding(get_lang('CourseHomepageLink'), $charset, api_get_system_encoding()); ?></a>
<?php echo get_lang('CourseHomepageLink'); ?></a>
</td>
</tr>
</table>

@ -72,16 +72,6 @@ if ($export_csv) {
}
$csv_content = array();
// Charset determination.
if (!empty($_GET['scormcontopen'])) {
$tbl_lp = Database::get_course_table(TABLE_LP_MAIN);
$contopen = (int) $_GET['scormcontopen'];
$sql = "SELECT default_encoding FROM $tbl_lp WHERE id = $contopen AND session_id = $session_id";
$res = Database::query($sql);
$row = Database::fetch_array($res);
$lp_charset = $row['default_encoding'];
}
$htmlHeadXtra[] = "<style type='text/css'>
/*<![CDATA[*/
.secLine {background-color : #E6E6E6;}

@ -26,18 +26,6 @@ require_once '../newscorm/learnpathItem.class.php';
require_once '../newscorm/scorm.class.php';
require_once '../newscorm/scormItem.class.php';
// Charset determination.
if ($_GET['scormcontopen'])
{
$tbl_lp = Database::get_course_table(TABLE_LP_MAIN);
$contopen = (int) $_GET['scormcontopen'];
$sql = "SELECT default_encoding FROM $tbl_lp WHERE id = ".$contopen;
$res = Database::query($sql);
$row = Database::fetch_array($res);
$lp_charset = $row['default_encoding'];
//header('Content-Type: text/html; charset='. $row['default_encoding']);
}
/* Constants and variables */
// regroup table names for maintenance purpose
@ -420,7 +408,6 @@ if($is_allowedToTrack && $_configuration['tracking_enabled'])
while ($ar3['status'] != '') {
require_once '../newscorm/learnpathItem.class.php';
$time = learnpathItem::get_scorm_time('php',$ar3['total_time']);
$title = api_htmlentities($ar3['title'],ENT_QUOTES,$lp_charset);
$line .= $title.";".$ar3['status'].";".$ar3['score'].";".$time;
$ar3=Database::fetch_array($result3);
}

@ -38,20 +38,6 @@ require_once api_get_path(SYS_CODE_PATH).'exercice/hotpotatoes.lib.php';
/* Header */
// Charset determination.
if (isset($_GET['scormcontopen'])) {
$tbl_lp = Database::get_course_table(TABLE_LP_MAIN);
$contopen = Database::escape_string($_GET['scormcontopen']);
if (is_numeric($contopen)) {
$contopen = intval($contopen);
$sql = "SELECT default_encoding FROM $tbl_lp WHERE id = ".$contopen;
$res = Database::query($sql);
$row = Database::fetch_array($res);
$lp_charset = $row['default_encoding'];
}
//header('Content-Type: text/html; charset='. $row['default_encoding']);
}
/*
$interbreadcrumb[]= array ("url"=>"../group/group.php", "name"=> get_lang('BredCrumpGroups'));
$interbreadcrumb[]= array ("url"=>"../group/group_space.php?gidReq=$_gid", "name"=> get_lang('BredCrumpGroupSpace'));
@ -363,7 +349,6 @@ if( ( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse ) && $_configura
while ($ar3['status'] != '') {
require_once '../newscorm/learnpathItem.class.php';
$time = learnpathItem::get_scorm_time('php',$ar3['total_time']);
$title = api_htmlentities($ar3['title'],ENT_QUOTES,$lp_charset);
echo "<tr><td>&nbsp;&nbsp;&nbsp;</td><td>";
echo "$title</td><td align=right>{$ar3['status']}</td><td align=right>{$ar3['score']}</td><td align=right>$time</td>";
echo "</tr>";

@ -41,19 +41,6 @@ require_once api_get_path(SYS_CODE_PATH).'exercice/hotpotatoes.lib.php';
/* Header */
// Charset determination
if ($_GET['scormcontopen'])
{
$tbl_lp = Database::get_course_table(TABLE_LP_MAIN);
$contopen = (int) $_GET['scormcontopen'];
$sql = "SELECT default_encoding FROM $tbl_lp WHERE id = ".$contopen;
$res = Database::query($sql);
$row = Database::fetch_array($res);
$lp_charset = $row['default_encoding'];
//header('Content-Type: text/html; charset='. $row['default_encoding']);
}
/*
$interbreadcrumb[]= array ("url"=>"../group/group.php", "name"=> get_lang('BredCrumpGroups'));
$interbreadcrumb[]= array ("url"=>"../group/group_space.php?gidReq=$_gid", "name"=> get_lang('BredCrumpGroupSpace'));
@ -316,7 +303,6 @@ if( ( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse ) && $_configura
while ($ar3['status'] != '') {
require_once('../newscorm/learnpathItem.class.php');
$time = learnpathItem::get_scorm_time('php',$ar3['total_time']);
$title = api_htmlentities($ar3['title'],ENT_QUOTES,$lp_charset);
$line .= $title.';'.$ar3['status'].';'.$ar3['score'].';'.$time."\n";
$ar3=Database::fetch_array($result3);
}

Loading…
Cancel
Save