Download the PHP package msaaq/nelc-xapi-php-sdk without Composer

On this page you can find all versions of the php package msaaq/nelc-xapi-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nelc-xapi-php-sdk

xAPI Integration with Saudi NELC (National Center for e-Learning)

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

The base concept of this package is to provide a simple way to send xAPI statements to Saudi NELC (National Center for e-Learning) LRS (Learning Record Store).

Installation

You can install the package via composer:

Usage

1. Create Api Client.

The first step to use the SDK is to create an instance of the ApiClient. The ApiClient is the main entry point to the SDK. It is responsible for creating the other objects and for sending the requests to the API.

The ApiClient required the following credentials:

You need to contact NELC to provide you with your integration credentials.

After we created our client, we can use it to send statements to the NELC LRS.

2. Send Statement

To send a statement to the NELC LRS, we need to create an instance of the StatementClient class.

The StatementClient required an instance of the ApiClient that we've created in the previous step, and the $platform.

Now we are almost ready to send our first statement to the NELC LRS, we just need to create an instance of the Statement that we are going to send, but first let's understand the Statement classes structure.

Statement Structure

You can think of the Statement as an event that happened in your application, and we have 8 types of statements for each case:

Name Description Class
registered Indicates the actor is officially enrolled or inducted in an activity. RegisteredStatement
initialized Indicates the activity provider has determined that the actor successfully started an activity. InitializedStatement
watched Indicates that the actor has watched the object. This verb is typically applicable only when the object represents dynamic, visible content such as a movie, a television show or a public performance. This verb is a more specific form of the verbs experience, play and consume. WatchedStatement
completed Indicates the actor finished or concluded the activity normally. CompletedStatement
progressed Indicates a value of how much of an actor has advanced or moved through an activity. ProgressedStatement
rated Action of giving a rating to an object. Should only be used when the action is the rating itself, as opposed to another action such as "reading" where a rating can be applied to the object as part of that action. In general the rating should be included in the Result with a Score object. RatedStatement
earned Indicates that the actor has earned or has been awarded the object. EarnedStatement
attempted Indicates the actor made an effort to access the object. An attempt statement without additional activities could be considered incomplete in some cases. AttemptedStatement

Every statement requires the following:

For the timestamp you can use Carbon, you can use the toIso8601String() method to get the correct format.

Let's prepare the Actor and Instructor objects, as we are going to use them with all of our statements.

Now we are ready to create our first statement:

Registered Statement

The RegisteredStatement is used to indicate that the student is officially enrolled or inducted in an activity.

Initialized Statement

The InitializedStatement is used to indicate that the actor (student) has successfully started the course.

Watched Statement

The WatchedStatement is used to indicate that the actor (student) has watched the object (video).

This statement requires more properties than the previous statements, as it has the following properties:

Attempted Statement

The AttemptedStatement is used to indicate that the actor (student) has attempted the object (quiz).

This statement requires more properties than the previous statements, as it has the following properties:

Completed Statement (Module, Chapter or Unit)

The CompletedStatement is used to indicate that the actor (student) has completed the object (module).

Progressed Statement

The ProgressedStatement is used to indicate that the actor (student) has progressed the object (module/course).

Completed Statement (Course)

The CompletedStatement is used to indicate that the actor (student) has completed the object (course).

Rated Statement

The RatedStatement is used to indicate that the actor (student) has rated the object (course).

Earned Statement

The EarnedStatement is used to indicate that the actor (student) has earned the object (certificate).

License

The MIT License (MIT). Please see License File for more information.


All versions of nelc-xapi-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2|^8.3
guzzlehttp/guzzle Version ^7.5
nesbot/carbon Version ^2.62
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package msaaq/nelc-xapi-php-sdk contains the following files

Loading the files please wait ....