「Moodle 安装插件」:修訂間差異
Yucheng Hu(留言 | 貢獻) (→安装一个扩展) |
Yucheng Hu(留言 | 貢獻) |
||
(未顯示同一使用者於中間所作的 9 次修訂) | |||
第60行: | 第60行: | ||
|} | |} | ||
通过上面 2 种方法,当你单击按钮【安装扩展】,你将会被自动导向到 【首页 > 网站管理 > 插件 > 安装扩展】 (对应的英文路径为:Administration > Site administration > Plugins > Install add-ons)下,然后开始安装过程(例如,创建必须的数据库表等操作)。 | |||
=== | === 在服务器上进行手动安装=== | ||
如果你不能通过管理员的 Web 界面来安装扩展,你需要将文件手工拷贝到系统上(例如,你不具有服务器上 Moodle 安装目录的)。 | |||
首先,需要确认 Moodle 扩展的类型结构。 | |||
* /path/to/moodle/theme/ - | * /path/to/moodle/theme/ - 主题 | ||
* /path/to/moodle/mod/ - | * /path/to/moodle/mod/ - 活动模块和资源 | ||
* /path/to/moodle/blocks/ - | * /path/to/moodle/blocks/ - 边栏块 | ||
* /path/to/moodle/question/type/ - | * /path/to/moodle/question/type/ - 问题类型 | ||
* /path/to/moodle/course/format/ - | * /path/to/moodle/course/format/ - 课程格式 | ||
* /path/to/moodle/admin/report/ - | * /path/to/moodle/admin/report/ - 管理员报表 | ||
请查看 [[:dev:Plugins]] 来获得所有扩展类型以及他们在 Moodle 网站中的路径。 | |||
# | # 进入 [https://moodle.org/plugins Moodle 插件目录] ,选择 Moodle 2.5 版本,然后选择需要的 Moodle 扩展,然后单击下载按钮下载 ZIP 包。 | ||
# | # 上传下载的 ZIP 包到你的 Moodle 服务器上。 | ||
# | # 解压 ZIP 包到正确的位置,这个根据扩展的类型不同而不同,或者请参考扩展的帮助手册。 | ||
# | # 在你的网站以 Moodle 管理员的身份进入''Administration > Site administration > Notifications'' ,你应该看到你安装扩展的类型,同时得到扩展已经安装的消息。 | ||
注意:你安装的扩展可能包含了语言文件,这些语言文件可以被你的 Moodle 安装实例自动找到。这些语言文件可以通过: ''Settings > Site administration > Language'' 编辑界面自定义配置。如果在尝试编辑你的语言文件时候,你得到" 数据库错误" 的提示信息,这是因为下载语言文件中的 ZIP 包需要被强制修改,很有可能是下载的这个扩展有程序错误。如果你上传 ''plugin_name/lang/other_language_different_to_English/'' 文件夹,这个数据库错误就会消失的的话,那应该是这个扩展有一个错误语言包的错误,请通知扩展的开发人员,以便于开发人员能在后续版本中进行修复。 | |||
== | == 解决问题== | ||
=== | === 错误=== | ||
如果你遇到了错误,请参考[[ 打开调试信息]] 来获得更多导致错误的信息。 | |||
;tool_installaddon/err_curl_exec - cURL error 60 : | ;tool_installaddon/err_curl_exec - cURL error 60 : 这个问题是需要校验远程(moodle.org )的 SSL 认证信息。这个问题对于运行 Windows 7 的服务器的机器是已知错误,请查看[[moodle.org 的 SSL 认证]] 来得到更多的信息和可能的解决方案。 | ||
=== | === 当手动进行安装的时候=== | ||
* | * 检查文件的权限。 Web 服务器需要能读取插件文件,如果其他 Moodle 功能正常并能正常工作,请检查插件文件的权限和所属权是否正确。 | ||
* | * 请 ''' 确认''' 插件文件的解压和安装都在正确的位置。 | ||
* | * 因为 Moodle 在插件目录中查找插件,Moodle 将不会扫描其他文件夹。请确认你删除 ZIP 文件而不是将 ZIP 文件重命名,例如将你老版本的插件重命名其他文件名而不删除的话,将会导致错误。 | ||
* | * 请确认插件的目录名是正确的,所有的名字必须相同,如果你修改名字的话,插件将不会正常工作。 | ||
=== | === 获得帮助=== | ||
到 Moodle 官方网站社区的 [http://moodle.org/course/view.php?id=5 使用 Moodle] 版块进行提问。请正确描述的系统(包括 MySQL ,PHP 的相关软件的版本),你尝试进行了什么样的操作和你得到了什么样的结果。 | |||
请拷贝所有的错误信息。 | |||
请提供你尝试安装扩展的版本和你下载插件的地址,很多扩展的名字非常接近。 | |||
关于 Moodle 的中文帮助,请参考 OSSEZ 的相关板块 [http://www.ossez.com/forum-54-1.html http://www.ossez.com/forum-54-1.html],尽可能的提供详细信息,必要的时候请多截图。 | |||
== | == 卸载一个扩展== | ||
卸载插件 | |||
# 到路径 ''Administration> Site Administration > Plugins > Plugins overview'' 然后单击你希望卸载插件的【卸载】链接按钮。 | |||
# 使用文件管理员来删除插件目录下的物理文件,否则 Moodle 在你下次访问管理员界面的时候被重新安装。 | |||
注意:一些插件类型提供从磁盘中直接删除的功能,但是不是所有的扩展都提供这个功能。 | |||
== | == 插件概要== | ||
[[File:插件概要页面.jpg|thumb|left|插件概要高亮显示了可用的更新和安装按钮]]插件摘要界面位于 ''Administration > Site Administration > Plugins > Plugins overview'' 路径下,显示了所有已经安装的插件,同时包括版本号,是否可用(启用或者禁用)和设置的链接,如果有这个链接的话。 | |||
按钮 '检查可用更新'对管理员可用,被用于快速检查你的插件是否已经有可用的任何更新或者已经安装的更新。任何可用的更新将会被高亮显示,同时也会显示更多的信息和一个下载链接将会在插件的备注栏位中显示。 | |||
===从 Moodle 中更新插件=== | |||
从 Moodle 2.4 开始,习惯管理员可以在''Administration > Site Administration > Server > Update notifications''中启用更新和部署。 | |||
当更新可用的时候,'安装这个更新'按钮将会显示在插件预览页面。 | |||
查看 [[自动更新部署]] 页面来获得更多信息。 | |||
==禁止你的 Moodle 安装实例安装任何扩展 == | |||
如果需要,Moodle 扩展的安装和更新可以被完全禁止。 | |||
拷贝 config-dist.php 文件中的下面行中的内容到 config.php 文件。 | |||
// Use the following flag to completely disable the On-click add-on installation | // Use the following flag to completely disable the On-click add-on installation | ||
第129行: | 第141行: | ||
// | // | ||
// $CFG->disableonclickaddoninstall = true; | // $CFG->disableonclickaddoninstall = true; | ||
注意,在实际使用的时候需要取消掉行前的注释。 | |||
==See also== | ==See also== |
於 2013年8月25日 (日) 02:24 的最新修訂
通過向 Moodle 中安裝一些可選的擴展,可以擴展 Moodle 的功能。
比如可以通過向 Moodle 安裝插件增加新的活動,新的考試問題類型,新的報表以及可以與其他系統進行整合等更多的功能。
'插件' 和 '擴展' 在 Moodle 中是什麼意思
'plugin' 和 'add-on',我們通常認為 plugin 對照於中文的插件,add-on 對照於中文的擴展。
Moodle = 核心代碼 + 插件
這裡的插件可以是標準的插件(包含在 Moodle 下載包中)或者是其他的一些擴展。
考慮運行在生產環境下的 Moodle (如果你是初學者,請跳過這部分內容)
非常重要 警告:請非常小心,一些插件沒有被 Moodle 官方進行檢查,這些插件可能在質量和穩定性上對你 Moodle 安裝實例的影響也沒有進行評估。如果你安裝的 Moodle 插件與你期望的有差距的時候,這個插件帶來的安全隱患可能遠遠超過這個插件不能工作這麼簡單。這些是隨著 Moodle 插件目錄的發展而進行改善的。
當你希望安裝一個新的 Moodle 擴展的時候,你需要考慮認真考慮下面的內容:
- 如果你的生產環境中運行了一個非常大的 Moodle 網站,你在安裝任何插件的時候需要認真考慮是否真正需要這個擴展。 更多的擴展意味著更多的事情需要支持,更多的潛在威脅,在升級的時候需要擔心更多。
- 這個擴這是否提供支持和維護?如果出現了問題,你是否能獲得有效的技術支持,如果你提交了bug,這些bug能否被修復。
- 如果這個擴展不能被 Moodle 的新版本支持,你將打算怎麼做?
- 擔心 補丁 (Moodle Plugins Directory Other category)!如果你安裝的 Moodle 擴展修改和替換了 Moodle 的核心文件,那麼就需要十分小心了。這個可能僅僅能保證在 Moodle 的 build 版本中運行,在實際生產環境中,可能會被 Moodle 的升級程序重寫而導致系統錯誤。
安裝一個擴展
要安裝一個 Moodle 的擴展,這個擴這的代碼必須部署到 Moodle 內的安裝目錄下,同時管理員的通知頁面必須可見。
管理員頁面在英文 Moodle 系統中的訪問路徑如下:Administration > Site administration > Notifications
有三種方式可以安裝 Moodle 擴展到 Moodle 系統中。
從 Moodle 2.5 版本開始,插件可以通過上傳到 Moodle 安裝實例目錄的方式或者通過界面上傳 ZIP 包的方式進行上傳。
Web 伺服器需要具有 Moodle 插件目錄的文件寫入權限,新擴展的上傳可以使用上面提供的 2 種方式的任何一種上傳到伺服器上。
作為可選方案,你也可以手動部署代碼到伺服器上。
從 Moodle 的插件目錄中直接進行安裝
請注意,這種安裝方式需要到 Moodle 官方網站上進行插件查找,你可能需要要求註冊使用者才可以進行訪問。
- 用管理員登錄後,進入目錄首頁 > 網站管理 > 插件 > 安裝擴展 (對應的英文路徑為:Administration > Site administration > Plugins > Install add-ons)
- 單擊按鈕 '從 Moodle 擴展目錄來安裝擴展'。
- 使用安裝按鈕來查找一個擴展(例如:2.5 穩定版),然後單擊安裝按鈕繼續。
- 請確定你是否獲得提示信息 '校驗已通過!',然後單擊按鈕 '安裝擴展'。
查找和安裝的詳細辦法請參考 OSSEZ 提供的技術指導:從 Moodle 的插件目錄中直接進行安裝
通過上傳 ZIP 文件進行安裝
- 到 Moodle 插件目錄,選擇 Moodle 2.5 做為需要下載擴展的版本,然後單擊下載來下載 ZIP 包。
- 用管理員登錄後,進入目錄首頁 > 網站管理 > 插件 > 安裝擴展 (對應的英文路徑為:Administration > Site administration > Plugins > Install add-ons)。
- 上傳 ZIP 文件,選擇顯示的插件類型,選擇相關信息選擇框,然後單擊 'Install add-on from the ZIP file'按鈕。
- 請確定你是否獲得提示信息 '校驗已通過!',然後單擊按鈕 '安裝擴展'。
通過上面 2 種方法,當你單擊按鈕【安裝擴展】,你將會被自動導向到 【首頁 > 網站管理 > 插件 > 安裝擴展】 (對應的英文路徑為:Administration > Site administration > Plugins > Install add-ons)下,然後開始安裝過程(例如,創建必須的資料庫表等操作)。
在伺服器上進行手動安裝
如果你不能通過管理員的 Web 界面來安裝擴展,你需要將文件手工拷貝到系統上(例如,你不具有伺服器上 Moodle 安裝目錄的)。
首先,需要確認 Moodle 擴展的類型結構。
- /path/to/moodle/theme/ - 佈景
- /path/to/moodle/mod/ - 活動模组和資源
- /path/to/moodle/blocks/ - 邊欄塊
- /path/to/moodle/question/type/ - 問題類型
- /path/to/moodle/course/format/ - 課程格式
- /path/to/moodle/admin/report/ - 管理員報表
請查看 dev:Plugins 來獲得所有擴展類型以及他們在 Moodle 網站中的路徑。
- 進入 Moodle 插件目錄,選擇 Moodle 2.5 版本,然後選擇需要的 Moodle 擴展,然後單擊下載按鈕下載 ZIP 包。
- 上傳下載的 ZIP 包到你的 Moodle 伺服器上。
- 解壓 ZIP 包到正確的位置,這個根據擴展的類型不同而不同,或者請參考擴展的幫助手冊。
- 在你的網站以 Moodle 管理員的身份進入Administration > Site administration > Notifications,你應該看到你安裝擴展的類型,同時得到擴展已經安裝的消息。
注意:你安裝的擴展可能包含了語言文件,這些語言文件可以被你的 Moodle 安裝實例自動找到。這些語言文件可以通過: Settings > Site administration > Language編輯界面自定義配置。如果在嘗試編輯你的語言文件時候,你得到"資料庫錯誤"的提示信息,這是因為下載語言文件中的 ZIP 包需要被強制修改,很有可能是下載的這個擴展有程序錯誤。如果你上傳 plugin_name/lang/other_language_different_to_English/文件夾,這個資料庫錯誤就會消失的的話,那應該是這個擴展有一個錯誤語言包的錯誤,請通知擴展的開發人員,以便於開發人員能在後續版本中進行修復。
解決問題
錯誤
如果你遇到了錯誤,請參考打開調試信息來獲得更多導致錯誤的信息。
- tool_installaddon/err_curl_exec - cURL error 60
- 這個問題是需要校驗遠程(moodle.org)的 SSL 認證信息。這個問題對於運行 Windows 7 的伺服器的機器是已知錯誤,請查看moodle.org 的 SSL 認證來得到更多的信息和可能的解決方案。
當手動進行安裝的時候
- 檢查文件的權限。 Web 伺服器需要能讀取插件文件,如果其他 Moodle 功能正常並能正常工作,請檢查插件文件的權限和所屬權是否正確。
- 請 確認 插件文件的解壓和安裝都在正確的位置。
- 因為 Moodle 在插件目錄中查找插件,Moodle 將不會掃描其他文件夾。請確認你刪除 ZIP 文件而不是將 ZIP 文件重命名,例如將你老版本的插件重命名其他文件名而不刪除的話,將會導致錯誤。
- 請確認插件的目錄名是正確的,所有的名字必須相同,如果你修改名字的話,插件將不會正常工作。
獲得幫助
到 Moodle 官方網站社區的 使用 Moodle 區塊進行提問。請正確描述的系統(包括 MySQL,PHP 的相關軟體的版本),你嘗試進行了什麼樣的操作和你得到了什麼樣的結果。
請拷貝所有的錯誤信息。
請提供你嘗試安裝擴展的版本和你下載插件的地址,很多擴展的名字非常接近。
關於 Moodle 的中文幫助,請參考 OSSEZ 的相關板塊 http://www.ossez.com/forum-54-1.html,儘可能的提供詳細信息,必要的時候請多截圖。
卸載一個擴展
卸載插件
- 到路徑 Administration> Site Administration > Plugins > Plugins overview 然後單擊你希望卸載插件的【卸載】連結按鈕。
- 使用文件管理員來刪除插件目錄下的物理文件,否則 Moodle 在你下次訪問管理員界面的時候被重新安裝。
注意:一些插件類型提供從磁碟中直接刪除的功能,但是不是所有的擴展都提供這個功能。
插件概要
插件摘要界面位於 Administration > Site Administration > Plugins > Plugins overview 路徑下,顯示了所有已經安裝的插件,同時包括版本號,是否可用(啟用或者禁用)和設置的連結,如果有這個連結的話。
按鈕 '檢查可用更新'對管理員可用,被用於快速檢查你的插件是否已經有可用的任何更新或者已經安裝的更新。任何可用的更新將會被高亮顯示,同時也會顯示更多的信息和一個下載連結將會在插件的備註欄位中顯示。
從 Moodle 中更新插件
從 Moodle 2.4 開始,習慣管理員可以在Administration > Site Administration > Server > Update notifications中啟用更新和部署。
當更新可用的時候,'安裝這個更新'按鈕將會顯示在插件預覽頁面。
查看 自動更新部署 頁面來獲得更多信息。
禁止你的 Moodle 安裝實例安裝任何擴展
如果需要,Moodle 擴展的安裝和更新可以被完全禁止。
拷貝 config-dist.php 文件中的下面行中的內容到 config.php 文件。
// Use the following flag to completely disable the On-click add-on installation // feature and hide it from the server administration UI. // // $CFG->disableonclickaddoninstall = true;
注意,在實際使用的時候需要取消掉行前的注釋。
See also
- Notifications for further details of update notifications
- Add-on Review Criteria
- Add-on FAQ
- Using Moodle General add-ons forum
- Installing a contributed extension from its Git repository
- Managing add-ons in Moodle 2.5 blog post by Gavin Henrick
For developers: