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
});
Currently, the system only provides the latest data for each student. However, historical data is already available in the
data/dailyfolder, 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
data/dailyExample 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: