Здравствуйте, я ищу способ добавить в закладки страницу с помощью JavaScript, чтобы при повторном открытии пользователем курса он запоминал страницу, на которой он или она, отправив ее в SCORM / Moodle.1003 *
с использованием Scorm 1.2 и Moodle 1.9:)
Большое спасибо
<!-- ================ -->
<!-- Bookmarking start -->
<!-- ================ -->
<script type="text/javascript" src="SCORM_API_wrapper.js"></script>
<script type="text/javascript">
//Using pipwerks namespace, SCORM 1.2
var success = pipwerks.SCORM.init();
if(success){
var status = pipwerks.SCORM.get("cmi.core.lesson_status");
if(status != "completed"){
success = pipwerks.SCORM.get("cmi.core.lesson_status", "completed");
if(success){
pipwerks.SCORM.quit();
}
}
}
function setbookMark() {
var setlessonLocation = scorm.set("cmi.core.lesson_location", "2");
}
function showbookMark() {
alert(scorm.get("cmi.core.lesson_location"));
}
window.onload = function (){
init();
setbookMark();
}
</script>
<!-- ================ -->
<!-- Bookmarking End -->
<!-- ================ -->
Первая страница индекса, которая загружена
<script type="text/javascript" src="SCORM_API_wrapper.js"></script>
<script type="text/javascript">
var scorm = pipwerks.SCORM;
function init(){
//Specify SCORM 1.2:
scorm.version = "1.2";
var callSucceeded = scorm.init();
}
function end(){
var callSucceeded = scorm.quit();
}
function bookMark() {
var lessonLocation = scorm.get("cmi.core.lesson_location");
if (lessonLocation == "1") {
window.location = "1.html";
}
else if(lessonLocation == "2") {
window.location = "2.html";
}
else if(lessonLocation == "3") {
window.location = "3.html";
}
else if(lessonLocation == "4") {
window.location = "4.html";
}
else if(lessonLocation == "5") {
window.location = "5.html";
}
else if(lessonLocation == "6") {
window.location = "6.html";
}
else if(lessonLocation == "") {
window.location = "1.html";
}
}
window.onload = function (){
init();
bookMark();
}
window.onunload = function (){
end();
}
</script>