|
@@ -45,7 +45,7 @@ function switch_item_toc($lp_id, $user_id, $view_id, $current_item, $next_item)
|
|
if ($debug > 2) { error_log('Building new lp', 0); }
|
|
if ($debug > 2) { error_log('Building new lp', 0); }
|
|
unset($oLP);
|
|
unset($oLP);
|
|
$code = api_get_course_id();
|
|
$code = api_get_course_id();
|
|
- $mylp = new learnpath($code,$lp_id,$user_id);
|
|
|
|
|
|
+ $mylp = new learnpath($code, $lp_id, $user_id);
|
|
} else {
|
|
} else {
|
|
if ($debug > 1) { error_log('Reusing session lp', 0); }
|
|
if ($debug > 1) { error_log('Reusing session lp', 0); }
|
|
$mylp = & $oLP;
|
|
$mylp = & $oLP;
|
|
@@ -87,8 +87,7 @@ function switch_item_toc($lp_id, $user_id, $view_id, $current_item, $next_item)
|
|
$mylp->start_current_item(true);
|
|
$mylp->start_current_item(true);
|
|
if ($mylp->force_commit) {
|
|
if ($mylp->force_commit) {
|
|
$mylp->save_current();
|
|
$mylp->save_current();
|
|
- }
|
|
|
|
- //$objResponse->addAlert(api_get_path(REL_CODE_PATH).'newscorm/learnpathItem.class.php');
|
|
|
|
|
|
+ }
|
|
if (is_object($mylp->items[$new_item_id])) {
|
|
if (is_object($mylp->items[$new_item_id])) {
|
|
$mylpi = & $mylp->items[$new_item_id];
|
|
$mylpi = & $mylp->items[$new_item_id];
|
|
} else {
|
|
} else {
|
|
@@ -182,8 +181,6 @@ function switch_item_toc($lp_id, $user_id, $view_id, $current_item, $next_item)
|
|
if ($debug > 1) { error_log('Prereq_match() returned '.htmlentities($mylp->error), 0); }
|
|
if ($debug > 1) { error_log('Prereq_match() returned '.htmlentities($mylp->error), 0); }
|
|
$_SESSION['scorm_item_id'] = $new_item_id; // Save the new item ID for the exercise tool to use.
|
|
$_SESSION['scorm_item_id'] = $new_item_id; // Save the new item ID for the exercise tool to use.
|
|
$_SESSION['lpobject'] = serialize($mylp);
|
|
$_SESSION['lpobject'] = serialize($mylp);
|
|
- return $return;
|
|
|
|
- //return $objResponse;
|
|
|
|
|
|
+ return $return;
|
|
}
|
|
}
|
|
-
|
|
|
|
-echo switch_item_toc($_POST['lid'], $_POST['uid'], $_POST['vid'], $_POST['iid'], $_POST['next']);
|
|
|
|
|
|
+echo switch_item_toc($_POST['lid'], $_POST['uid'], $_POST['vid'], $_POST['iid'], $_POST['next']);
|