Skip to content
This repository was archived by the owner on Jun 24, 2020. It is now read-only.

Analytics

Joe Torraca edited this page Dec 21, 2018 · 6 revisions

Analytics are the backbone of all the reporting and processing that Brainy Kids does. The analytics creation routes are below:

Hearatale Website

Route: /api/analytics/hearatale
Method: POST
Example request body:

    {
        "student": studentObject,
        "program": programObject,
        "focus_item": focusitemObject,
        "time_watching": 115, // Time in seconds spent watching 
        "total_video_time": 130 // Time in seconds of the duration of the video
    }

Example response body:

    {
        status: 'ok',
        analytic: analyticObject
    }

Application

Route: /api/analytics/application
Method: POST
Example request body:

    {
        student: "5c1c3e47adab54fbb7023df7",
        program: "5c1c3e55dc6557b9520fef24",
        focus_item: "5c1c3e5b2cd7cdda36e3fa57",
        correct_on: 2, // The number of times it took get the question correct
        time_spent: 65 // The time spent looking at the question
    }

Example response body:

    {
        status: 'success',
        analytic: analyticObject
    }

Most Recent

Notes: Returns the 10 most recent analytics recorded for the student. Route: /api/analytics/mostrecent
Method: POST
Example request body:

    {
        student: "5c047f1b7bd87fdb7e8efdb0",
    }

Example response body:

{
  "status": "ok",
  "analytics": [
    {
      "_id": "5c0483feda753edbd50d9e7a",
      "student": {
        "deleted": false,
        "_id": "5c047f1b7bd87fdb7e8efdb0",
        "student_id": "110",
        "teacher": "5c047d67aa4bc8db2980b138",
        "createdAt": "2018-12-03T00:55:55.885Z",
        "updatedAt": "2018-12-03T00:55:55.885Z",
        "__v": 0
      },
      "program": {
        "_id": "5c047ec0aa4bc8db2980b139",
        "name": "Brainy Phonics",
        "description": "Learning phonics allows children to decode and learn to read most words.",
        "type": "mobile game",
        "createdAt": "2018-12-03T00:54:24.789Z",
        "updatedAt": "2018-12-03T00:54:24.789Z",
        "__v": 0
      },
      "focus_item": {
        "_id": "5c04832fda753edbd50d9e60",
        "name": "Ape",
        "program": "5c047ec0aa4bc8db2980b139",
        "unit": "Alphabet",
        "sub_unit": "H",
        "createdAt": "2018-12-03T01:13:19.676Z",
        "updatedAt": "2018-12-03T01:13:19.676Z",
        "__v": 0
      },
      "correct_on": 3,
      "time_spent": 32,
      "createdAt": "2018-12-03T01:16:46.723Z",
      "updatedAt": "2018-12-03T01:16:46.723Z",
      "__v": 0
    }
  ]
}

Clone this wiki locally