本文へスキップ
Skillpedia
APIとサーバー(バックエンド)48k · #5251

moodle-external-api-development

できること

このツールは、オンライン学習システムであるMoodleの新しい接続(API)を作成するのに役立ちます。Moodleのルールと標準に従うため、すべてが正しく動作するようになります。

使う場面

  • ✓Moodleに独自の機能を追加したいとき。
  • ✓Moodleに接続して、コースを管理するアプリを作るとき。
  • ✓Moodleから他のシステムへ情報を送信させたいとき。

スキルのリンク

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/moodle-external-api-development/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/moodle-external-api-development/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“特定のコースで、受講生のクイズ受験回数を取得するAPIを作るにはどうすればよいですか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

このツールは、こうした接続をステップバイステップで作る方法を説明した詳しいガイドを使います。Moodleのベストプラクティスとセキュリティ標準に従えるようにしてくれます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Moodle External API Development

This skill guides you through creating custom external web service APIs for Moodle LMS, following Moodle's external API framework and coding standards.

Detailed Guide

Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.

When to Use This Skill

  • Creating custom web services for Moodle plugins
  • Implementing REST/AJAX endpoints for course management
  • Building APIs for quiz operations, user tracking, or reporting
  • Exposing Moodle functionality to external applications
  • Developing mobile app backends using Moodle

Examples from Real Implementation

Simple Read API (Get Quiz Attempts)

<?php
namespace local_userlog\external;

defined('MOODLE_INTERNAL') || die();
require_once("$CFG->libdir/externallib.php");

use external_api;
use external_function_parameters;
use external_single_structure;
use external_value;

class get_quiz_attempts extends external_api {
    public static function execute_parameters() {
        return new external_function_parameters([
            'userid' => new external_value(PARAM_INT, 'User ID'),
            'courseid' => new external_value(PARAM_INT, 'Course ID')
        ]);
    }

    public static function execute($userid, $courseid) {
        global $DB;

        self::validate_parameters(self::execute_parameters(), [
            'userid' => $userid,
            'courseid' => $courseid
        ]);

        $sql = "SELECT COUNT(*) AS quiz_attempts
                FROM {quiz_attempts} qa
                JOIN {quiz} q ON qa.quiz = q.id
                WHERE qa.userid = :userid AND q.course = :courseid";

        $attempts = $DB->get_field_sql($sql, [
            'userid' => $userid,
            'courseid' => $courseid
        ]);

        return ['quiz_attempts' => (int)$attempts];
    }

    public static function execute_returns() {
        return new external_single_structure([
            'quiz_attempts' => new external_value(PARAM_INT, 'Total number of quiz attempts')
        ]);
    }
}

Complex Write API (Create Quiz from Categories)

See attached create_quiz_from_categories.php for a comprehensive example including:

  • Multiple database insertions
  • Course module creation
  • Quiz instance configuration
  • Random question selection with tags
  • Group-based access restrictions
  • Extensive error logging
  • Transaction management

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
よくある質問

外部APIとは何ですか?

異なるコンピュータプログラム同士が通信するための仕組みです。Moodleの場合、他のシステムがMoodleに情報を求めたり、Moodleへ情報を送ったりできるようになります。

このツールを使うには、プログラミングの専門家である必要がありますか?

コードを作成する作業を含むため、基本的なプログラミングの知識があると望ましいです。詳しいガイドが各ステップを説明してくれます。

Moodleの「コーディング標準」とは何ですか?

Moodleの開発者が、他の開発者にとって整理されていて、安全で、理解しやすいコードを書くために従うルールのことです。

詳細

作者による元の説明

This skill guides you through creating custom external web service APIs for Moodle LMS, following Moodle's external API framework and coding standards.

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#5251
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル