Skip to content

About

A prototype initialization of Hihaho xAPI to ensure it works.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Hihaho xAPI Dashboard

A web dashboard for tracking and analysing xAPI (Tin Can) statements generated by Hihaho interactive videos. Statements are stored in SCORM Cloud's LRS and surfaced through charts, tables, heatmaps, and Salesforce lead forwarding. This is all the progress that I (Dustin Phan) have done over 6 weeks in my internship at SPline Global in Tokyo.


Table of Contents


Dependencies & Setup

SCORM Cloud

SCORM Cloud acts as the LRS (Learning Record Store) — it receives and stores all xAPI statements sent by Hihaho.

  1. Create a SCORM Cloud account.
  2. Navigate to the Apps / API tab.
  3. Click Add Application and give it a name.
  4. Find the new application in the list and click Details.
  5. Copy the App ID and Secret Key — you will need these for Hihaho and the Lambda.
  6. Under the xAPI LRS tab, go to the LRS Endpoints sub-tab and copy the endpoint URL.

Hihaho

Each video (or folder of videos) needs to be pointed at the SCORM Cloud LRS endpoint.

  1. Open the video settings of the video you want to enable xAPI on.
  2. Navigate to the LMS | LXP section.
  3. Enable xAPI sharing.
  4. Fill in the fields using your SCORM Cloud details:
    • Endpoint → LRS endpoint URL from SCORM Cloud
    • Username → App ID
    • Password → Secret Key
  5. Save your changes.

Tip — Folder-level config: Instead of configuring each video individually, open the folder settings and complete steps 2–4 there. Then, in each video's settings, ensure "Use Folder Settings" is set to Yes and the correct folder is selected.

  1. Under Account Settings, go to API Settings and create an API account. Copy the generated API token — it is used by the Lambda to fetch your video list.

Frontend

The frontend is a static site (HTML + vanilla JS modules) deployed to S3/CloudFront.

  • Open app.js and update the MY_FOLDER constant at the top of the file to match the exact name of your Hihaho folder:
    const MY_FOLDER = "Your Folder Name Here";

AWS

Lambda

The backend runs as a single AWS Lambda function that proxies requests to SCORM Cloud, Hihaho, and Salesforce.

  1. Create a new Lambda function (runtime: Node.js; other settings are flexible).
  2. Paste the backend code into the Lambda editor and click Deploy.
  3. Go to the Configuration tab and set the timeout to 30 seconds (the default 3 s is too short for chained API calls).
  4. Attach an IAM role with the necessary permissions and expose the function via API Gateway — the generated API Gateway URL is your LAMBDA_URL in app.js.

S3 Bucket

The frontend files are served from an S3 bucket. Sync your local repo (or GitHub Actions pipeline) to the bucket:

aws s3 sync ./ s3://your-bucket-name

CloudFront

CloudFront sits in front of S3 to provide HTTPS and caching.

  1. Create a CloudFront distribution and set the origin to your S3 bucket URL.
  2. Copy the CloudFront distribution ID — you will need it to invalidate the cache after deployments:
    aws cloudfront create-invalidation --distribution-id YOUR_DIST_ID --paths "/*"
  3. The CloudFront HTTPS URL is also required as the OAuth callback URL for Google and Salesforce.

Google OAuth2

Google login allows users to bypass the Hihaho email prompt when the video player loads.

  1. Go to the Google Cloud Console and create an OAuth 2.0 Client ID (Web application type).
  2. Add your CloudFront URL as an Authorised redirect URI.
  3. Copy the Client ID and Client Secret into the Lambda environment variables (or directly into the backend code where GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET are referenced).
  4. Add the Gmail addresses that should be permitted to log in to the ALLOWED_EMAILS whitelist in the Lambda.

Salesforce

