LP, if debug is on (red bug in lp list) the LP will be always loaded from the DB and not from a session

skala
Julio Montoya 13 years ago
parent 53b367813e
commit 2ba7509c5d
  1. 12
      main/newscorm/learnpath.class.php
  2. 3
      main/newscorm/lp_controller.php

@ -314,10 +314,10 @@ class learnpath {
}
if (is_object($this->items[$row['id']])) {
$this->items[$row['id']]->set_status($row2['status']);
if (empty ($row2['status'])) {
$this->items[$row['id']]->set_status($this->default_status);
}
$this->items[$row['id']]->set_status($row2['status']);
if (empty ($row2['status'])) {
$this->items[$row['id']]->set_status($this->default_status);
}
}
//$this->attempt = $row['view_count'];
//$this->last_item = $row['id'];
@ -327,11 +327,11 @@ class learnpath {
//$this->attempt = 1;
//$this->last_item = 0;
if (is_object($this->items[$row['id']])) {
$this->items[$row['id']]->set_status($this->default_status);
$this->items[$row['id']]->set_status($this->default_status);
}
// Add that row to the lp_item_view table so that we have something to show in the stats page.
$sql_ins = "INSERT INTO $lp_item_view_table (c_id, lp_item_id, lp_view_id, view_count, status)
VALUES ($course_id, ".$row['id'] . "," . $this->lp_view_id . ",1,'not attempted')";
VALUES ($course_id, ".$row['id'] . "," . $this->lp_view_id . ",1,'not attempted')";
if ($this->debug > 2) {
error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - Inserting blank item_view : ' . $sql_ins, 0);
}

@ -112,6 +112,7 @@ if (!empty($_SESSION['refresh']) && $_SESSION['refresh'] == 1) {
$myrefresh = 1;
if ($debug > 0) error_log('New LP - Refresh asked', 0);
}
if ($debug > 0) error_log('New LP - Passed refresh check', 0);
if (!empty($_REQUEST['dialog_box'])) {
@ -126,7 +127,7 @@ if (isset($_SESSION['lpobject'])) {
$oLP = unserialize($_SESSION['lpobject']);
if (isset($oLP) && is_object($oLP)) {
if ($debug > 0) error_log('New LP - oLP is object', 0);
if ($myrefresh == 1 OR (empty($oLP->cc)) OR $oLP->cc != api_get_course_id() OR $oLP->lp_view_session_id != $session_id) {
if ($myrefresh == 1 OR (empty($oLP->cc)) OR $oLP->cc != api_get_course_id() OR $oLP->lp_view_session_id != $session_id OR $oLP->scorm_debug == '1') {
if ($debug > 0) error_log('New LP - Course has changed, discard lp object', 0);
if ($myrefresh == 1) { $myrefresh_id = $oLP->get_id(); }
$oLP = null;

Loading…
Cancel
Save