Skip to content

Challangesย #2

@Eyepatch5263

Description

@Eyepatch5263

Challenge Feature Workflow

  1. Challenge Creation

Admin (or system) creates challenges.

Each challenge contains:

Picture (thumbnail or clue)

Description (text explaining the task)

Reward points (how much user earns if successful)

Submission type:

text (short answer, proof, link)

media (image/video upload)

Optionally: Campus-based (restricted to college events) or Remote-based (any user).

  1. Challenge Assignment

User spins the wheel (๐ŸŽก fun gamification element).

Wheel randomly selects 3 challenge options.

User chooses one challenge to attempt.

UI: Show 3 cards with challenge picture + description + โ€œAcceptโ€ button.

  1. Challenge Attempt & Submission

User accepts one challenge โ†’ redirected to submission form:

If text challenge โ†’ input field.

If media challenge โ†’ file upload (Cloudinary or S3 for storage).

After submit โ†’ result sent to a hidden admin route (not public).

Example: /admin/review-submissions

  1. Admin Review

Admin panel lists all submissions:

Challenge picture + description

Userโ€™s submission (text/media)

Buttons: โœ… Approve / โŒ Reject

On Approve:

User gets reward points added to leaderboard.

On Reject:

No points added.

Optionally notify user (โ€œChallenge not acceptedโ€).

  1. Leaderboard Integration

Challenge points add to the same leaderboard as game points (or a separate one if you want dual leaderboards).

Leaderboard displays Top 3 candidates globally or per event.

Realtime updates via Socket.IO or periodic polling.

๐Ÿ› ๏ธ Implementation Details
๐Ÿ“Œ Data Model (example in JSON)
{
"challengeId": "c123",
"title": "Campus Photo Hunt",
"description": "Take a picture of the library entrance.",
"imageUrl": "challenge_thumb.png",
"rewardPoints": 50,
"type": "media",
"scope": "campus"
}

๐Ÿ“Œ Submission Schema
{
"submissionId": "s789",
"challengeId": "c123",
"userId": "u456",
"submittedAt": "2025-09-12T18:30:00Z",
"answerText": "Hereโ€™s my proof...",
"answerMediaUrl": "uploads/user123/library.jpg",
"status": "pending" // can be pending, approved, rejected
}

๐Ÿ“Œ Spin the Wheel Logic

Implement a roulette spinner UI (CSS animation).

When it stops, backend randomly selects 3 unique challenges.

Return them to frontend:

{
"options": [
{"challengeId": "c101", "title": "Join coding contest"},
{"challengeId": "c102", "title": "Upload group photo"},
{"challengeId": "c103", "title": "Write a tech blog"}
]
}

๐Ÿ“Œ Admin Dashboard

/admin/review-submissions

Shows:

Pending submissions table.

Approve/Reject buttons.

Workflow:

On Approve โ†’ update status = approved, add rewardPoints to user score.

On Reject โ†’ status = rejected.

๐Ÿ“Œ Leaderboard

Table with:

Rank

Username

Total points

Real-time:

Emit leaderboardUpdate event whenever a challenge is approved.

Show Top 3 candidates in a highlighted card UI.

๐Ÿ”„ Full Flow Example

User clicks Spin the Wheel โ†’ gets 3 challenge options.

User picks one โ†’ sees challenge details + submission form.

User submits (text/media).

Submission โ†’ stored as pending.

Admin reviews:

โœ… Approves โ†’ +points โ†’ leaderboard updated.

โŒ Rejects โ†’ no points.

Leaderboard updates โ†’ top 3 visible to everyone.

โš™๏ธ Tech Recommendations

Frontend:

Flutter

Wheel: react-custom-roulette or custom CSS animation

File upload: Cloudinary widget

Backend:

Go

File storage: Cloudinary

DB: Postgres (to track challenges, submissions, leaderboard)

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions