Skip to content

Add "Quizzes Taken (last 7 days)" 5th tile to dashboard summary row - #165

Merged
kristofer merged 2 commits into
mainfrom
copilot/add-quizzes-taken-tile
Jun 10, 2026
Merged

kristofer merged 2 commits into
mainfrom
copilot/add-quizzes-taken-tile

Conversation

Copilot AI commented Jun 10, 2026 •

Copy link
Copy Markdown

Adds a 5th summary tile — Quizzes Taken (last 7 days) — to the dashboard, placed in the center of the tile row. All tiles are resized and fonts reduced to accommodate the new layout. For admin users, the count reflects activity across all students.

Backend (api/quiz.go)

  • Computes quizzes_last_7_days in GetProgressHandler by filtering quizAttempts where StartTime is within the past 7 days (inclusive boundary via !Before())
  • Adds the field to the /progress JSON response
sevenDaysAgo := time.Now().AddDate(0, 0, -7)
for _, qa := range quizAttempts {
    if !qa.StartTime.Before(sevenDaysAgo) {
        quizzesLast7Days++
    }
}

Frontend (dashboard.html, dashboard.js)

  • Tile row changed from col-md-3 × 4 to col equal-width layout (row-cols-2 row-cols-md-5) to fit 5 tiles
  • Card title font reduced h5 → h6; data font reduced h2 → h3; padding tightened to p-2
  • New bg-secondary tile inserted at position 3 (middle); dashboard.js binds it to quizzes_last_7_days

Tests (api/handlers_test.go)

  • TestGetProgressHandlerQuizzesLast7Days: creates attempts at −3d, −6d, and −10d; asserts quizzes_last_7_days == 2 while total_quizzes == 3

Copilot AI linked an issue Jun 10, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add 'Quizzes Taken (in last 7 days)' tile to admin dashboard Add "Quizzes Taken (last 7 days)" 5th tile to dashboard summary row Jun 10, 2026
Copilot AI requested a review from kristofer June 10, 2026 16:26
@kristofer
kristofer marked this pull request as ready for review June 10, 2026 19:12
@kristofer
kristofer merged commit 0cab64f into main Jun 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

some changes in aggregate summaries

2 participants