|
|
|
@ -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); } |
|
|
|
|
unset($oLP); |
|
|
|
|
$code = api_get_course_id(); |
|
|
|
|
$mylp = new learnpath($code,$lp_id,$user_id); |
|
|
|
|
$mylp = new learnpath($code, $lp_id, $user_id); |
|
|
|
|
} else { |
|
|
|
|
if ($debug > 1) { error_log('Reusing session lp', 0); } |
|
|
|
|
$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); |
|
|
|
|
if ($mylp->force_commit) { |
|
|
|
|
$mylp->save_current(); |
|
|
|
|
} |
|
|
|
|
//$objResponse->addAlert(api_get_path(REL_CODE_PATH).'newscorm/learnpathItem.class.php'); |
|
|
|
|
} |
|
|
|
|
if (is_object($mylp->items[$new_item_id])) { |
|
|
|
|
$mylpi = & $mylp->items[$new_item_id]; |
|
|
|
|
} 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); } |
|
|
|
|
$_SESSION['scorm_item_id'] = $new_item_id; // Save the new item ID for the exercise tool to use. |
|
|
|
|
$_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']); |