diff --git a/main/inc/ajax/lp.ajax.php b/main/inc/ajax/lp.ajax.php index 293a90a52f..b250e1ddb1 100755 --- a/main/inc/ajax/lp.ajax.php +++ b/main/inc/ajax/lp.ajax.php @@ -14,7 +14,7 @@ $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); $sessionId = api_get_session_id(); switch ($action) { - case 'get_documents'; + case 'get_documents': $courseInfo = api_get_course_info(); $folderId = isset($_GET['folder_id']) ? $_GET['folder_id'] : null; if (empty($folderId)) { @@ -46,9 +46,13 @@ switch ($action) { if ($_REQUEST['type'] == TOOL_QUIZ) { $title = Exercise::format_title_variable($title); } + + $parentId = isset($_REQUEST['parent_id']) ? $_REQUEST['parent_id'] : ''; + $previousId = isset($_REQUEST['previous_id']) ? $_REQUEST['previous_id'] : ''; + echo $_SESSION['oLP']->add_item( - $_REQUEST['parent_id'], - $_REQUEST['previous_id'], + $parentId, + $previousId, $_REQUEST['type'], $_REQUEST['id'], $title, diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php index 2bde646192..418a6e8fa6 100755 --- a/main/newscorm/learnpath.class.php +++ b/main/newscorm/learnpath.class.php @@ -597,7 +597,7 @@ class learnpath "max_score" => $max_score, "parent_item_id" => $parent, "previous_item_id" => $previous, - "next_item_id" => $next, + "next_item_id" => itnval($next), "display_order" => $display_order +1, "prerequisite" => $prerequisites, "max_time_allowed" => $max_time_allowed,