- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
您好,我正在寻找一种使用 JavaScript 为页面添加书签的方法,以便当用户重新打开类(class)时,它可以通过将其发送到 SCORM/Moodle 来记住他或她所在的页面。
大家有什么想法吗?
使用 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>
最佳答案
设置lesson_location
相当于创建浏览器cookie...您需要在类(class)中编写JavaScript来解析保存的字符串并使用它。
您需要在许多地方更改代码 - 您提供的代码是一个示例,它将您的类(class)设置为在初始化时立即完成。这并不是您真正要找的东西。
以下是有关开始类(class)和寻找书签的快速入门:
var bookmark, initialized, status;
var scorm = pipwerks.SCORM; //shortcut for easier typing
function jumpToPage(url){
//write some code that navigates to the specified url
//Save whatever URL was just used as the bookmark
//each time the function is invoked.
scorm.set("cmi.core.lesson_location", url);
}
function init(){
//the default URL in case no bookmark is found
//or when course is launched for first time
var url = "url_of_first_page.html";
initialized = scorm.init();
if(!initialized){ alert("Course failed to initialize"); return false; }
//Get the lesson status from the LMS
status = scorm.get("cmi.core.lesson_status");
if(status === "completed"){
//You're already done, get out of here
scorm.quit();
return; //exit init() function
} else if(status === "ab-initio"){
//this is the very first launch, no bookmark will be found in LMS
//do nothing
} else {
//Check for a bookmark
bookmark = scorm.get("cmi.core.lesson_location");
//If a bookmark is found, use its value as the target URL
if(bookmark){
url = bookmark;
}
}
jumpToPage(url);
}
window.onload = init;
关于javascript - 书签 LMS、Moodle SCORM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9502874/
我不明白 canvas 中的 sis id 概念。 canvas 中有多个 sis 类型的 sis id's,例如:sis_course_id,sis_user_id。 我发现的一个非常小的解释是这样
C++ 库 Eigen 给我留下了深刻的印象,它使用表达式模板在矩阵/向量计算中获得了巨大的加速。 我想在 scala 中克隆这个库。据我所知,scalas 类型系统还不够强大,无法做这样的事情,但它
我正在使用名为 Ilias ( http://www.ilias.de/ ) 的学习管理系统。我收到一个生成自定义报告的请求,该报告将详细说明所有用户和每个问题的分数。 有人知道我可以在数据库中哪里找
我正在阅读从 ADL 网站下载的 pdf 'SCORM 程序员用户指南',我了解到我们只能在 LMS 中存储一些特定的信息集;比如学习者姓名、分数等。 我想知道我能否制作一个 SCO,它可以将我的 O
我正在尝试使用 eBay Large Merchant Services API 批量上传调用。这个 API 和文档是出了名的糟糕(我发现了一篇博客文章解释了它并反对它 here )。我能找到的最接近
>>>import adaptfilt Traceback (most recent call last): File "", line 1, in import adaptfilt
以下是工作代码,它没有抛出任何错误,但我想使用 jQuery 将数据从播放 SCORM 包的播放器发送到 LMS。 代码- SCORM Player -
即使在初始化之后,SCORM 包也没有与 LMS 通信- 抛出错误- 未找到 SCORM 实现。 我的文件夹结构- -index.php -player.php -course/SCORM-cours
已关闭。此问题旨在寻求有关书籍、工具、软件库等的建议。不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以
您好,我正在寻找一种使用 JavaScript 为页面添加书签的方法,以便当用户重新打开类(class)时,它可以通过将其发送到 SCORM/Moodle 来记住他或她所在的页面。 大家有什么想法吗?
我遇到了流动问题。我正在构建一个服装类(class),该类(class)基于 SCORM 2004 第 3 版,并部署在 SABA LMS 上。我正在做的是: 我使用“API.SetValue”来设置
能否请您告诉我如何为下面的 matlab 代码的 LMS 算法绘制 MSE 曲线。提前致谢。 clc close all clear all N=input('length of sequence N
我正在开发符合 SCORM 标准的 LMS,但 Captivate 生成的内容存在一些问题。 基本上,行为是:如果您快速看到一个 SCO(captivate 生成的内容),例如有 15 张幻灯片,每张
我正在尝试从 Moodle LMS 检索以前保存的数据,但似乎有些东西不起作用。这就是我正在做的: 我将 SCORM (v2004) 包加载到 Moodle 中并执行一些操作(例如保存导航数据或设置完
我正在尝试修改以下文件,默认为 OpenEDX lms。 account_settings_factory_spec.js account_settings_view.js 但是在重新运行 paver
我正在尝试编译 lms-suit,它是 Lime Microsystems LMS 系列收发器的控制软件。从这里的 gitbub 下载: https://github.com/myriadrf/lms
我正在尝试编写一些非常简单的 LMS 批量梯度下降,但我相信我在梯度方面做错了。 theta 的数量级与初始值之间的比率对于 theta 的元素来说非常不同,因此 theta[2] 都不会t 移动(例
我尝试了 LMS 算法的示例: import numpy as np from neupy import algorithms input_data = np.array([[1, 0], [2, 2
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 9
我想我会对这个问题采取很多态度,甚至会投一些反对票,但我真的迷路了。 我知道 SCORM 代表什么以及它有什么用处。我看到了像 scorm.com 这样的付费“引擎”,但它的起价是 2 万美元....
我是一名优秀的程序员,十分优秀!