Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Survey features #72

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Add Survey features #72

wants to merge 12 commits into from

Conversation

evanhadfield
Copy link
Collaborator

Add Poll Advanced Options and Anonymous Participant Tracking

Description

This PR enhances polls with configurable participation rules and anonymous tracking:

Key Features

  1. Advanced Poll Options:
    • Configurable vote/submission limits per participant
    • Minimum vote threshold before allowing submissions
    • Custom completion messages
    • Optimized statement ordering (least voted first)
image image
  1. Anonymous Participant Tracking:
    • Track individual participation via PARTICIPANT_ID URL parameter
    • Persist participant progress across sessions

Implementation Details

  • Feature flag: advancedOptionsEnabled in CommunityModel
  • New nullable columns in Poll table
  • Optimized statement sorting algorithm
  • Anonymous ID persistence via URL parameters

Testing Checklist

Critical Paths

  • Create poll with advanced options
  • Vote/submit with maxVotesPerParticipant limit
  • Submit statement after meeting minVotesBeforeSubmission
  • Verify completion message shows after meeting all requirements
  • Confirm participant progress persists with same PARTICIPANT_ID

Edge Cases

  • Refresh page mid-poll
  • Try to exceed submission/vote limits
  • Test with missing/invalid PARTICIPANT_ID

Database Changes

# Deploy migration
npm run db:migrate:prod

# Verify deployment
npm run db:status:prod

Rollback

If needed:

  1. Revert migration (see SQL in PR comments)
  2. Deploy reversion commit

Copy link

vercel bot commented Dec 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
osccai-web ❌ Failed (Inspect) Dec 23, 2024 9:02pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
osccai-consensus-service ⬜️ Skipped (Inspect) Dec 23, 2024 9:02pm

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