hurah/canvas-api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hurah/canvas-api

最新稳定版本:v1.0.53

Composer 安装命令:

composer require hurah/canvas-api

包简介

A set of classes that helps with communicating with the Instructure Canvas API.

README 文档

README

Latest Stable Version License CircleCI Build

This library is a PHP SDK for the Instructure Canvas API, designed to simplify communication with Canvas by providing statically typed classes for most API endpoints. It supports both collection and single entity operations. The SDK is still in development but is already being used in small production environments. .

Features

  • Statically typed classes: Provides typed classes for most API endpoints.
  • Collections and entities: Easily handle both collections and single entities in a clean object-oriented manner implementing php's Iterator and ArrayAccess interfaces.
  • Centralized communication: All communication goes through an instance of the Canvas object.
  • Symfony Console Commands: Includes commands for manual communication with the API, offering examples, excellent documentation and testing tools.

Installation

Install the package via Composer:

composer require hurah/canvas-api

Usage

Basic Setup

Create an instance of the Canvas object and authenticate with your API credentials:

use Hurah\CanvasApi\Canvas;

$canvas = new Canvas('your-api-url', 'your-access-token');

Fetching Data

Example: fetch a collection

use Hurah\CanvasApi\Canvas;

$oCourseCollection = $canvas->getCourses();
foreach ($oCourseCollection as $oCourse) {
    echo $oCourse->getName();
}

Example: Single Entity

$oCourse = $canvas->getCourse(123);
echo $course->getName();

Example: Create a new Course

$oCourse = new Course();
$oCourse->setName('Some name');
$oCourse->setDescription('Some description');
$oCourse->setSomeOtherProperty('...')
$oCourse = $canvas->createCourse($oCourse);

// The same object is returned containing the course
// id and other default properties.
$oCourse->getId() 

Contributing

Contributions and feedback are welcome! Please keep in mind that this software is in beta and comes as is. Use it at your own risk.

  1. Fork the repository.
  2. Create your feature branch: git checkout -b feature/my-new-feature.
  3. Commit your changes: git commit -m 'Add some feature'.
  4. Push to the branch: git push origin feature/my-new-feature.
  5. Open a pull request.

Links

Author

Anton Boutkam - Teacher Software Development at ROC Amstelland

CicleCI build status

CircleCI

  • v1.0.51 attempt to add mastery paths
  • v1.0.39 removed print_r
  • v1.0.40 added documentation index under doc/index.md
  • v1.0.41 added mastery path support (getModuleItemSequence, selectMasteryPath) with endpoint models, commands, and tests
  • v1.0.38 exposing lots of new endpoints with codex generated code
  • v1.0.23 added ability to get course students
  • v1.0.22 upgrade dependencies
  • v1.0.21 initialized frozenAttributes in Assignment, was breaking unit testing.
  • v1.0.20 upgraded various dependencies
  • v1.0.18 improved README.md
  • v1.0.17 removed Account part due to insufficient privileges on my Canvas account.
  • v1.0.16 added Assignments, AssignmentGroups, CourseCommands, CourseSubmissionCommands, PageCommands, QuizQuestionCommands
  • v1.0.15 bugfix Added missing properties to Assignment endpoint
  • v1.0.13 bugfix Made setters nullable
  • v1.0.12 added Lots of endpoints
  • v1.0.11 added Canvas::getUserCourses(int $iCanvasId):CourseCollection
  • v1.0.10 added QuizQuestionGetCommand, QuizQuestionListCommand
  • v1.0.9 added QuizQuestion
  • v1.0.8 updated QuizQuestion
  • v1.0.7 updated QuizQuestionGroup
  • v1.0.6 updated QuizQuestionGroup
  • v1.0.5 updated Quiz
  • v1.0.3 added Quiz

统计信息

  • 总下载量: 328
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-10-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固