ローカル/ sanitychecker / view
このアドオンはMoodleの健全性チェックを実装するためのインターフェースを提供します。
内容
ムードル版
Moodle 2.3以降
Moodle 2.3、2.4、2.5、および2.6のインストール
- 正しいディレクトリに移動します
- まず最初に、作業ディレクトリをYOUR_MOODLE_DIRROOT / localに変更してください。ここで、YOUR_MOODLE_DIRROOTはあなたのMoodleサイトのルートディレクトリを表します。
プラグインを入手
- gitを使う
- 次のコマンドを実行してプラグインリポジトリを複製します。
git clone https://github.com/eviweb/moodle-local_sanitychecker.git sanitychecker
アーカイブを使用する
- githubから直接zipアーカイブをダウンロードし、sanitycheckerディレクトリの下で解凍します。
wget -c https://github.com/eviweb/moodle-local_sanitychecker/archive/master.zip unzip master.zip && mv moodle-local_sanitychecker-master sanitychecker
インストールを完了する
- 管理者アカウントで認証し、通知ページに進んでインストールを完了してください。
- このページは以下の場所にあります。
http(s)://YOUR_MOODLE_SITE/admin/index.php where : YOUR_MOODLE_SITE is the domain of your moodle site.
この機能の使い方
- インストールしたら、下にリンクがあります。
Settings > Site administration
- 正気チェッカーと呼ばれます。クリックすると、プラグインダッシュボードにリダイレクトされます。
- その表は4つの列の下に利用可能な健全性チェッカーをすべてリストしています:
Name : the implementation name Description : should describe what the checker is supposed to do Actions : here is displayed a dynamic link to run the actions to perform > check : to run the tests > resolve : in case a problem is found, apply the fix Information : displays contextual information about what is done
- どのテストを実行したいのかを選択し、[テストの実行]をクリックします。
- 問題が見つかった場合、前のアクションリンクは「問題の解決」という名前に変更されます。
- それをクリックして修正を適用します。
新しい健全性チェッカーを作成する方法
- APIを実装する
SanityCheckerインターフェースの実装を作成する
インターフェースSanityChecker {
/**
* get the sanity checker name
*
* @return string returns the name of this implementation
*/
public function getName();
/**
* get the description of what this sanity check does
*
* @return string returns the description of this implementation
*/
public function getDescription();
/**
* perform the test
*
* @return boolean returns true if the test succeeds, false if it fails
*/
public function doCheck();
/**
* get information on the problem detected
*
* @return string returns information related to the detected problem
* or an empty string if there is no issue
*/
public function getInformationOnIssue();
/**
* resolve the problem
*/
public function resolveIssue();
}
または抽象DatabaseSanityCheckerを拡張します。
これはデータベースレコードの健全性チェックを実行するためのクラスヘルパーです。
サービスの実装を登録する
./classes/META-INF/services/evidev.moodle.plugins.sanitycheckerファイルの新しい行に、実装のクラスのフルネームを追加します。
今のところ、自分でクラスをロードする方法、または./classesディレクトリの下にインストールする方法を提供することに注意してください。
このディレクトリのサブツリーの下のMETA-INF以外の各フォルダは、クラス名前空間の一部を表します。
- これを説明するために、SanityCheckerインターフェースは、名前空間evidevmoodlepluginsで宣言され、次の場所にあります。
./classes/evidev/moodle/plugins/SanityChecker.php
関連情報
ダウンロードページ
https://moodle.org/plugins/view.php?plugin=local_sanitychecker