Feature #272 - Various encoding-related corrections.

skala
Ivan Tcholakov 16 years ago
parent e402ddf9cf
commit f3011085a0
  1. 3
      main/announcements/announcements.php
  2. 2
      main/exercice/exercice.php
  3. 103
      main/exercice/exercice_submit.php
  4. 3
      main/exercice/exercise_result.php
  5. 13
      main/inc/lib/main_api.lib.php
  6. 39
      main/newscorm/learnpath.class.php
  7. 9
      main/newscorm/learnpath_functions.inc.php
  8. 58
      main/newscorm/lp_list.php
  9. 3
      main/newscorm/lp_log.php
  10. 3
      main/newscorm/lp_message.php
  11. 53
      main/newscorm/lp_view.php

@ -719,9 +719,6 @@ if (api_is_allowed_to_edit(false,true) OR (api_get_course_setting('allow_user_ed
$mail_body .= "<br /> \n<a href=\"".api_get_path(WEB_COURSE_PATH).$_course['id']."\">"; $mail_body .= "<br /> \n<a href=\"".api_get_path(WEB_COURSE_PATH).$_course['id']."\">";
$mail_body .= $_course['official_code'].' '.$_course['name'] . "</a>"; $mail_body .= $_course['official_code'].' '.$_course['name'] . "</a>";
//set the charset and use it for the encoding of the email - small fix, not really clean (should check the content encoding origin first)
//here we use the encoding used for the webpage where the text is encoded (ISO-8859-1 in this case)
$recipient_name = api_get_person_name($myrow["firstname"], $myrow["lastname"], null, PERSON_NAME_EMAIL_ADDRESS); $recipient_name = api_get_person_name($myrow["firstname"], $myrow["lastname"], null, PERSON_NAME_EMAIL_ADDRESS);
$mailid = $myrow["email"]; $mailid = $myrow["email"];

@ -333,7 +333,7 @@ if ($show == 'result' && $_REQUEST['comments'] == 'update' && ($is_allowedToEdit
$headers .= "User-Agent: Dokeos/1.6"; $headers .= "User-Agent: Dokeos/1.6";
$headers .= "Content-Transfer-Encoding: 7bit"; $headers .= "Content-Transfer-Encoding: 7bit";
$headers .= 'From: ' . $from_name . ' <' . $from . '>' . "\r\n"; $headers .= 'From: ' . $from_name . ' <' . $from . '>' . "\r\n";
$headers = "From:$from_name\r\nReply-to: $to\r\nContent-type: text/html; charset=" . ($charset ? $charset : 'ISO-8859-15'); $headers = "From:$from_name\r\nReply-to: $to";
//mail($emailid, $subject, $mess,$headers); //mail($emailid, $subject, $mess,$headers);
@api_mail_html($emailid, $emailid, $subject, $mess, $from_name, $from); @api_mail_html($emailid, $emailid, $subject, $mess, $from_name, $from);

@ -40,7 +40,7 @@ $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jqu
if (api_get_setting('show_glossary_in_extra_tools') == 'true') { if (api_get_setting('show_glossary_in_extra_tools') == 'true') {
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/glossary.js" type="text/javascript" language="javascript"></script>'; //Glossary $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/glossary.js" type="text/javascript" language="javascript"></script>'; //Glossary
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js" type="text/javascript" language="javascript"></script>'; $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js" type="text/javascript" language="javascript"></script>';
} }
//This library is necessary for the time control feature //This library is necessary for the time control feature
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.epiclock.min.js" type="text/javascript" language="javascript"></script>'; //jQuery $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.epiclock.min.js" type="text/javascript" language="javascript"></script>'; //jQuery
@ -50,7 +50,7 @@ if (!ereg("MSIE",$_SERVER["HTTP_USER_AGENT"])) {
$(document).ready( function(){ $(document).ready( function(){
$('.rounded').corners(); $('.rounded').corners();
$('.exercise_options').corners(); $('.exercise_options').corners();
});</script>"; });</script>";
} }
/* ------------ ACCESS RIGHTS ------------ */ /* ------------ ACCESS RIGHTS ------------ */
// notice for unauthorized people. // notice for unauthorized people.
@ -93,7 +93,7 @@ if (empty ($exerciseType)) {
$exerciseType = $_REQUEST['exerciseType']; $exerciseType = $_REQUEST['exerciseType'];
} }
if (empty ($exerciseId)) { if (empty ($exerciseId)) {
$exerciseId = Database::escape_string(intval($_REQUEST['exerciseId'])); $exerciseId = Database::escape_string(intval($_REQUEST['exerciseId']));
} }
if (empty ($choice)) { if (empty ($choice)) {
$choice = $_REQUEST['choice']; $choice = $_REQUEST['choice'];
@ -189,7 +189,7 @@ $exerciseFeedbackType = $exercise_row['feedback_type'];
* if the expired time is major that zero(0) then * if the expired time is major that zero(0) then
* the expired time is compute on this time * the expired time is compute on this time
*/ */
//Get the expired time of the current exercice in track_e_exercices //Get the expired time of the current exercice in track_e_exercices
$total_minutes = $exercise_row["expired_time"]; $total_minutes = $exercise_row["expired_time"];
@ -207,30 +207,30 @@ if ($exercise_row['expired_time'] != 0 && $origin != 'learnpath') {
'exe_cours_id = '."'".api_get_course_id()."'".' AND ' . 'exe_cours_id = '."'".api_get_course_id()."'".' AND ' .
'status = '."'incomplete'".' AND '. 'status = '."'incomplete'".' AND '.
'session_id = '."'".api_get_session_id()."'"; 'session_id = '."'".api_get_session_id()."'";
$sql_track = 'SELECT exe_id,expired_time_control FROM '.$stat_table.$condition; $sql_track = 'SELECT exe_id,expired_time_control FROM '.$stat_table.$condition;
$rs_sql = Database::query($sql_track,__FILE__,__LINE__); $rs_sql = Database::query($sql_track,__FILE__,__LINE__);
$exists_into_database = Database::num_rows($rs_sql); $exists_into_database = Database::num_rows($rs_sql);
$track_exercice_row = Database::fetch_array($rs_sql); $track_exercice_row = Database::fetch_array($rs_sql);
$expired_time_of_this_attempt = $track_exercice_row['expired_time_control']; $expired_time_of_this_attempt = $track_exercice_row['expired_time_control'];
//Get the last attempt of an exercice //Get the last attempt of an exercice
$sql_track_attempt = 'SELECT max(tms) as last_attempt_date FROM '.$exercice_attemp_table.' WHERE exe_id="'.$track_exercice_row['exe_id'].'"'; $sql_track_attempt = 'SELECT max(tms) as last_attempt_date FROM '.$exercice_attemp_table.' WHERE exe_id="'.$track_exercice_row['exe_id'].'"';
$rs_last_attempt = Database::query($sql_track_attempt,__FILE__,__LINE__); $rs_last_attempt = Database::query($sql_track_attempt,__FILE__,__LINE__);
$row_last_attempt = Database::fetch_array($rs_last_attempt); $row_last_attempt = Database::fetch_array($rs_last_attempt);
$my_last_attempt_date = $row_last_attempt['last_attempt_date'];//Get the date of last attempt $my_last_attempt_date = $row_last_attempt['last_attempt_date'];//Get the date of last attempt
$date_of_last_attempt = $my_last_attempt_date;// Necessary for to change the last attempt $date_of_last_attempt = $my_last_attempt_date;// Necessary for to change the last attempt
//change the date format //change the date format
$my_last_attempt_date = strtotime($my_last_attempt_date); $my_last_attempt_date = strtotime($my_last_attempt_date);
$expired_time_of_this_attempt = strtotime($expired_time_of_this_attempt); $expired_time_of_this_attempt = strtotime($expired_time_of_this_attempt);
//New expired time - it is due to the possible closure of session //New expired time - it is due to the possible closure of session
$new_expired_time_in_seconds = $expired_time_of_this_attempt - $my_last_attempt_date; $new_expired_time_in_seconds = $expired_time_of_this_attempt - $my_last_attempt_date;
if ($exists_into_database == 1) { if ($exists_into_database == 1) {
$expected_time = $current_timestamp + $new_expired_time_in_seconds; $expected_time = $current_timestamp + $new_expired_time_in_seconds;
$plugin_expired_time = date('M d, Y H:i:s', $expected_time); $plugin_expired_time = date('M d, Y H:i:s', $expected_time);
$clock_expired_time = date('Y-m-d H:i:s' , $expected_time); $clock_expired_time = date('Y-m-d H:i:s' , $expected_time);
$new_last_attempt = date('Y-m-d H:i:s' , $current_timestamp); $new_last_attempt = date('Y-m-d H:i:s' , $current_timestamp);
@ -243,20 +243,20 @@ if ($exercise_row['expired_time'] != 0 && $origin != 'learnpath') {
$sql_track_e_exe = "UPDATE $exercice_attemp_table SET tms = '".$new_last_attempt."' WHERE exe_id = '".$track_exercice_row['exe_id']."' and tms = '".$date_of_last_attempt."' "; $sql_track_e_exe = "UPDATE $exercice_attemp_table SET tms = '".$new_last_attempt."' WHERE exe_id = '".$track_exercice_row['exe_id']."' and tms = '".$date_of_last_attempt."' ";
Database::query($sql_track_e_exe,__FILE__,__LINE__); Database::query($sql_track_e_exe,__FILE__,__LINE__);
//Sessions that contain the expired time //Sessions that contain the expired time
$_SESSION['expired_time'] = $clock_expired_time; $_SESSION['expired_time'] = $clock_expired_time;
$_SESSION['end_expired_time'] = date('M d, Y H:i:s',$expected_time); $_SESSION['end_expired_time'] = date('M d, Y H:i:s',$expected_time);
} else { } else {
$expected_time = $current_timestamp + $total_seconds; $expected_time = $current_timestamp + $total_seconds;
$plugin_expired_time = date('M d, Y H:i:s',$expected_time); $plugin_expired_time = date('M d, Y H:i:s',$expected_time);
$clock_expired_time = date('Y-m-d H:i:s',$expected_time); $clock_expired_time = date('Y-m-d H:i:s',$expected_time);
//Sessions that contain the expired time //Sessions that contain the expired time
$_SESSION['expired_time'] = $clock_expired_time; $_SESSION['expired_time'] = $clock_expired_time;
$_SESSION['end_expired_time'] = date('M d, Y H:i:s',$expected_time); $_SESSION['end_expired_time'] = date('M d, Y H:i:s',$expected_time);
} }
} else { } else {
$plugin_expired_time = $_SESSION['end_expired_time']; $plugin_expired_time = $_SESSION['end_expired_time'];
} }
@ -268,7 +268,7 @@ if ($exercise_row['expired_time'] != 0 && $origin != 'learnpath') {
*/ */
//Disable for learning path //Disable for learning path
if ($exercise_row['expired_time'] != 0 && $origin != 'learnpath') { //Sends the exercice form when the expired time is finished if ($exercise_row['expired_time'] != 0 && $origin != 'learnpath') { //Sends the exercice form when the expired time is finished
$htmlHeadXtra[] = "<script type=\"text/javascript\"> $htmlHeadXtra[] = "<script type=\"text/javascript\">
$(document).ready(function(){ $(document).ready(function(){
function onExpiredTimeExercise() { function onExpiredTimeExercise() {
@ -282,10 +282,10 @@ if ($exercise_row['expired_time'] != 0 && $origin != 'learnpath') { //Sends the
format: 'x{ : } i{ : } s{}', format: 'x{ : } i{ : } s{}',
target: '".$plugin_expired_time."', target: '".$plugin_expired_time."',
onTimer: function(){ onExpiredTimeExercise() } onTimer: function(){ onExpiredTimeExercise() }
}).clocks(EC_RUN); }).clocks(EC_RUN);
$('.rounded').corners('transparent'); $('.rounded').corners('transparent');
$('#submit_save').click(function () { $('#submit_save').click(function () {
}); });
}); });
</script>"; </script>";
} }
@ -376,7 +376,7 @@ if ($formSent) {
$counter = 0; $counter = 0;
$main_course_user_table = Database :: get_main_table(TABLE_MAIN_COURSE_USER); $main_course_user_table = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$table_ans = Database :: get_course_table(TABLE_QUIZ_ANSWER); $table_ans = Database :: get_course_table(TABLE_QUIZ_ANSWER);
//foreach($questionList as $questionId) //foreach($questionList as $questionId)
if (true) { if (true) {
$exeId = $exe_id; $exeId = $exe_id;
@ -425,15 +425,15 @@ if ($formSent) {
break; break;
// for multiple answers // for multiple answers
case MULTIPLE_ANSWER : case MULTIPLE_ANSWER :
$studentChoice=$choice[$numAnswer]; $studentChoice=$choice[$numAnswer];
if ($studentChoice) { if ($studentChoice) {
$questionScore+=$answerWeighting; $questionScore+=$answerWeighting;
$totalScore+=$answerWeighting; $totalScore+=$answerWeighting;
} }
break; break;
case MULTIPLE_ANSWER_COMBINATION: case MULTIPLE_ANSWER_COMBINATION:
$studentChoice=$choice[$numAnswer]; $studentChoice=$choice[$numAnswer];
if ($answerCorrect == 1) { if ($answerCorrect == 1) {
if ($studentChoice) { if ($studentChoice) {
$real_answers[$answerId] = true; $real_answers[$answerId] = true;
@ -447,13 +447,13 @@ if ($formSent) {
$real_answers[$answerId] = true; $real_answers[$answerId] = true;
} }
} }
$final_answer = true; $final_answer = true;
foreach($real_answers as $my_answer) { foreach($real_answers as $my_answer) {
if (!$my_answer) { if (!$my_answer) {
$final_answer = false; $final_answer = false;
} }
} }
break; break;
// for fill in the blanks // for fill in the blanks
case FILL_IN_BLANKS : case FILL_IN_BLANKS :
@ -608,8 +608,8 @@ if ($formSent) {
case MATCHING : case MATCHING :
$numAnswer=$objAnswerTmp->selectAutoId($answerId); $numAnswer=$objAnswerTmp->selectAutoId($answerId);
if ($answerCorrect) { if ($answerCorrect) {
if ($answerCorrect == $choice[$numAnswer]) { if ($answerCorrect == $choice[$numAnswer]) {
$questionScore+=$answerWeighting; $questionScore+=$answerWeighting;
$totalScore+=$answerWeighting; $totalScore+=$answerWeighting;
} }
@ -639,17 +639,17 @@ if ($formSent) {
} // end switch Answertype } // end switch Answertype
} // end for that loops over all answers of the current question } // end for that loops over all answers of the current question
// destruction of Answer // destruction of Answer
//we add the total score after dealing with the answers //we add the total score after dealing with the answers
if ($answerType == MULTIPLE_ANSWER_COMBINATION) { if ($answerType == MULTIPLE_ANSWER_COMBINATION) {
if ($final_answer) { if ($final_answer) {
//getting only the first score where we save the weight of all the question //getting only the first score where we save the weight of all the question
$answerWeighting=$objAnswerTmp->selectWeighting(1); $answerWeighting=$objAnswerTmp->selectWeighting(1);
$questionScore+=$answerWeighting; $questionScore+=$answerWeighting;
$totalScore+=$answerWeighting; $totalScore+=$answerWeighting;
} }
} }
unset ($objAnswerTmp); unset ($objAnswerTmp);
$i++; $i++;
@ -696,7 +696,7 @@ if ($formSent) {
} elseif ($answerType == HOT_SPOT) { } elseif ($answerType == HOT_SPOT) {
exercise_attempt($questionScore, $answer, $quesId, $exeId, 0); exercise_attempt($questionScore, $answer, $quesId, $exeId, 0);
if (is_array($exerciseResultCoordinates[$key])) { if (is_array($exerciseResultCoordinates[$key])) {
foreach($exerciseResultCoordinates[$key] as $idx => $val) { foreach($exerciseResultCoordinates[$key] as $idx => $val) {
exercise_attempt_hotspot($exeId,$quesId,$idx,$choice[$idx],$val); exercise_attempt_hotspot($exeId,$quesId,$idx,$choice[$idx],$val);
} }
} }
@ -707,7 +707,7 @@ if ($formSent) {
} }
// end huge foreach() block that loops over all questions // end huge foreach() block that loops over all questions
//at loops over all questions //at loops over all questions
if (isset($exe_id)) { if (isset($exe_id)) {
$sql_update = 'UPDATE ' . $stat_table . ' SET exe_result = exe_result + ' . (int) $totalScore . ',exe_weighting = exe_weighting + ' . (int) $totalWeighting . ' WHERE exe_id = ' . Database::escape_string($exe_id); $sql_update = 'UPDATE ' . $stat_table . ' SET exe_result = exe_result + ' . (int) $totalScore . ',exe_weighting = exe_weighting + ' . (int) $totalWeighting . ' WHERE exe_id = ' . Database::escape_string($exe_id);
Database::query($sql_update, __FILE__, __LINE__); Database::query($sql_update, __FILE__, __LINE__);
} }
@ -726,7 +726,7 @@ if ($formSent) {
// the script "exercise_result.php" will take the variable $exerciseResult from the session // the script "exercise_result.php" will take the variable $exerciseResult from the session
api_session_register('exerciseResult'); api_session_register('exerciseResult');
api_session_register('exerciseResultCoordinates'); api_session_register('exerciseResultCoordinates');
// if all questions on one page OR if it is the last question (only for an exercise with one question per page) // if all questions on one page OR if it is the last question (only for an exercise with one question per page)
if ($exerciseType == ALL_ON_ONE_PAGE || $questionNum >= $nbrQuestions) { if ($exerciseType == ALL_ON_ONE_PAGE || $questionNum >= $nbrQuestions) {
@ -746,17 +746,17 @@ if ($formSent) {
if (isset($_SESSION['expired_time']) && $exercise_row['expired_time'] != 0) { if (isset($_SESSION['expired_time']) && $exercise_row['expired_time'] != 0) {
$expired_date = $_SESSION['expired_time']; $expired_date = $_SESSION['expired_time'];
$expired_time = strtotime($expired_date); $expired_time = strtotime($expired_date);
//Validation in case of fraud //Validation in case of fraud
$total_time_allowed = $expired_time + 30; $total_time_allowed = $expired_time + 30;
if ($total_time_allowed < $current_time) { if ($total_time_allowed < $current_time) {
$sql_exe_result = ",exe_result = 0"; $sql_exe_result = ",exe_result = 0";
} }
} else { } else {
$sql_exe_result = ""; $sql_exe_result = "";
} }
//clean incomplete //clean incomplete
$update_query = 'UPDATE ' . $stat_table . ' SET ' . "status = '', data_tracking='', exe_date = '" . date('Y-m-d H:i:s') . "' $sql_exe_result " . ' WHERE exe_id = ' . Database::escape_string($exe_id); $update_query = 'UPDATE ' . $stat_table . ' SET ' . "status = '', data_tracking='', exe_date = '" . date('Y-m-d H:i:s') . "' $sql_exe_result " . ' WHERE exe_id = ' . Database::escape_string($exe_id);
@ -1016,9 +1016,6 @@ if ($origin != 'learnpath') { //so we are not in learnpath tool
Display :: display_warning_message(get_lang('SessionIsReadOnly')); Display :: display_warning_message(get_lang('SessionIsReadOnly'));
} }
} else { } else {
if (empty ($charset)) {
$charset = 'ISO-8859-15';
}
/* /*
* HTML HEADER * HTML HEADER
*/ */
@ -1027,14 +1024,14 @@ if ($origin != 'learnpath') { //so we are not in learnpath tool
} }
// I'm in a preview mode // I'm in a preview mode
if (api_is_course_admin() && $origin != 'learnpath') { if (api_is_course_admin() && $origin != 'learnpath') {
echo '<div class="actions">'; echo '<div class="actions">';
echo Display :: return_icon('quiz.gif', get_lang('GoBackToEx')) . '<a href="admin.php?' . api_get_cidreq() . '&exerciseId=' . $objExercise->id . '">' . get_lang('GoBackToEx') . '</a>'; echo Display :: return_icon('quiz.gif', get_lang('GoBackToEx')) . '<a href="admin.php?' . api_get_cidreq() . '&exerciseId=' . $objExercise->id . '">' . get_lang('GoBackToEx') . '</a>';
echo Display :: return_icon('edit.gif', get_lang('ModifyExercise')) . '<a href="exercise_admin.php?' . api_get_cidreq() . '&modifyExercise=yes&exerciseId=' . $objExercise->id . '">' . get_lang('ModifyExercise') . '</a>'; echo Display :: return_icon('edit.gif', get_lang('ModifyExercise')) . '<a href="exercise_admin.php?' . api_get_cidreq() . '&modifyExercise=yes&exerciseId=' . $objExercise->id . '">' . get_lang('ModifyExercise') . '</a>';
echo '</div>'; echo '</div>';
} }
//Timer control //Timer control
if ($exercise_row['expired_time'] != 0 && $origin != 'learnpath') { if ($exercise_row['expired_time'] != 0 && $origin != 'learnpath') {
echo '<div align="left" id="wrapper-clock"><div id="square" class="rounded"><div id="text-content" align="center" class="count_down"></div></div></div>'; echo '<div align="left" id="wrapper-clock"><div id="square" class="rounded"><div id="text-content" align="center" class="count_down"></div></div></div>';
echo '<div style="display:none" class="warning-message" id="expired-message-id">'.get_lang('ExerciceExpiredTimeMessage').'</div>'; echo '<div style="display:none" class="warning-message" id="expired-message-id">'.get_lang('ExerciceExpiredTimeMessage').'</div>';
} }
@ -1099,7 +1096,7 @@ if ($limit_time_exists) {
if ($origin != 'learnpath') { if ($origin != 'learnpath') {
echo '<div id="highlight-plugin" class="glossary-content">'; echo '<div id="highlight-plugin" class="glossary-content">';
} }
if (!empty ($error)) { if (!empty ($error)) {
Display :: display_error_message($error, false); Display :: display_error_message($error, false);
} else { } else {
@ -1146,7 +1143,7 @@ if (!empty ($error)) {
{ {
$s2 = "&exerciseId=" . $exerciseId; $s2 = "&exerciseId=" . $exerciseId;
} }
$s .= " <form method='post' action='" . api_get_self() . "?".api_get_cidreq()."&autocomplete=off&gradebook=$gradebook" . $s2 . "' id='my_frm_exercise' name='frm_exercise' $onsubmit> $s .= " <form method='post' action='" . api_get_self() . "?".api_get_cidreq()."&autocomplete=off&gradebook=$gradebook" . $s2 . "' id='my_frm_exercise' name='frm_exercise' $onsubmit>
<input type='hidden' name='formSent' value='1' /> <input type='hidden' name='formSent' value='1' />
<input type='hidden' name='exerciseType' value='" . $exerciseType . "' /> <input type='hidden' name='exerciseType' value='" . $exerciseType . "' />
@ -1160,7 +1157,7 @@ if (!empty ($error)) {
<tr> <tr>
<td> <td>
<table width='100%' cellpadding='3' cellspacing='0' border='0'>"; <table width='100%' cellpadding='3' cellspacing='0' border='0'>";
echo $s; echo $s;
$i = 1; $i = 1;
foreach ($questionList as $questionId) { foreach ($questionList as $questionId) {
@ -1239,21 +1236,21 @@ if (!empty ($error)) {
if ($_configuration['live_exercise_tracking'] == true && $exerciseFeedbackType != EXERCISE_FEEDBACK_TYPE_DIRECT) { if ($_configuration['live_exercise_tracking'] == true && $exerciseFeedbackType != EXERCISE_FEEDBACK_TYPE_DIRECT) {
if ($table_recorded_not_exist) { //$table_recorded_not_exist if ($table_recorded_not_exist) { //$table_recorded_not_exist
if ($exercise_row['expired_time'] != 0) { if ($exercise_row['expired_time'] != 0) {
$sql_fields = "expired_time_control, "; $sql_fields = "expired_time_control, ";
$sql_fields_values = "'"."$clock_expired_time"."',"; $sql_fields_values = "'"."$clock_expired_time"."',";
} else { } else {
$sql_fields = ""; $sql_fields = "";
$sql_fields_values = ""; $sql_fields_values = "";
} }
if ($exerciseType == ONE_PER_PAGE) { if ($exerciseType == ONE_PER_PAGE) {
$sql = "INSERT INTO $stat_table($sql_fields exe_exo_id,exe_user_id,exe_cours_id,status,session_id,data_tracking,start_date,orig_lp_id,orig_lp_item_id) $sql = "INSERT INTO $stat_table($sql_fields exe_exo_id,exe_user_id,exe_cours_id,status,session_id,data_tracking,start_date,orig_lp_id,orig_lp_item_id)
VALUES($sql_fields_values '$exerciseId','" . api_get_user_id() . "','" . $_course['id'] . "','incomplete','" . api_get_session_id() . "','" . implode(',', $questionList) . "','" . date('Y-m-d H:i:s') . "',$safe_lp_id,$safe_lp_item_id)"; VALUES($sql_fields_values '$exerciseId','" . api_get_user_id() . "','" . $_course['id'] . "','incomplete','" . api_get_session_id() . "','" . implode(',', $questionList) . "','" . date('Y-m-d H:i:s') . "',$safe_lp_id,$safe_lp_item_id)";
Database::query($sql, __FILE__, __LINE__); Database::query($sql, __FILE__, __LINE__);
} else { } else {
echo $sql = "INSERT INTO $stat_table ($sql_fields exe_exo_id,exe_user_id,exe_cours_id,status,session_id,start_date,orig_lp_id,orig_lp_item_id) echo $sql = "INSERT INTO $stat_table ($sql_fields exe_exo_id,exe_user_id,exe_cours_id,status,session_id,start_date,orig_lp_id,orig_lp_item_id)
VALUES($sql_fields_values '$exerciseId','" . api_get_user_id() . "','" . $_course['id'] . "','incomplete','" . api_get_session_id() . "','" . date('Y-m-d H:i:s') . "',$safe_lp_id,$safe_lp_item_id)"; VALUES($sql_fields_values '$exerciseId','" . api_get_user_id() . "','" . $_course['id'] . "','incomplete','" . api_get_session_id() . "','" . date('Y-m-d H:i:s') . "',$safe_lp_id,$safe_lp_item_id)";

@ -271,9 +271,6 @@ if ($origin != 'learnpath') {
Display::display_header($nameTools,"Exercise"); Display::display_header($nameTools,"Exercise");
} else { } else {
if (empty($charset)) {
$charset = 'ISO-8859-15';
}
header('Content-Type: text/html; charset='. $charset); header('Content-Type: text/html; charset='. $charset);
@$document_language = api_get_language_isocode($language_interface); @$document_language = api_get_language_isocode($language_interface);

@ -3677,18 +3677,7 @@ function replace_dangerous_char($filename, $strict = 'loose') {
$system_encoding = api_get_file_system_encoding(); $system_encoding = api_get_file_system_encoding();
// Transliteration to ASCII filename string.
//comment because (see support.dokeos.com/issues/5596)
// Compatibility: we keep the previous behaviour (Dokeos 1.8.6) for Latin 1 platforms (ISO-8859-15, ISO-8859-1, WINDOWS-1252, ...).
//if (api_is_latin1($system_encoding)) {
// $filename = ereg_replace("\.+$", "", substr(strtr(ereg_replace(
// "[^!-~\x80-\xFF]", "_", trim($filename)), '\/:*?"<>|\'',
// /* Keep C1 controls for UTF-8 streams */ '-----_---_'), 0, 250));
// if ($strict != 'strict') return $filename;
// return ereg_replace("[^!-~]", 'x', $filename);
// }
// For other platform encodings and various languages we use transliteration to ASCII filename string.
if (!api_is_valid_utf8($filename)) { if (!api_is_valid_utf8($filename)) {
// Here we need to convert the file name to UTF-8 string first. We will try to guess the input encoding. // Here we need to convert the file name to UTF-8 string first. We will try to guess the input encoding.
$input_encoding = api_get_file_system_encoding(); $input_encoding = api_get_file_system_encoding();

@ -12,12 +12,12 @@
* Defines the learnpath parent class * Defines the learnpath parent class
* @package dokeos.learnpath * @package dokeos.learnpath
*/ */
// including the global file // including the global file
require_once '../inc/global.inc.php'; require_once '../inc/global.inc.php';
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
if (api_get_setting('show_glossary_in_documents') == 'ismanual' || api_get_setting('show_glossary_in_documents') == 'isautomatic' ) { if (api_get_setting('show_glossary_in_documents') == 'ismanual' || api_get_setting('show_glossary_in_documents') == 'isautomatic' ) {
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.frameready.js" type="text/javascript" language="javascript"></script>'; $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.frameready.js" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js" type="text/javascript" language="javascript"></script>'; $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js" type="text/javascript" language="javascript"></script>';
} }
@ -27,7 +27,7 @@ function setFocus(){
$("#idTitle").focus(); $("#idTitle").focus();
} }
$(window).load(function () { $(window).load(function () {
setFocus(); setFocus();
}); });
</script>'; </script>';
@ -902,7 +902,7 @@ class learnpath {
$sql = 'SELECT gl.id FROM ' . $tbl_grade_link . ' gl WHERE gl.type="4" AND gl.ref_id="' . $id . '";'; $sql = 'SELECT gl.id FROM ' . $tbl_grade_link . ' gl WHERE gl.type="4" AND gl.ref_id="' . $id . '";';
$result = Database::query($sql, __FILE__, __LINE__); $result = Database::query($sql, __FILE__, __LINE__);
$row = Database :: fetch_array($result, 'ASSOC'); $row = Database :: fetch_array($result, 'ASSOC');
//fixing gradebook link deleted see #5229 //fixing gradebook link deleted see #5229
if (!empty($row['id'])) { if (!empty($row['id'])) {
$link = LinkFactory :: load($row['id']); $link = LinkFactory :: load($row['id']);
@ -910,7 +910,7 @@ class learnpath {
$link[0]->delete(); $link[0]->delete();
} }
} }
//TODO: also delete items and item-views //TODO: also delete items and item-views
if (api_get_setting('search_enabled') == 'true') { if (api_get_setting('search_enabled') == 'true') {
require_once (api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php'); require_once (api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php');
@ -1102,7 +1102,7 @@ class learnpath {
if ($old_next != 0) { if ($old_next != 0) {
$sql_update_previous = " $sql_update_previous = "
UPDATE " . $tbl_lp_item . " UPDATE " . $tbl_lp_item . "
SET previous_item_id = " . $old_previous . " SET previous_item_id = " . $old_previous . "
WHERE id = " . $old_next; WHERE id = " . $old_next;
$res_update_previous = Database::query($sql_update_previous, __FILE__, __LINE__); $res_update_previous = Database::query($sql_update_previous, __FILE__, __LINE__);
@ -2194,9 +2194,8 @@ class learnpath {
$progress_height = '16'; $progress_height = '16';
$size = str_replace('%', '', $percentage); $size = str_replace('%', '', $percentage);
$output = '' $output =
//.htmlentities(get_lang('ScormCompstatus'),ENT_QUOTES,'ISO-8859-1')."<br />" '<table border="0" cellpadding="0" cellspacing="0"><tr><td>' .
. '<table border="0" cellpadding="0" cellspacing="0"><tr><td>' .
'<img id="progress_img_limit_left" src="' . $css_path . 'bar_1.gif" width="1" height="' . $progress_height . '">' . '<img id="progress_img_limit_left" src="' . $css_path . 'bar_1.gif" width="1" height="' . $progress_height . '">' .
'<img id="progress_img_full" src="' . $css_path . 'bar_1u.gif" width="' . $size * $factor . 'px" height="' . $progress_height . '" id="full_portion">' . '<img id="progress_img_full" src="' . $css_path . 'bar_1u.gif" width="' . $size * $factor . 'px" height="' . $progress_height . '" id="full_portion">' .
'<img id="progress_img_limit_middle" src="' . $css_path . 'bar_1m.gif" width="1" height="' . $progress_height . '">'; '<img id="progress_img_limit_middle" src="' . $css_path . 'bar_1m.gif" width="1" height="' . $progress_height . '">';
@ -5463,7 +5462,7 @@ class learnpath {
} else { } else {
$return .= '<td>&nbsp;</td><td><button class="save" name="submit_button" type="submit">' . get_lang('EditCurrentExecice') . '</button></td>'; $return .= '<td>&nbsp;</td><td><button class="save" name="submit_button" type="submit">' . get_lang('EditCurrentExecice') . '</button></td>';
} }
$return .= "\t\t" . '</tr>' . "\n"; $return .= "\t\t" . '</tr>' . "\n";
$return .= "\t" . '</table>' . "\n"; $return .= "\t" . '</table>' . "\n";
@ -5947,7 +5946,7 @@ class learnpath {
} }
$return .= "\t\t" . '<tr>' . "\n"; $return .= "\t\t" . '<tr>' . "\n";
if ($action == 'add') { if ($action == 'add') {
$return .= '<td>&nbsp;</td><td><button class="save" name="submit_button" type="submit"> ' . get_lang('AddForumToCourse') . ' </button></td>'; $return .= '<td>&nbsp;</td><td><button class="save" name="submit_button" type="submit"> ' . get_lang('AddForumToCourse') . ' </button></td>';
} else { } else {
@ -7715,7 +7714,7 @@ class learnpath {
$path = Database::escape_string(str_replace('_', '\_', $path)); $path = Database::escape_string(str_replace('_', '\_', $path));
$added_slash = ($path == '/') ? '' : '/'; $added_slash = ($path == '/') ? '' : '/';
//condition for the session //condition for the session
$current_session_id = api_get_session_id(); $current_session_id = api_get_session_id();
$condition_session = " AND (id_session = '$current_session_id' OR (id_session = '0' AND insert_date <= (SELECT creation_date FROM $tbl_course WHERE code = '{$_course[id]}')))"; $condition_session = " AND (id_session = '$current_session_id' OR (id_session = '0' AND insert_date <= (SELECT creation_date FROM $tbl_course WHERE code = '{$_course[id]}')))";
@ -7723,10 +7722,10 @@ class learnpath {
FROM $tbl_item_prop AS last, $tbl_doc AS docs FROM $tbl_item_prop AS last, $tbl_doc AS docs
WHERE docs.id = last.ref WHERE docs.id = last.ref
AND docs.path LIKE '".$path.$added_slash."%' AND docs.path LIKE '".$path.$added_slash."%'
AND docs.path NOT LIKE '%_DELETED_%' AND docs.path NOT LIKE '%_DELETED_%'
AND last.tool = '".TOOL_DOCUMENT."' $condition_session ORDER BY docs.path ASC"; AND last.tool = '".TOOL_DOCUMENT."' $condition_session ORDER BY docs.path ASC";
//$sql_doc = "SELECT * FROM $tbl_doc WHERE path NOT LIKE '%_DELETED_%' ORDER BY path ASC"; //$sql_doc = "SELECT * FROM $tbl_doc WHERE path NOT LIKE '%_DELETED_%' ORDER BY path ASC";
$res_doc = Database::query($sql_doc, __FILE__, __LINE__); $res_doc = Database::query($sql_doc, __FILE__, __LINE__);
$return = '<div class="lp_resource_header"' . " onclick=\"if(document.getElementById('resDoc').style.display == 'block') {document.getElementById('resDoc').style.display = 'none';} else {document.getElementById('resDoc').style.display = 'block';}\"" . '>'.Display::return_icon('folder_document.gif',get_lang('Documents'),array('style'=>'margin-right:5px;', 'height' => '16px')).' '. get_lang('Documents') . '</div>'; $return = '<div class="lp_resource_header"' . " onclick=\"if(document.getElementById('resDoc').style.display == 'block') {document.getElementById('resDoc').style.display = 'none';} else {document.getElementById('resDoc').style.display = 'block';}\"" . '>'.Display::return_icon('folder_document.gif',get_lang('Documents'),array('style'=>'margin-right:5px;', 'height' => '16px')).' '. get_lang('Documents') . '</div>';
@ -7761,9 +7760,9 @@ class learnpath {
$return .= $this->write_resources_tree($resources_sorted); $return .= $this->write_resources_tree($resources_sorted);
if (Database :: num_rows($res_doc) == 0) if (Database :: num_rows($res_doc) == 0)
$return .= '<div class="lp_resource_element">' . get_lang("NoDocuments") . '</div>'; $return .= '<div class="lp_resource_element">' . get_lang("NoDocuments") . '</div>';
$return .= '</div>'; $return .= '</div>';
return $return; return $return;
} }
@ -7872,7 +7871,7 @@ class learnpath {
$session_id = api_get_session_id(); $session_id = api_get_session_id();
$condition_session = api_get_session_condition($session_id,false); $condition_session = api_get_session_condition($session_id,false);
$sql_link = "SELECT * FROM $tbl_link $condition_session ORDER BY title ASC"; $sql_link = "SELECT * FROM $tbl_link $condition_session ORDER BY title ASC";
$res_link = Database::query($sql_link, __FILE__, __LINE__); $res_link = Database::query($sql_link, __FILE__, __LINE__);
@ -7910,7 +7909,7 @@ class learnpath {
$session_id = api_get_session_id(); $session_id = api_get_session_id();
$condition_session = api_get_session_condition($session_id,false); $condition_session = api_get_session_condition($session_id,false);
$sql_student = "SELECT * FROM $tbl_student $condition_session ORDER BY title ASC"; $sql_student = "SELECT * FROM $tbl_student $condition_session ORDER BY title ASC";
$res_student = Database::query($sql_student, __FILE__, __LINE__); $res_student = Database::query($sql_student, __FILE__, __LINE__);
@ -7965,7 +7964,7 @@ class learnpath {
$return .= '<a style="cursor:hand" onclick="toggle_forum(' . $forum['forum_id'] . ')" style="vertical-align:middle"><img src="' . api_get_path(WEB_IMG_PATH) . 'add.gif" id="forum_' . $forum['forum_id'] . '_opener" align="absbottom" /></a> $return .= '<a style="cursor:hand" onclick="toggle_forum(' . $forum['forum_id'] . ')" style="vertical-align:middle"><img src="' . api_get_path(WEB_IMG_PATH) . 'add.gif" id="forum_' . $forum['forum_id'] . '_opener" align="absbottom" /></a>
<a href="' . api_get_self() . '?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&amp;action=add_item&amp;type=' . TOOL_FORUM . '&amp;forum_id=' . $forum['forum_id'] . '&amp;lp_id=' . $this->lp_id . '" style="vertical-align:middle">' . $forum['forum_title'] . '</a><ul style="display:none" id="forum_' . $forum['forum_id'] . '_content">'; <a href="' . api_get_self() . '?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&amp;action=add_item&amp;type=' . TOOL_FORUM . '&amp;forum_id=' . $forum['forum_id'] . '&amp;lp_id=' . $this->lp_id . '" style="vertical-align:middle">' . $forum['forum_title'] . '</a><ul style="display:none" id="forum_' . $forum['forum_id'] . '_content">';
} }
$a_threads = get_threads($forum['forum_id']); $a_threads = get_threads($forum['forum_id']);
if (is_array($a_threads)) { if (is_array($a_threads)) {
foreach ($a_threads as $thread) { foreach ($a_threads as $thread) {

@ -1957,7 +1957,10 @@ function exportitem($id, $item_id, $item_type, $add_scorm_communications = false
case "Introduction_text" : case "Introduction_text" :
//1 Get the introduction text data from the database //1 Get the introduction text data from the database
$TBL_INTRO = Database :: get_course_tool_intro_table(); $TBL_INTRO = Database :: get_course_tool_intro_table();
$result = Database::query("SELECT * FROM ".$TBL_INTRO." WHERE id=1"); // Modified by Ivan Tcholakov, 15-SEP-2008.
//$result = Database::query("SELECT * FROM ".$TBL_INTRO." WHERE id=1");
$result = Database::query("SELECT * FROM ".$TBL_INTRO." WHERE id='course_homepage'", __FILE__, __LINE__);
//
$myrow = Database::fetch_array($result); $myrow = Database::fetch_array($result);
$intro = $myrow["intro_text"]; $intro = $myrow["intro_text"];
//2 Write introduction text to the export string //2 Write introduction text to the export string
@ -2409,7 +2412,6 @@ function xmltagwrite($tagname, $which, $data, $linebreak = "yes")
*/ */
function createimsmanifest($circle1_files, $learnpath_id) function createimsmanifest($circle1_files, $learnpath_id)
{ {
global $charset;
global $_course, $LPname, $expdir, $LPnamesafe; global $_course, $LPname, $expdir, $LPnamesafe;
//$tbl_learnpath_main, $tbl_learnpath_chapter, $tbl_learnpath_item, //$tbl_learnpath_main, $tbl_learnpath_chapter, $tbl_learnpath_item,
$tbl_learnpath_main = Database :: get_course_table(TABLE_LEARNPATH_MAIN); $tbl_learnpath_main = Database :: get_course_table(TABLE_LEARNPATH_MAIN);
@ -2425,8 +2427,7 @@ function createimsmanifest($circle1_files, $learnpath_id)
//1.2 //1.2
//charset should be dependent on content //charset should be dependent on content
//$mycharset = 'ISO-8859-1'; $mycharset = api_get_system_encoding();
$mycharset = $charset;
$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="'.$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";
$org .= xmltagwrite('metadata', 'open'); $org .= xmltagwrite('metadata', 'open');

@ -27,8 +27,6 @@ $display_progress_bar = true;
require_once('learnpathList.class.php'); require_once('learnpathList.class.php');
require_once('learnpath.class.php'); require_once('learnpath.class.php');
require_once('learnpathItem.class.php'); require_once('learnpathItem.class.php');
//$charset = 'UTF-8';
//$charset = 'ISO-8859-1';
/** /**
* Display initialisation and security checks * Display initialisation and security checks
@ -167,7 +165,7 @@ if ($is_allowed_to_edit)
//xport now is inside "Edit" //xport now is inside "Edit"
//'<th>'.get_lang('ExportShort')."</th>\n" . //'<th>'.get_lang('ExportShort')."</th>\n" .
'<th>'.get_lang('AuthoringOptions')."</th>\n"; '<th>'.get_lang('AuthoringOptions')."</th>\n";
// only available for not session mode // only available for not session mode
if ($current_session == 0) { if ($current_session == 0) {
echo'<th>'.get_lang('Move')."</th>\n"; echo'<th>'.get_lang('Move')."</th>\n";
@ -192,7 +190,7 @@ if (is_array($flat_list))
{ {
//validacion when belongs to a session //validacion when belongs to a session
$session_img = api_get_session_image($details['lp_session'], $_user['status']); $session_img = api_get_session_image($details['lp_session'], $_user['status']);
if(!$is_allowed_to_edit && $details['lp_visibility'] == 0) if(!$is_allowed_to_edit && $details['lp_visibility'] == 0)
{ {
// This is a student and this path is invisible, skip // This is a student and this path is invisible, skip
@ -252,7 +250,7 @@ if (is_array($flat_list))
if ($current_session == $details['lp_session']) { if ($current_session == $details['lp_session']) {
$dsp_desc = '<td valign="middle" style="color: grey; padding-top:1em;"><em>'.$details['lp_maker'].'</em> &nbsp;&nbsp; '.$details['lp_proximity'].' &nbsp;&nbsp; '.$details['lp_encoding'].'<a href="lp_controller.php?'.api_get_cidreq().'&action=edit&lp_id='.$id.'">&nbsp;&nbsp;<img src="../img/edit.gif" border="0" title="'.get_lang('_edit_learnpath').'"></a></td>'."\n"; $dsp_desc = '<td valign="middle" style="color: grey; padding-top:1em;"><em>'.$details['lp_maker'].'</em> &nbsp;&nbsp; '.$details['lp_proximity'].' &nbsp;&nbsp; '.$details['lp_encoding'].'<a href="lp_controller.php?'.api_get_cidreq().'&action=edit&lp_id='.$id.'">&nbsp;&nbsp;<img src="../img/edit.gif" border="0" title="'.get_lang('_edit_learnpath').'"></a></td>'."\n";
} else { } else {
$dsp_desc = '<td valign="middle" style="color: grey; padding-top:1em;"><em>'.$details['lp_maker'].'</em> &nbsp;&nbsp; '.$details['lp_proximity'].' &nbsp;&nbsp; '.$details['lp_encoding'].'<img src="../img/edit_na.gif" border="0" title="'.get_lang('_edit_learnpath').'"></td>'."\n"; $dsp_desc = '<td valign="middle" style="color: grey; padding-top:1em;"><em>'.$details['lp_maker'].'</em> &nbsp;&nbsp; '.$details['lp_proximity'].' &nbsp;&nbsp; '.$details['lp_encoding'].'<img src="../img/edit_na.gif" border="0" title="'.get_lang('_edit_learnpath').'"></td>'."\n";
} }
/* export */ /* export */
@ -282,7 +280,7 @@ if (is_array($flat_list))
$dsp_edit = '<td align="center">'; $dsp_edit = '<td align="center">';
$dsp_edit_close = '</td>'; $dsp_edit_close = '</td>';
/* BUILD */ /* BUILD */
if ($current_session == $details['lp_session']) { if ($current_session == $details['lp_session']) {
if($details['lp_type']==1 || $details['lp_type']==2){ if($details['lp_type']==1 || $details['lp_type']==2){
$dsp_build = '<a href="lp_controller.php?'.api_get_cidreq().'&amp;action=build&amp;lp_id='.$id.'"><img src="../img/wizard.gif" border="0" title="'.get_lang("Build").'"></a>&nbsp;'; $dsp_build = '<a href="lp_controller.php?'.api_get_cidreq().'&amp;action=build&amp;lp_id='.$id.'"><img src="../img/wizard.gif" border="0" title="'.get_lang("Build").'"></a>&nbsp;';
@ -291,11 +289,11 @@ if (is_array($flat_list))
} }
} else { } else {
$dsp_build = '<img src="../img/wizard_gray.gif" border="0" title="'.get_lang("Build").'">&nbsp;'; $dsp_build = '<img src="../img/wizard_gray.gif" border="0" title="'.get_lang("Build").'">&nbsp;';
} }
/* VISIBILITY COMMAND */ /* VISIBILITY COMMAND */
if ($current_session == $details['lp_session']) { if ($current_session == $details['lp_session']) {
@ -316,7 +314,7 @@ if (is_array($flat_list))
} else { } else {
$dsp_visible = '<img src="../img/invisible.gif" border="0" title="'.get_lang('Show').'" />'; $dsp_visible = '<img src="../img/invisible.gif" border="0" title="'.get_lang('Show').'" />';
} }
/* PUBLISH COMMAND */ /* PUBLISH COMMAND */
@ -338,9 +336,9 @@ if (is_array($flat_list))
} else { } else {
$dsp_publish = '<img src="../img/invisible_LP_list.gif" border="0" title="'.get_lang('_no_publish').'" />'; $dsp_publish = '<img src="../img/invisible_LP_list.gif" border="0" title="'.get_lang('_no_publish').'" />';
} }
/* MULTIPLE ATTEMPTS */ /* MULTIPLE ATTEMPTS */
if ($current_session == $details['lp_session']) { if ($current_session == $details['lp_session']) {
if($details['lp_prevent_reinit']==1){ if($details['lp_prevent_reinit']==1){
$dsp_reinit = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_reinit&lp_id='.$id.'">' . $dsp_reinit = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_reinit&lp_id='.$id.'">' .
@ -354,14 +352,14 @@ if (is_array($flat_list))
} else { } else {
$dsp_reinit = '<img src="../img/kaboodleloop_gray.gif" border="0" alt="Allow reinit" title="'.get_lang("AllowMultipleAttempts").'"/>'; $dsp_reinit = '<img src="../img/kaboodleloop_gray.gif" border="0" alt="Allow reinit" title="'.get_lang("AllowMultipleAttempts").'"/>';
} }
/* FUll screen VIEW */ /* FUll screen VIEW */
if ($current_session == $details['lp_session']) { if ($current_session == $details['lp_session']) {
/* Default view mode settings (fullscreen/embedded) */ /* Default view mode settings (fullscreen/embedded) */
if($details['lp_view_mode'] == 'fullscreen'){ if($details['lp_view_mode'] == 'fullscreen'){
$dsp_default_view = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_view_mode&lp_id='.$id.'">' . $dsp_default_view = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_view_mode&lp_id='.$id.'">' .
@ -390,9 +388,9 @@ if (is_array($flat_list))
'</a>&nbsp;'; '</a>&nbsp;';
} }
*/ */
/* DEBUG */ /* DEBUG */
if($test_mode == 'test' or api_is_platform_admin()) { if($test_mode == 'test' or api_is_platform_admin()) {
if($details['lp_scorm_debug']==1){ if($details['lp_scorm_debug']==1){
$dsp_debug = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_scorm_debug&lp_id='.$id.'">' . $dsp_debug = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_scorm_debug&lp_id='.$id.'">' .
@ -403,9 +401,9 @@ if (is_array($flat_list))
'<img src="../img/bug_gray.gif" border="0" alt="'.get_lang("ShowDebug").'" title="'.get_lang("ShowDebug").'"/>' . '<img src="../img/bug_gray.gif" border="0" alt="'.get_lang("ShowDebug").'" title="'.get_lang("ShowDebug").'"/>' .
'</a>&nbsp;'; '</a>&nbsp;';
} }
} }
/* DELETE COMMAND */ /* DELETE COMMAND */
if ($current_session == $details['lp_session']) { if ($current_session == $details['lp_session']) {
$dsp_delete = "<a href=\"lp_controller.php?".api_get_cidreq()."&action=delete&lp_id=$id\" " . $dsp_delete = "<a href=\"lp_controller.php?".api_get_cidreq()."&action=delete&lp_id=$id\" " .
@ -415,7 +413,7 @@ if (is_array($flat_list))
} else { } else {
$dsp_delete = '<img src="../img/delete_na.gif" border="0" title="'.get_lang('_delete_learnpath').'" />'; $dsp_delete = '<img src="../img/delete_na.gif" border="0" title="'.get_lang('_delete_learnpath').'" />';
} }
if($details['lp_prevent_reinit']==1){ if($details['lp_prevent_reinit']==1){
$dsp_reinit = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_reinit&lp_id='.$id.'">' . $dsp_reinit = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_reinit&lp_id='.$id.'">' .
'<img src="../img/kaboodleloop_gray.gif" border="0" alt="Allow reinit" title="'.get_lang("AllowMultipleAttempts").'"/>' . '<img src="../img/kaboodleloop_gray.gif" border="0" alt="Allow reinit" title="'.get_lang("AllowMultipleAttempts").'"/>' .
@ -465,12 +463,12 @@ if (is_array($flat_list))
//hide icon export scorm //hide icon export scorm
//$dsp_disk=''; //$dsp_disk='';
/* COLUMN ORDER */ /* COLUMN ORDER */
// only active in a not session mode // only active in a not session mode
if ($current_session == 0) { if ($current_session == 0) {
if($details['lp_display_order'] == 1 && $max != 1) if($details['lp_display_order'] == 1 && $max != 1)
{ {
$dsp_order .= '<td><a href="lp_controller.php?'.api_get_cidreq().'&action=move_lp_down&lp_id='.$id.'">' . $dsp_order .= '<td><a href="lp_controller.php?'.api_get_cidreq().'&action=move_lp_down&lp_id='.$id.'">' .

@ -19,9 +19,6 @@
//flag to allow for anonymous user - needs to be set before global.inc.php //flag to allow for anonymous user - needs to be set before global.inc.php
$use_anonymous = true; $use_anonymous = true;
require_once('back_compat.inc.php'); require_once('back_compat.inc.php');
if (empty($charset)) {
$charset = 'ISO-8859-15';
}
$htmlHeadXtra[] = '<script language="javascript"> $htmlHeadXtra[] = '<script language="javascript">
function cleanlog(){ function cleanlog(){

@ -33,9 +33,6 @@ if(isset($_SESSION['lpobject'])){
$display_mode = $_SESSION['oLP']->mode; $display_mode = $_SESSION['oLP']->mode;
} }
if($debug>0){error_log('New LP - Loaded lp_message : '.$_SERVER['REQUEST_URI'].' from '.$_SERVER['HTTP_REFERER'],0);} if($debug>0){error_log('New LP - Loaded lp_message : '.$_SERVER['REQUEST_URI'].' from '.$_SERVER['HTTP_REFERER'],0);}
if (empty($charset)) {
$charset = 'ISO-8859-15';
}
$htmlHeadXtra[] = '<script language="JavaScript" type="text/javascript"> $htmlHeadXtra[] = '<script language="JavaScript" type="text/javascript">
var dokeos_xajax_handler = window.parent.oxajax; var dokeos_xajax_handler = window.parent.oxajax;

@ -47,8 +47,6 @@ if ($is_allowed_in_course == false) api_not_allowed();
Variables Variables
----------------------------------------------------------- -----------------------------------------------------------
*/ */
//$charset = 'UTF-8';
//$charset = 'ISO-8859-1';
// we set the encoding of the lp // we set the encoding of the lp
if (!empty($_SESSION['oLP']->encoding)) { if (!empty($_SESSION['oLP']->encoding)) {
@ -56,9 +54,6 @@ if (!empty($_SESSION['oLP']->encoding)) {
} else { } else {
$charset = api_get_system_encoding(); $charset = api_get_system_encoding();
} }
if (empty($charset)) {
$charset = 'ISO-8859-1';
}
$oLearnpath = false; $oLearnpath = false;
$course_code = api_get_course_id(); $course_code = api_get_course_id();
@ -73,7 +68,7 @@ $my_style=$platform_theme;
*/ */
$htmlHeadXtra[] = '<script src="../inc/lib/javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery $htmlHeadXtra[] = '<script src="../inc/lib/javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
if (api_get_setting('show_glossary_in_documents') == 'ismanual' || api_get_setting('show_glossary_in_documents') == 'isautomatic' ) { if (api_get_setting('show_glossary_in_documents') == 'ismanual' || api_get_setting('show_glossary_in_documents') == 'isautomatic' ) {
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.frameready.js" type="text/javascript" language="javascript"></script>'; $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.frameready.js" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js" type="text/javascript" language="javascript"></script>'; $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js" type="text/javascript" language="javascript"></script>';
} }
@ -260,7 +255,7 @@ if($_SESSION['oLP']->mode == 'fullscreen') {
<div id="preview_image" style="padding:5px;background-image: url('../img/lp_author_background.gif');background-repeat:no-repeat;height:110px"> <div id="preview_image" style="padding:5px;background-image: url('../img/lp_author_background.gif');background-repeat:no-repeat;height:110px">
<div style="width:100; float:left;height:105;margin:5px"> <div style="width:100; float:left;height:105;margin:5px">
<span> <span>
<?php <?php
if ($_SESSION['oLP']->get_preview_image()!='') { if ($_SESSION['oLP']->get_preview_image()!='') {
echo '<img width="115px" height="100px" src="'.api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image().'">'; echo '<img width="115px" height="100px" src="'.api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image().'">';
} else { } else {
@ -320,12 +315,12 @@ if($_SESSION['oLP']->mode == 'fullscreen') {
</div> </div>
<!-- end media player layaout --> <!-- end media player layaout -->
<!-- toc layout --> <!-- toc layout -->
<div id="toc_id" name="toc_name" style="overflow: auto; padding:0;margin-top:20px;height:60%;width:100%"> <div id="toc_id" name="toc_name" style="overflow: auto; padding:0;margin-top:20px;height:60%;width:100%">
<div id="learning_path_toc" style="font-size:9pt;margin:0;"><?php echo $_SESSION['oLP']->get_html_toc(); ?> <div id="learning_path_toc" style="font-size:9pt;margin:0;"><?php echo $_SESSION['oLP']->get_html_toc(); ?>
<!-- log message layout --> <!-- log message layout -->
<div id="lp_log_name" name="lp_log_name" class="lp_log" style="height:50px;overflow:auto;margin:15px"> <div id="lp_log_name" name="lp_log_name" class="lp_log" style="height:50px;overflow:auto;margin:15px">
<div id="log_content"></div> <div id="log_content"></div>
<div id="log_content_cleaner" style="color: white;">.</div> <div id="log_content_cleaner" style="color: white;">.</div>
@ -399,7 +394,7 @@ window.onload = function() {
updateContentHeight(); updateContentHeight();
viewportheight = window.innerHeight; viewportheight = window.innerHeight;
document.getElementById('toc_id').style.height = viewportheight - 200 + "px"; document.getElementById('toc_id').style.height = viewportheight - 200 + "px";
} }
window.onresize = updateContentHeight; window.onresize = updateContentHeight;
@ -450,7 +445,7 @@ window.onresize = updateContentHeight;
<div style="width:100; float:left;height:105;margin:5px"> <div style="width:100; float:left;height:105;margin:5px">
<span style="width:104px; height:96px; float:left; vertical-align:bottom;"> <span style="width:104px; height:96px; float:left; vertical-align:bottom;">
<center> <center>
<?php <?php
if ($_SESSION['oLP']->get_preview_image()!='') { if ($_SESSION['oLP']->get_preview_image()!='') {
$picture = getimagesize(api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image()); $picture = getimagesize(api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image());
if($picture['1'] < 96) { $style = ' style="padding-top:'.((94 -$picture['1'])/2).'px;" '; } if($picture['1'] < 96) { $style = ' style="padding-top:'.((94 -$picture['1'])/2).'px;" '; }
@ -514,11 +509,11 @@ window.onresize = updateContentHeight;
</div> </div>
<!-- end media player layaout --> <!-- end media player layaout -->
<!-- toc layout --> <!-- toc layout -->
<div id="toc_id" name="toc_name" style="overflow: auto; padding:0;margin-top:20px;height:60%;width:100%"> <div id="toc_id" name="toc_name" style="overflow: auto; padding:0;margin-top:20px;height:60%;width:100%">
<div id="learning_path_toc" style="font-size:9pt;margin:0;"><?php echo $_SESSION['oLP']->get_html_toc(); ?> <div id="learning_path_toc" style="font-size:9pt;margin:0;"><?php echo $_SESSION['oLP']->get_html_toc(); ?>
<?php if (!empty($_SESSION['oLP']->scorm_debug)) { //only show log ?> <?php if (!empty($_SESSION['oLP']->scorm_debug)) { //only show log ?>
<!-- log message layout --> <!-- log message layout -->
<div id="lp_log_name" name="lp_log_name" class="lp_log" style="height:150px;overflow:auto;margin:4px"> <div id="lp_log_name" name="lp_log_name" class="lp_log" style="height:150px;overflow:auto;margin:4px">
@ -593,29 +588,29 @@ window.onload = function() {
updateContentHeight(); updateContentHeight();
viewportheight = window.innerHeight; viewportheight = window.innerHeight;
document.getElementById('toc_id').style.height = viewportheight - 200 + "px"; document.getElementById('toc_id').style.height = viewportheight - 200 + "px";
//loads the glossary library
//loads the glossary library
<?php <?php
if (api_get_setting('show_glossary_in_extra_tools') == 'true') { if (api_get_setting('show_glossary_in_extra_tools') == 'true') {
if (api_get_setting('show_glossary_in_documents') == 'ismanual') { if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
?> ?>
$.frameReady(function(){ $.frameReady(function(){
// $("<div>I am a div courses</div>").prependTo("body"); // $("<div>I am a div courses</div>").prependTo("body");
}, "top.content_name", }, "top.content_name",
{ load: [ { load: [
{type:"script", id:"_fr1", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.js"}, {type:"script", id:"_fr1", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.js"},
{type:"script", id:"_fr2", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.highlight.js"}, {type:"script", id:"_fr2", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.highlight.js"},
{type:"script", id:"_fr3", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>fckeditor/editor/plugins/glossary/fck_glossary_manual.js"} {type:"script", id:"_fr3", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>fckeditor/editor/plugins/glossary/fck_glossary_manual.js"}
] } ] }
); );
<?php <?php
} elseif (api_get_setting('show_glossary_in_documents') == 'isautomatic') { } elseif (api_get_setting('show_glossary_in_documents') == 'isautomatic') {
?> ?>
$.frameReady(function(){ $.frameReady(function(){
// $("<div>I am a div courses</div>").prependTo("body"); // $("<div>I am a div courses</div>").prependTo("body");
}, "top.content_name", }, "top.content_name",
{ load: [ { load: [
{type:"script", id:"_fr1", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.js"}, {type:"script", id:"_fr1", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.js"},
{type:"script", id:"_fr2", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.highlight.js"}, {type:"script", id:"_fr2", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.highlight.js"},
{type:"script", id:"_fr3", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>fckeditor/editor/plugins/glossary/fck_glossary_automatic.js"} {type:"script", id:"_fr3", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>fckeditor/editor/plugins/glossary/fck_glossary_automatic.js"}
@ -624,7 +619,7 @@ window.onload = function() {
<?php <?php
} }
} }
?> ?>
} }
window.onresize = updateContentHeight; window.onresize = updateContentHeight;

Loading…
Cancel
Save