Skip to content

Add API endpoint for student historical data #7

@jagdish-15

Description

@jagdish-15

Currently, the system only provides the latest data for each student. However, historical data is already available in the data/daily folder, where each file contains a day's data for all students.

There is no API to fetch a single student's data across multiple days.

Expected Behavior

Create a new API endpoint that returns historical data for a specific student.

Requirements

  • Read all files from data/daily
  • Extract data for a given student across all dates
  • Return structured time-series data

Example Response

{
  "username": "student1",
  "history": [
    { "date": "2026-01-01", "easy": 2, "medium": 1, "hard": 0 },
    { "date": "2026-01-02", "easy": 3, "medium": 2, "hard": 1 }
  ]
}

Implementation Hint

The endpoint should follow the existing Express structure in server.js, for example:

app.get("/api/student/:username", (req, res) => {
  const { username } = req.params;

  // process data and return response
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    BackendTask mainly involving backendDifficulty: HardIndicates the difficultyenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions