$myinteractions_count = $mylpi->get_interactions_count();
    $myobjectives_count = $mylpi->get_objectives_count();
    $mycore_exit = $mylpi->get_core_exit();

    $return .=
            "olms.lms_lp_id=".$lp_id.";" .
            "olms.lms_item_id=".$next_item.";" .
            "olms.lms_old_item_id=0;" .
            "olms.lms_initialized=0;" .
            "olms.lms_view_id=".$view_id.";" .
            "olms.lms_user_id=".$user_id.";" .
            "olms.next_item=".$next_item.";" . // This one is very important to replace possible literal strings.
            "olms.lms_next_item=".$mynext.";" .
            "olms.lms_previous_item=".$myprevious.";" .
            "olms.lms_item_type = '".$myitemtype."';" .
            "olms.lms_item_credit = '".$mycredit."';" .
            "olms.lms_item_lesson_mode = '".$mylesson_mode."';" .
            "olms.lms_item_launch_data = '".$mylaunch_data."';" .
            "olms.lms_item_interactions_count = '".$myinteractions_count."';" .
            "olms.lms_item_objectives_count = '".$myinteractions_count."';" .
            "olms.lms_item_core_exit = '".$mycore_exit."';" .
            "olms.asset_timer = 0;";

    $mylp->set_error_msg('');
    $mylp->prerequisites_match(); // Check the prerequisites are all complete.
    if ($debug > 1) { error_log('Prereq_match() returned '.htmlentities($mylp->error), 0); }
    if ($debug > 1) { error_log("return = $return "); }
    return $return;
}
echo initialize_item($_POST['lid'], $_POST['uid'], $_POST['vid'], $_POST['iid']);
    $mytotal = $mylp->get_total_items_count_without_chapters();
    $mycomplete = $mylp->get_complete_items_count();
    $myprogress_mode = $mylp->get_progress_bar_mode();
    $myprogress_mode = $myprogress_mode == '' ? '%' : $myprogress_mode;
    $mynext = $mylp->get_next_item_id();
    $myprevious = $mylp->get_previous_item_id();
    $myitemtype = $mylpi->get_type();
    $mylesson_mode = $mylpi->get_lesson_mode();
    $mycredit = $mylpi->get_credit();
    $mylaunch_data = $mylpi->get_launch_data();
    $myinteractions_count = $mylpi->get_interactions_count();
    $myobjectives_count = $mylpi->get_objectives_count();
    $mycore_exit = $mylpi->get_core_exit();
    $return .= "olms.lms_lp_id=" . $lp_id . ";" . "olms.lms_item_id=" . $next_item . ";" . "olms.lms_old_item_id=0;" . "olms.lms_initialized=0;" . "olms.lms_view_id=" . $view_id . ";" . "olms.lms_user_id=" . $user_id . ";" . "olms.next_item=" . $next_item . ";" . "olms.lms_next_item=" . $mynext . ";" . "olms.lms_previous_item=" . $myprevious . ";" . "olms.lms_item_type = '" . $myitemtype . "';" . "olms.lms_item_credit = '" . $mycredit . "';" . "olms.lms_item_lesson_mode = '" . $mylesson_mode . "';" . "olms.lms_item_launch_data = '" . $mylaunch_data . "';" . "olms.lms_item_interactions_count = '" . $myinteractions_count . "';" . "olms.lms_item_objectives_count = '" . $myinteractions_count . "';" . "olms.lms_item_core_exit = '" . $mycore_exit . "';" . "olms.asset_timer = 0;";
    $mylp->set_error_msg('');
    $mylp->prerequisites_match();
    // Check the prerequisites are all complete.
    if ($debug > 1) {
        error_log('Prereq_match() returned ' . htmlentities($mylp->error), 0);
    }
    if ($debug > 1) {
        error_log("return = {$return} ");
    }
    return $return;
}
$lId = isset($_POST['lid']) ? $_POST['lid'] : '';
$userId = isset($_POST['uid']) ? $_POST['uid'] : '';
$vId = isset($_POST['vid']) ? $_POST['vid'] : '';
$iId = isset($_POST['iid']) ? $_POST['iid'] : '';
echo initialize_item($lId, $userId, $vId, $iId);
Container::$legacyTemplate = 'layout_empty.html.twig';