|
|
|
@ -1664,10 +1664,38 @@ function switch_item(current_item, next_item){ |
|
|
|
|
olms.switch_finished = 0; //only changed back once LMSInitialize() happens |
|
|
|
|
|
|
|
|
|
loadForumThead(olms.lms_lp_id, next_item); |
|
|
|
|
checkCurrentItemPosition(olms.lms_item_id); |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Hide or show the navigation buttons if the current item is the First or Last |
|
|
|
|
*/ |
|
|
|
|
var checkCurrentItemPosition = function(lpItemId) { |
|
|
|
|
var currentItem = $.getJSON('<?php echo api_get_path(WEB_AJAX_PATH) ?>lp.ajax.php', {
|
|
|
|
|
a: 'check_item_position', |
|
|
|
|
lp_item: lpItemId |
|
|
|
|
} |
|
|
|
|
).done(function(parsedResponse,statusText,jqXhr) { |
|
|
|
|
var position = jqXhr.responseJSON; |
|
|
|
|
if (position == 'first') { |
|
|
|
|
$("#scorm-previous").hide(); |
|
|
|
|
$("#scorm-next").show(); |
|
|
|
|
} else if (position == 'none') { |
|
|
|
|
$("#scorm-previous").show(); |
|
|
|
|
$("#scorm-next").show(); |
|
|
|
|
} else if (position == 'last') { |
|
|
|
|
$("#scorm-previous").show(); |
|
|
|
|
$("#scorm-next").hide(); |
|
|
|
|
} else if (position == 'both') { |
|
|
|
|
$("#scorm-previous").hide(); |
|
|
|
|
$("#scorm-next").hide(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Get a forum info when the learning path item has a associated forum |
|
|
|
|
*/ |
|
|
|
|