Skip to content

Commit

Permalink
Don't restart scorm if scorm_debug is on
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Oct 27, 2017
1 parent de2d30b commit bcf3e4d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions main/lp/lp_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,11 @@ function(reponse){
// If refresh is set, we regenerate the oLP object from the database (kind of flush).
Session::erase('refresh');
$myrefresh = 1;
if ($debug > 0) error_log('New LP - Refresh asked', 0);
}

if ($debug > 0) error_log('New LP - Passed refresh check', 0);
if ($debug > 0) {
error_log('New LP - $myrefresh: '.$myrefresh);
}

if (!empty($_REQUEST['dialog_box'])) {
$dialog_box = stripslashes(urldecode($_REQUEST['dialog_box']));
Expand All @@ -231,10 +232,13 @@ function(reponse){
if ($myrefresh == 1 ||
empty($oLP->cc) ||
$oLP->cc != api_get_course_id() ||
$oLP->lp_view_session_id != $session_id ||
$oLP->scorm_debug == '1'
$oLP->lp_view_session_id != $session_id
) {
if ($debug > 0) error_log('New LP - Course has changed, discard lp object', 0);
if ($debug > 0) {
error_log('New LP - Course has changed, discard lp object');
error_log('New LP - $oLP->lp_view_session_id: '.$oLP->lp_view_session_id);
error_log('New LP - $oLP->cc: '.$oLP->cc);
}
if ($myrefresh == 1) {
$myrefresh_id = $oLP->get_id();
}
Expand Down Expand Up @@ -1265,8 +1269,7 @@ function(reponse){
if (!$lp_found) {
error_log('New LP - No learnpath given for return_to_course_homepage', 0);
require 'lp_list.php';
}
else {
} else {
$_SESSION['oLP']->save_current();
$_SESSION['oLP']->save_last();
$url = api_get_path(WEB_COURSE_PATH).api_get_course_path().'/index.php?id_session='.api_get_session_id();
Expand Down

0 comments on commit bcf3e4d

Please sign in to comment.