「モジュール (開発者)」の版間の差分

提供:MoodleDocs
移動先:案内検索
編集の要約なし
編集の要約なし
34行目: 34行目:
* http://download.moodle.org/plugins16/mod/NEWMODULE.zip - new module template for versions of Moodle prior to 1.7. Please follow the README instructions inside the zip.
* http://download.moodle.org/plugins16/mod/NEWMODULE.zip - new module template for versions of Moodle prior to 1.7. Please follow the README instructions inside the zip.
* Using Moodle [http://moodle.org/course/view.php?id=5 Activity modules] forum
* Using Moodle [http://moodle.org/course/view.php?id=5 Activity modules] forum
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=66165 A new resource type: where do I put the language strings?] forum discussion
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=66165 A new resource type: where do I put the language strings?] フォーラムでのディスカッション
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=65986 New Module Template Code for Moodle 1.7] forum discussion
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=65986 New Module Template Code for Moodle 1.7] フォーラムでのディスカッション


[[Category:開発者]]
[[Category:開発者]]
[[Category:モジュール]]
[[Category:モジュール]]

2007年9月22日 (土) 10:40時点における版

作成中です - Mitsuhiro Yoshida 2006年12月7日 (木) 19:41 (CST)

活動モジュールは、'mod'ディレクトリ内にあります。それぞれのモジュールは、別々のサブディレクトリに分かれていて、次の必須要素を含みます (+ それぞれのモジュール特有のスクリプト):

  • mod.html - 本モジュールのインスタンスを生成・更新するためのフォーム
  • version.php - メタ情報を定義し,アップグレード用コードを提供
  • icon.gif - モジュールを表す 16x16 のアイコン
  • db/ - (各データベース形式毎の)必要な全てのDBテーブルとデータを生成するSQLコード
  • index.php - コース内の全てのインスタンス一覧を表示するページ
  • view.php - 特定のインスタンスを表示するページ
  • lib.php - 本モジュールで定義されるあらゆる全ての関数はここに書く。例えばモジュール名が widget である場合,以下の関数が必須:
  • widget_install() - モジュールのインストール中に呼び出される
  • widget_add_instance() - widget の新しいインスタンスを追加するためのコード
  • widget_update_instance() - すでに存在するインスタンスを更新するためのコード
  • widget_delete_instance() - インスタンスを削除するためのコード
  • widget_user_outline() - 特定のインスタンスに対するユーザの貢献のサマリを返す
  • widget_user_complete() - 特定のインスタンスに対するユーザの貢献の詳細を表示する
  • 必須ではないが,使用可能なその他の関数:
  • To avoid possible conflict, any module functions should be named starting with widget_ and any constants you define should start with WIDGET_
  • config.html - (optional) a form to set up or update global settings of this module
  • Lastly, each module will have some language files that contain strings for that module.

重要: When creating a new module, the new name of the module must not contain numbers or other special characters!

You should also make sure that your activity module provides appropriate support for groups and metacourses.

関連情報