Skip to content

A Learning Record Store for interactive H5P exercises

License

Notifications You must be signed in to change notification settings

openHPI/openLRS

Repository files navigation

openLRS

LRS (Learning Record Store)

The LRS (Learning Record Store) is a system that stores and retrieves learning records generated by various learning activities. It is designed to support the Experience API (xAPI), also known as Tin Can API, which is a specification for learning technology that enables the collection of data about the wide range of experiences a person has (both online and offline).

For more information, please refer to xAPI.com

openLRS

openLRS is an LRS built from the ground up to be used exclusively by openHPI/KI Campus H5P Tool. It can be easily adapted to be used by other platforms as well, please check LRS Endpoint section for more information. openLRS can be integrated in Moodle using the openLRS Moodle plugin

This repository contains backend and frontend. The backend features an Express app, while the frontend is composed of a React app. The backend is responsible for storing and retrieving xAPI records, while the frontend is responsible for displaying the records in a user-friendly manner.

LRS Endpoint

  • URL: /lrs
  • Method: POST
  • Description: Creates a new LRS entry.
  • Protected: Yes, requires X-Signature header

Required Request Headers:

  • X-Signature: <signature>

Required Request Body:

The request body is required to be shaped like the following to work with openLRS:

{
  "xAPI": {
    "field1": "value1",
    "field2": "value2"
  },
  "metadata": {
    "session": {
      "custom_consumer": "consumer_name",
      "context_id": "course_id"
    }
  }
}

Authentication

X-Signature is required for authentication and accepting xAPI data into openLRS. This signature data is calculated from a secret key shared between the learning platform and openLRS.

Getting started

Make sure to install MongoDB.

Add the following to env file

PORT={{your-lrs-port}}
MONGO_URL=mongodb://{{mongo-host}}:{{mongo-port}}
MONGO_DB={{mongo-db-name}}
MONGO_XAPI_COLLECTION={{mongo-collection-name-for-xAPI-records}}
SECRET={{secret-for-jwt-tokens}}
LRS_SHARED_SECRET_KEY={{secret-shared-key-for-communication-from-H5P}}
ALLOW_PUBLIC_USER_REGISTER={{true-or-false}}

If your Mongo installation has a username and authentication, please embed it in MONGO_URL

Installing Node Modules

Install node modules with

npm install

Additionally, you would want to install node modules for frontend as well.

cd frontend
npm install

Development

To run the app locally, please use

npm run start:dev

This will start nodemon (be sure to install it globally via npm install nodemon -g)

To run the frontend separate for debugging please use

cd frontend && npm run dev

This will start the Create React App for local development on a different port

Deployment

To deploy LRS on the server, install node modules on the root folder and in the frontend folder. Then build the frontend app and finally serve the frontend with ExpressJS backend app. Use the following steps

npm run install
cd frontend && npm run install && npm run build
cd ..
npm run start

License

openLRS is available as open source under the terms of the MIT License.

About

A Learning Record Store for interactive H5P exercises

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •