Skip to content

qr/php-thas-client

Repository files navigation

ThasClient

First version of an API to exchange Learning Analytics. This API is based on events (inspired by Caliper Analytics® Specification, version 1.1) that are send to the api. We use a number of events. The session event is used to register logins and logouts of the application The view event is used to register page views for theory. The grade event is used to register results of doing assignments. Such a result is modelled as a score. The assessment event is used to register the completion of an assignment. This information is transfered as an attempt. The item event is used to register the answer of a student to a question The navigation event is used to register url navigations in the application The media event is used to register media use like video and audio The tooluseevent is used to register usage of external tools that are accessed from the application Both theory and assignments are considered digital resources. An assignment is an assignable digital resource. Most events have an object and a target. The object needs to be used to set the stream (streamcode) and the target to set the content element within the stream. A student is seen as an actor.

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/qr/php-thas-client.git"
    }
  ],
  "require": {
    "qr/php-thas-client": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/ThasClient/vendor/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure Bearer (JWT) authorization: JWT
$config = Thas\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Thas\Api\AnalyticsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$one_of_view_event_grade_event_assignable_event_session_event_navigation_event_tool_use_event_media_event_assessment_item_event = array(new \Thas\Model\array()); // OneOfViewEventGradeEventAssignableEventSessionEventNavigationEventToolUseEventMediaEventAssessmentItemEvent[] | 

try {
    $apiInstance->learningAnalytics($one_of_view_event_grade_event_assignable_event_session_event_navigation_event_tool_use_event_media_event_assessment_item_event);
} catch (Exception $e) {
    echo 'Exception when calling AnalyticsApi->learningAnalytics: ', $e->getMessage(), PHP_EOL;
}

?>

Documentation for API Endpoints

All URIs are relative to http://thas.thiememeulenhoff.x-ip.nl/api/v1.0.0

Class Method HTTP request Description
AnalyticsApi learningAnalytics POST /learning_analytics
AnalyticsApi learningAnalyticsGet GET /learning_analytics

Documentation For Models

Documentation For Authorization

JWT

  • Type: Bearer authentication (JWT)

Author

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published