「コアAPI (Dev docs)」の版間の差分

提供:MoodleDocs
移動先:案内検索
編集の要約なし
42行目: 42行目:
=== キャッシュAPI (cache) ===
=== キャッシュAPI (cache) ===
[[Moodleユニバーサルキャッシュ (MUC)]] はMoodle内でキャッシュデータを保存するための構造体です。[[キャッシュAPI]]では、あなたのコードでキャッシュを使用するために必要なもののいくつかを説明しています。
[[Moodleユニバーサルキャッシュ (MUC)]] はMoodle内でキャッシュデータを保存するための構造体です。[[キャッシュAPI]]では、あなたのコードでキャッシュを使用するために必要なもののいくつかを説明しています。
=== Calendar API (calendar) ===
=== カレンダーAPI (calendar) ===
The [[Calendar API]] allows you to add and modify events in the calendar for user, groups, courses, or the whole site.
[[カレンダーAPI]]を使用すると、ユーザ、グループ、コース、またはサイト全体のカレンダーにイベントを追加および変更することができます。
=== Check API (check) ===
=== チェックAPI (check) ===
The [[Check API]] allows you to add security, performance or health checks to your site.
[[チェックAPI]]を使用すると、サイトにセキュリティ、パフォーマンス、またはヘルスチェックを追加することができます。
=== Comment API (comment) ===
=== コメントAPI (comment) ===
The [[Comment API]] allows you to save and retrieve user comments, so that you can easily add commenting to any of your code.
[[コメントAPI]]を利用すると、ユーザのコメントを保存・取得することができ、どのようなコードにも簡単にコメントを追加することができます。
=== Competency API (competency) ===
=== コンピテンシーAPI (competency) ===
The [[Competency API]] allows you to list and add evidence of competencies to learning plans, learning plan templates, frameworks, courses and activities.
[[コンピテンシーAPI]]では、学習計画、学習計画テンプレート、フレームワーク、コース、活動にコンピテンシーのエビデンスをリストアップして追加することが可能です。
=== Data definition API (ddl) ===
=== データ定義API (ddl) ===
The [[Data definition API]] is what you use to create, change and delete tables and fields in the database during upgrades.
[[データ定義API]]は、アップグレードの際にデータベースのテーブルやフィールドを作成、変更、削除するために使用するものです。
=== Editor API ===
=== エディタAPI ===
The [[Editor API]] is used to control HTML text editors.
HTMLテキストエディタの制御には[[エディタAPI]]が使用されます。
=== Enrolment API (enrol) ===
=== 登録API (enrol) ===
The [[Enrolment API]] deals with course participants.
[[登録API]]は、コースの参加者を扱います。
=== Events API (event) ===
=== イベントAPI (event) ===
The [[Events API]] allows to define "events" with payload data to be fired whenever you like, and it also allows you to define handlers to react to these events when they happen. This is the recommended form of inter-plugin communication. This also forms the basis for logging in Moodle.
[[イベントAPI]]では、好きな時に発生させるペイロードデータを持つ "イベント" を定義し、そのイベントが発生した時に対応するハンドラを定義することができます。これはプラグイン間通信の推奨形式です。これはまた、Moodleのロギングの基礎を形成します。
=== Experience API (xAPI) ===
=== エクスペリエンスAPI (xAPI) ===
The Experience API (xAPI) is an e-learning standard that allows learning content and learning systems to speak to each other. The [[Experience API (xAPI)]]
エクスペリエンスAPI(xAPI)は、学習コンテンツと学習システムが相互に会話できるようにするためのeラーニング標準規格です。[[エクスペリエンスAPI (xAPI)]]は、任意のプラグインでxAPI規格文を生成して処理することができます。
allows any plugin to generate and handle xAPI standard statements.
=== 外部関数API (external) ===
=== External functions API (external) ===
[[外部関数API]]を使うと、外部プログラム([[Webサービス]]など)からアクセスできる、完全にパラメータ化されたメソッドを作成することができます。
The [[External functions API]] allows you to create fully parametrised methods that can be accessed by external programs (such as [[Web services]]).
=== お気に入りAPI ===
=== Favourites API ===
[[お気に入りAPI]]を使用すると、あるユーザのアイテムをお気に入りとしてマークし、そのお気に入りを管理することができます。これはしばしば 'スター付き' と呼ばれます。
The [[Favourites API]] allows you to mark items as favourites for a user and manage these favourites. This is often referred to as 'Starred'.
=== H5P API (h5p) ===
=== H5P API (h5p) ===
The [[H5P API]] allows plugins to make some decisions/implementations related to the [[H5P|H5P integration]].
[[H5P API]]は、プラグインが[[H5P|H5Pインテグレーション]]に関連するいくつかの決定や実装を行うことを可能にします。
=== Lock API (lock) ===
=== ロックAPI (lock) ===
The [[Lock API]] lets you synchronise processing between multiple requests, even for separate nodes in a cluster.
[[ロックAPI]]を使うと、クラスタ内の別々のノードであっても、複数のリクエストの間で処理を同期させることができます。
=== Message API (message) ===
=== メッセージAPI (message) ===
The [[Message API]] lets you post messages to users. They decide how they want to receive them.
[[メッセージAPI]]を使うと、ユーザに対してメッセージを投稿することができます。ユーザはそれをどのように受け取りたいかを決めることができます。
=== Media API (media) ===
=== メディアAPI (media) ===
The [[Media_players#Using_media_players|Media]] API can be used to embed media items such as audio, video, and Flash.
[[メディアプレイヤ#メディアプレイヤの使用|メディア]] APIを使用すると、オーディオ、ビデオ、Flashなどのメディアアイテムを埋め込むことができます。
=== My profile API ===
=== マイプロファイルAPI ===
The [[My profile API]] is used to add things to the profile page.
[[マイプロファイルAPI]]は、プロファイルページに何かを追加するために使用されます。
=== OAuth 2 API (oauth2) ===
=== OAuth 2 API (oauth2) ===
The [[OAuth 2 API]] is used to provide a common place to configure and manage external systems using OAuth 2.
[[OAuth 2 API]]は、OAuth 2を利用した外部システムの設定や管理を共通化するために利用します。
=== Payment API (payment) ===
=== ペイメントAPI (payment) ===
The [[Payment API]] deals with payments.
[[ペイメントAPI]]は、決済を扱うAPIです。
=== Preference API (preference) ===
=== プリファレンスAPI (preference) ===
The [[Preference API]] is a simple way to store and retrieve preferences for individual users.
[[プリファレンスAPI]]は、個々のユーザのプリファレンスを保存し、取得するためのシンプルな方法です。
=== Portfolio API (portfolio) ===
=== ポートフォリオAPI (portfolio) ===
The [[Portfolio API]] allows you to add portfolio interfaces on your pages and allows users to package up data to send to their portfolios.
[[ポートフォリオAPI]]を使用すると、ページ上にポートフォリオのインターフェースを追加したり、ユーザがデータをパッケージ化してポートフォリオに送信したりすることができます。
=== Privacy API (privacy) ===
=== プライバシーAPI (privacy) ===
The [[Privacy API]] allows you to describe the personal data that you store, and provides the means for that data to be discovered, exported, and deleted on a per-user basis.
[[プライバシーAPI]]は、保存する個人データを記述し、ユーザごとにデータの発見、エクスポート、削除を行うための手段を提供するものです。
This allows compliance with regulation such as the General Data Protection Regulation (GDPR) in Europe.
これにより、欧州の一般データ保護規則(GDPR)などの規制に対応することができます。
=== Rating API (rating) ===
=== 評価API (rating) ===
The [[Rating API]] lets you create AJAX rating interfaces so that users can rate items in your plugin. In an activity module, you may choose to aggregate ratings to form grades.
[[評価API]] を使用すると、ユーザがプラグインのアイテムを評価できるように、AJAX評価インターフェースを作成できます。活動モジュールでは、評価を形成するために評定を集約することを選択することができます。
=== Report builder API (reportbuilder) ===
=== レポートビルダーAPI (reportbuilder) ===
The [[Report builder API]] allows you to create reports in your plugin, as well as providing custom reporting data which users can use to build their own reports.
[[レポートビルダーAPI]]を使用すると、プラグインでレポートを作成したり、ユーザが独自のレポートを作成するために使用するカスタムレポートデータを提供することができます。
=== RSS API (rss) ===
=== RSS API (rss) ===
The [[RSS API]] allows you to create secure RSS feeds of data in your module.
The [[RSS API]] allows you to create secure RSS feeds of data in your module.
110行目: 109行目:
=== Custom fields API ===
=== Custom fields API ===
The [[Custom fields API]] allows you to configure and add custom fields for different entities
The [[Custom fields API]] allows you to configure and add custom fields for different entities
== Activity module APIs ==
== Activity module APIs ==
Activity modules are the most important plugin in Moodle. There are several core APIs that service only Activity modules.
Activity modules are the most important plugin in Moodle. There are several core APIs that service only Activity modules.

2022年3月10日 (木) 06:26時点における版

English page: dev: Core APIs

Moodleには、Moodleスクリプトのためのツールを提供する、いくつかのコアAPIがあります。

これらはMoodleプラグインを書く際に必要不可欠です。

最も利用されている一般的なAPI

これらのAPIは重要であり、ほぼすべてのMoodleプラグインで使用されます。

アクセスAPI (access)

アクセスAPIは、現在のユーザに何が許可されているかを判断するための関数を提供し、モジュールが新しい機能でMoodleを拡張することを可能にします。

データ操作API (dml)

データ操作APIを使うと、データベースに対して一貫した安全な方法で読み書きができるようになります。

ファイルAPI (file)

ファイルAPIは、様々なプラグインと連携してファイルの保存を制御します。

フォームAPI (form)

フォームAPIは、Webフォームを介したユーザデータの定義と処理を行います。

ロギングAPI (log)

イベントAPIではMoodleのイベントを記録することができ、ロギング2ではログがどのように保存および取得されるかについて説明されています。

ナビゲーションAPI (navigation)

ナビゲーションAPIを使うと、ナビゲーションツリーを操作して、アイテムを自由に追加したり削除したりすることができます。

ページAPI (page)

ページAPIは、現在のページの設定、JavaScriptの追加、ユーザへの表示方法の設定に使用されます。

アウトプットAPI (output)

ページのすべての部分のHTMLをレンダリングするためにアウトプットAPIが使用されます。

ストリングAPI (string)

ストリングAPIは、ユーザインターフェースで使用する言語のテキスト文字列を取得する方法です。これは、利用できるかもしれないあらゆる言語の翻訳を処理します。

アップグレードAPI (upgrade)

アップグレードAPIは、モジュールが自身のバージョンを追跡することで、インストールとアップグレードを行う方法です。

Moodlelib API (core)

Moodlelib APIは、雑多な汎用Moodle関数のセントラルライブラリファイルです。関数はリクエストパラメータ、設定、ユーザ設定、時間、ログイン、mnet、プラグイン、文字列および他の処理を行うことができます。また、多くの定数も定義されています。

その他一般的なAPI

管理者設定API (admin)

管理者設定APIは、各プラグインおよびMoodleコアの設定オプションの提供を扱います。

管理者プリセットAPI (adminpresets)

管理者プリセットAPIは、プラグインがサイト管理者プリセットに関連するいくつかの決定や実装を行うことができるようにするものです。

アナリティクスAPI (analytics)

アナリティクスAPIを使用すると、予測モデルを作成したり、インサイトを生成したりすることができます。

アベイラビリティAPI (availability)

活動やセクションへのアクセスを制御するアベイラビリティAPI があります。

バックアップAPI (backup)

バックアップAPIはバックアップのためにコースデータをXMLに変換する方法を正確に定義し、リストアAPIはそれを逆に変換する方法を記述しています。

キャッシュAPI (cache)

Moodleユニバーサルキャッシュ (MUC) はMoodle内でキャッシュデータを保存するための構造体です。キャッシュAPIでは、あなたのコードでキャッシュを使用するために必要なもののいくつかを説明しています。

カレンダーAPI (calendar)

カレンダーAPIを使用すると、ユーザ、グループ、コース、またはサイト全体のカレンダーにイベントを追加および変更することができます。

チェックAPI (check)

チェックAPIを使用すると、サイトにセキュリティ、パフォーマンス、またはヘルスチェックを追加することができます。

コメントAPI (comment)

コメントAPIを利用すると、ユーザのコメントを保存・取得することができ、どのようなコードにも簡単にコメントを追加することができます。

コンピテンシーAPI (competency)

コンピテンシーAPIでは、学習計画、学習計画テンプレート、フレームワーク、コース、活動にコンピテンシーのエビデンスをリストアップして追加することが可能です。

データ定義API (ddl)

データ定義APIは、アップグレードの際にデータベースのテーブルやフィールドを作成、変更、削除するために使用するものです。

エディタAPI

HTMLテキストエディタの制御にはエディタAPIが使用されます。

登録API (enrol)

登録APIは、コースの参加者を扱います。

イベントAPI (event)

イベントAPIでは、好きな時に発生させるペイロードデータを持つ "イベント" を定義し、そのイベントが発生した時に対応するハンドラを定義することができます。これはプラグイン間通信の推奨形式です。これはまた、Moodleのロギングの基礎を形成します。

エクスペリエンスAPI (xAPI)

エクスペリエンスAPI(xAPI)は、学習コンテンツと学習システムが相互に会話できるようにするためのeラーニング標準規格です。エクスペリエンスAPI (xAPI)は、任意のプラグインでxAPI規格文を生成して処理することができます。

外部関数API (external)

外部関数APIを使うと、外部プログラム(Webサービスなど)からアクセスできる、完全にパラメータ化されたメソッドを作成することができます。

お気に入りAPI

お気に入りAPIを使用すると、あるユーザのアイテムをお気に入りとしてマークし、そのお気に入りを管理することができます。これはしばしば 'スター付き' と呼ばれます。

H5P API (h5p)

H5P APIは、プラグインがH5Pインテグレーションに関連するいくつかの決定や実装を行うことを可能にします。

ロックAPI (lock)

ロックAPIを使うと、クラスタ内の別々のノードであっても、複数のリクエストの間で処理を同期させることができます。

メッセージAPI (message)

メッセージAPIを使うと、ユーザに対してメッセージを投稿することができます。ユーザはそれをどのように受け取りたいかを決めることができます。

メディアAPI (media)

メディア APIを使用すると、オーディオ、ビデオ、Flashなどのメディアアイテムを埋め込むことができます。

マイプロファイルAPI

マイプロファイルAPIは、プロファイルページに何かを追加するために使用されます。

OAuth 2 API (oauth2)

OAuth 2 APIは、OAuth 2を利用した外部システムの設定や管理を共通化するために利用します。

ペイメントAPI (payment)

ペイメントAPIは、決済を扱うAPIです。

プリファレンスAPI (preference)

プリファレンスAPIは、個々のユーザのプリファレンスを保存し、取得するためのシンプルな方法です。

ポートフォリオAPI (portfolio)

ポートフォリオAPIを使用すると、ページ上にポートフォリオのインターフェースを追加したり、ユーザがデータをパッケージ化してポートフォリオに送信したりすることができます。

プライバシーAPI (privacy)

プライバシーAPIは、保存する個人データを記述し、ユーザごとにデータの発見、エクスポート、削除を行うための手段を提供するものです。 これにより、欧州の一般データ保護規則(GDPR)などの規制に対応することができます。

評価API (rating)

評価API を使用すると、ユーザがプラグインのアイテムを評価できるように、AJAX評価インターフェースを作成できます。活動モジュールでは、評価を形成するために評定を集約することを選択することができます。

レポートビルダーAPI (reportbuilder)

レポートビルダーAPIを使用すると、プラグインでレポートを作成したり、ユーザが独自のレポートを作成するために使用するカスタムレポートデータを提供することができます。

RSS API (rss)

The RSS API allows you to create secure RSS feeds of data in your module.

Search API (search)

The Search API allows you to index contents in a search engine and query the search engine for results.

Tag API (tag)

The Tag API allows you to store tags (and a tag cloud) to items in your module.

Task API (task)

The Task API lets you run jobs in the background. Either once off, or on a regular schedule.

Time API (time)

The Time API takes care of translating and displaying times between users in the site.

Testing API (test)

The testing API contains the Unit test API (PHPUnit) and Acceptance test API (Acceptance testing). Ideally all new code should have unit tests written FIRST.

User-related APIs (user)

This is a rather informal grouping of miscellaneous User-related APIs relating to sorting and searching lists of users.

Web services API (webservice)

The Web services API allows you to expose particular functions (usually external functions) as web services.

Badges API (badges)

The Badges user documentation (is a temp page until we compile a proper page with all the classes and APIs that allows you to manage particular badges and OpenBadges Backpack).

Custom fields API

The Custom fields API allows you to configure and add custom fields for different entities

Activity module APIs

Activity modules are the most important plugin in Moodle. There are several core APIs that service only Activity modules.

Activity completion API (completion)

The Activity completion API is to indicate to the system how activities are completed.

Advanced grading API (grading)

The Advanced grading API allows you to add more advanced grading interfaces (such as rubrics) that can produce simple grades for the gradebook.

Conditional activities API (condition) - deprecated in 2.7

The deprecated Conditional activities API used to provide conditional access to modules and sections in Moodle 2.6 and below. It has been replaced by the Availability API.

Groups API (group)

The Groups API allows you to check the current activity group mode and set the current group.

Gradebook API (grade)

The Gradebook API allows you to read and write from the gradebook. It also allows you to provide an interface for detailed grading information.

Plagiarism API (plagiarism)

The Plagiarism API allows your activity module to send files and data to external services to have them checked for plagiarism.

Question API (question)

The Question API (which can be divided into the Question bank API and the Question engine API), can be used by activities that want to use questions from the question bank.

See also

  • Plugins - plugin types also have their own APIs
  • Callbacks - list of all callbacks in Moodle
  • Coding style - general information about writing PHP code for Moodle