Skip to content

Add peer progress API endpoint#98

Open
SanjanaBottu wants to merge 3 commits intothoth-tech:Feature/Peers-Progressfrom
SanjanaBottu:peer-progress-api
Open

Add peer progress API endpoint#98
SanjanaBottu wants to merge 3 commits intothoth-tech:Feature/Peers-Progressfrom
SanjanaBottu:peer-progress-api

Conversation

@SanjanaBottu
Copy link
Copy Markdown

@SanjanaBottu SanjanaBottu commented May 6, 2026

Description

This PR adds a backend API endpoint for the Peer Progress feature.

Endpoint:

GET /api/peer_progress/:unit_id/:student_id

The endpoint calculates and returns a student’s progress within a selected unit, including:

  • student ID
  • unit ID
  • target grade
  • completed tasks
  • required tasks
  • progress percentage

This backend endpoint supports the matching doubtfire-web Peer Progress frontend PR.

Tested locally by running the Rails API server and opening the endpoint in the browser.

How Has This Been Tested?

Example test URL:
http://localhost:3000/api/peer_progress/1/25

Confirmed that the endpoint returns JSON data with the expected fields:

  • student_id
  • unit_id
  • target_grade
  • tasks_completed
  • tasks_required
  • progress_percentage

Also tested with a project that has task records to confirm the task counts and progress percentage are calculated correctly.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation if appropriate
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have created or extended unit tests to address my new additions
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

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.

1 participant