Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions public/main/lp/ScormApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -466,14 +466,14 @@ public static function saveItem(
// If this object's JS status has not been updated by the SCORM API, update now.
$return .= "olms.lesson_status='".$myStatus."';";
}
$return .= "update_toc('".$myStatus."','".$item_id."');";
$return .= "if (typeof update_toc === 'function') { try { update_toc('".$myStatus."','".$item_id."'); } catch (e) {} }";
$update_list = $myLP->get_update_queue();

foreach ($update_list as $my_upd_id => $my_upd_status) {
if ($my_upd_id != $item_id) {
/* Only update the status from other items (i.e. parents and brothers),
do not update current as we just did it already. */
$return .= "update_toc('".$my_upd_status."','".$my_upd_id."');";
$return .= "if (typeof update_toc === 'function') { try { update_toc('".$my_upd_status."','".$my_upd_id."'); } catch (e) {} }";
}
}
$progressBarSpecial = false;
Expand Down Expand Up @@ -819,9 +819,13 @@ public static function switchItem($lpId, $user_id, $view_id, $current_item, $nex
}

$return .=
"update_toc('unhighlight','".$current_item."');
update_toc('highlight','".$new_item_id."');
update_toc('$mylesson_status','".$new_item_id."');
"if (typeof update_toc === 'function') {
try {
update_toc('unhighlight','".$current_item."');
update_toc('highlight','".$new_item_id."');
update_toc('$mylesson_status','".$new_item_id."');
} catch (e) {}
}
update_progress_bar('$mycomplete','$mytotal','$myprogress_mode');
$updateMinTime"
;
Expand Down
Loading
Loading