Salesforce is used to forward high-completion viewers as leads via the REST API.

  1. Create or log in to your Salesforce account.
  2. Go to Setup and confirm your profile has Administrator privileges. If not, ensure your role has API permissions enabled.
  3. Navigate to Setup → Apps → External Client Apps and create a new app.
  4. Under the app's settings, enable OAuth and configure it:
    • Callback URL → your CloudFront HTTPS URL (Salesforce requires a secure origin)
    • OAuth Scopes → enable Manage user data via APIs and Perform requests at any time
  5. Under Flow Management, enable Client Credentials Flow.
  6. Under the Policies tab, in the OAuth Flows and External Client App Enhancements section, also enable Client Credential Flow.
  7. Copy the Salesforce domain name (e.g. https://yourorg.my.salesforce.com) and substitute it into the Lambda wherever the Salesforce instance URL is referenced.

UI Overview

Tabs

Video Player

Pulls all videos from the Hihaho API that are published, embedded, and belong to the configured folder name. Click any video in the sidebar list to load it in the player. xAPI statements (attempted, paused, completed, etc.) are sent automatically as you interact with the video.

Raw JSON

Displays xAPI statements retrieved from SCORM Cloud. Use the search bar filters (user, verb, video, date range, limit) to narrow results. Each statement is expandable to show the full JSON payload. A Download CSV button exports the current result set.

Data Table

Shows the filtered statements as a simple table: Actor · Verb · Video · Timestamp.

User Charts

Chart Description
Activity Over Time Line graph of total statement volume per day
Activity Per User Bar chart of total interactions per user
At-Risk Students Horizontal bar chart of each user's completion rate, colour-coded by risk level (🔴 High / 🟡 Medium / 🟢 Low). A detailed table beneath shows attempted, completed, failed, terminated counts, and risk classification. A Send to Salesforce button forwards high-completion viewers (≥ 70%) as leads.
Engagement Level Per User Stacked bar chart breaking down each user's activity by verb type (initialized, played, paused, seeked, interacted, answered, terminated, completed, passed, failed)

Video Charts

Chart Description
Completion Rate per Video Horizontal bar chart showing the percentage of users who completed each video (green ≥ 70%, orange ≥ 40%, red < 40%). A Strict mode toggle counts only passed statements rather than completed + passed.
Video Interaction Heatmap Stacked bar chart per video showing where in the timeline users paused, seeked, played/resumed, or interacted. Checkboxes toggle each verb layer; a bucket-size selector controls the time resolution (10 / 30 / 60 seconds).

Salesforce Data

Clicking Retrieve all Leads calls the Salesforce REST API and returns all existing leads associated with your Salesforce account.


Other Settings

SCORM Cloud (LRS selector)

A dropdown in the tab bar lets you switch between connected LRS endpoints:

  • SCORM Cloud — production endpoint
  • SQL LRS (local) — local LRS for development
  • SCORM Cloud (Test) — isolated test endpoint, used automatically when isTest is toggled on

To add or remove an LRS option, edit the <div class="multi-select tab-lrs-selector"> block in index.html and add a corresponding config entry in the Lambda's LRS_CONFIGS object. Also make sure that a corresponding LRS is included inside the LRS_CONFIGS array.

isTest Toggle

Switches the active LRS to the test SCORM Cloud endpoint and loads test videos defined in the Lambda rather than real Hihaho videos. Use this to run the Flood Database tool (which generates synthetic statements for all student personas) without polluting your production data.

Login with Google

Authenticates via Google OAuth2 (PKCE flow). Once signed in, the player appends your email to the Hihaho embed URL so the video player recognises you automatically — no manual email prompt required. The button label changes to Logout (your@email.com) while a session is active.

Syncing

For convenience, use AWS IAM to sync Visual Studio Code with the s3 bucket, and run these commands to sync edits made to the files:

  • aws s3 sync ./ s3://{s3_BUCKET_NAME}
  • aws cloudfront create-invalidation --distribution-id {DISTRIBUTION_ID} --paths "/*"

By default all files in the current path directory will be synced to the s3 Bucket / Cloudfront. If files not meant to be uploaded are accidentally uploaded, go to the s3 bucket and manually delete it.

About

A prototype initialization of Hihaho xAPI to ensure it works.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages