Skip to content

Feature Request: Implement Percentile Rank Feedback System #358

@LuminousYuzu

Description

@LuminousYuzu

Objective:

Develop a system to provide users with their percentile rank based on a summary statistic from an experiment. This involves backend modifications and a new frontend component for visual feedback.

Requirements:

Backend Modifications:

  • tabulateAndPostResults Endpoint:
    • Modify to handle and pass the summary statistic.
    • Ensure it writes results to the database.
  • getFeedback Endpoint:
    • Consider creating a new endpoint to retrieve feedback without writing to the database.
    • Allow users to access their percentile rank using userID, experiment, and summary statistic.

Frontend Component:

  • Create a visual feedback component to display the percentile rank.
  • Use react-icons for iconography and ensure the design is engaging.

Integration with pushkin Packages:

  • Update pushkin-client, pushkin-api, and pushkin-worker to support the new functionality.
  • Implement database queries in pushkin-worker to calculate percentile ranks.

Implementation Steps:

1. Backend Development:

  • tabulateAndPostResults:
    • Modify to accept and process the summary statistic.
    • Ensure it updates the database with the necessary data.
  • getFeedback Endpoint:
    • Develop a new endpoint or modify existing logic to fetch percentile rank without database writes.
    • Implement logic to calculate percentile rank based on the summary statistic.

2. Frontend Development:

  • Create or update the ResultsPage component to display the percentile rank.
  • Use FaUser icons to visually represent the rank.
  • Implement dynamic highlighting based on the rank.

3. Integration and Testing:

  • Update pushkin-client to handle requests and responses for the new endpoints.
  • Ensure pushkin-api and pushkin-worker are updated to support the new logic.
  • Test the entire flow from data submission to feedback retrieval.

Acceptance Criteria:

  • Users can view their percentile rank based on the summary statistic.
  • The system accurately calculates and displays the rank.
  • The feature works seamlessly across the frontend and backend, including Docker environments.

Additional Considerations:

  • Ensure the system is scalable and can handle multiple experiments and users.
  • Consider security and privacy implications when handling user data.
  • Provide clear documentation for any new endpoints or modifications.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestexp templatesRelates to experiments templatessite templatesRelates to site templates

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions