如何让moodle离线
您好,我对 Moodle 还很陌生,我想了解一些有关使 Moodle 离线以及可在服务器和客户端之间使用的同步技术的想法。 (用于数据库同步和文件夹内容同步)。请提供一些与此相关的信息。提前致谢
hi i'm pretty new to the moodle and i would like to get some idea on making the moodle offline and the synchronization techniques that could be used between the server and the clients. (for both db synchronization and folder content synchronization). Please provide some information regarding this. Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为此,您可以使用 Gears。查看此插件:
Offline Moodle:Google Gears 缓存
http://moodle.org/mod/data /view.php?d=13&rid=2636&filter=1
You can use Gears for this. Check out this plugin:
Offline Moodle: Google Gears caching
http://moodle.org/mod/data/view.php?d=13&rid=2636&filter=1
这是我的想法。这是假设客户端安装了 Moodle 的本地副本,但所有数据都在服务器上。
服务器->客户端同步很容易。您的服务器需要公开数据库模式+数据。当您的数据库变得很大时,仅发送数据库差异可能是明智的(每次客户端与服务器同步时,拍摄数据库转储的快照并记下同步时间,然后当客户端想要再次同步时比较当前数据库和上次同步时的快照并仅发送差异)。您可以使用
rsync
轻松同步文件和文件夹。客户端->服务器同步很棘手。假设 A 教授和 B 教授在离线状态下创建了两门具有两个不同名称的不同课程。然而,由于数据库的工作方式,两个课程可能在数据库中具有相同的 ID,这会破坏事情。这里有一个疯狂的想法,如何在不修改 Moodle 代码库的情况下解决这个问题:如果您使用 MySQL,则在每次同步时为每个用户提供不同的 AUTO_INCRMENT 编号。例如,在 A 教授与服务器同步后,他收到信息,课程表的下一个自动生成的 ID 应为 10000,而 B 教授的 ID 为 20000。如果 A 教授创建一门新课程,其 ID = 10001,B 教授的 ID = 10001。新课程将为 20001。这样,教授可以创建多达 10000 个新课程,而不会导致 ID 冲突。然而,这并不能保护您免受恶意攻击。
看起来您并不是唯一一个考虑让 Moodle 下线的人。
Here are my ideas. This is assuming clients have a local copy of Moodle installed but all the data is on the server.
Server -> Client synchronization is easy. Your server needs to expose the db schema + data. When your database grows large, it may be wise to send only a db diff (every time a client synchronizes with the server, take a snapshot of the db dump and note the time of synchronization, then when a client wants to synchronize again compare the current db and the snapshot at the time of last sync and send only the diff). You can synchronize files and folders easily with
rsync
.Client -> Server synchronization is tricky. Let's say Prof A and Prof B create two different courses with two different names while they are offline. However, because of the way databases work both courses are likely to have the same ID in the database and it will break things. Here is a crazy idea how to solve it without modifying Moodle codebase: if you use MySQL, give each user a different AUTO_INCREMENT number on every sync. For example, after Prof A syncs with the server he receives info that the next automatically generated ID for the courses table should be 10000 and for Prof B it is 20000. If Prof A creates a new course it will have ID = 10001 and Prof B's new course will be 20001. This way Profs can create up to 10000 new courses without causing ID clashes. This will not however protect you from someone with malicious intents.
It looks like you are not the only one who has thought about taking Moodle offline.