Skip to content

WIP: implements backend, frontend UX, and basic UI for community library#1706

Draft
GoldenLin9 wants to merge 4 commits into
ucfopen:dev/11.1.0from
GoldenLin9:feature/community-library-pr
Draft

WIP: implements backend, frontend UX, and basic UI for community library#1706
GoldenLin9 wants to merge 4 commits into
ucfopen:dev/11.1.0from
GoldenLin9:feature/community-library-pr

Conversation

@GoldenLin9
Copy link
Copy Markdown
Contributor

@GoldenLin9 GoldenLin9 commented Apr 15, 2026

Features

For all authenticated users

  • Browse a grid of published instances with infinite-scroll pagination
  • Filter by widget type, category (Math, Science, English, etc.), and course level (Intro / Intermediate / Advanced)
  • Search by instance name
  • Sort by Newest, Most Copied, Most Liked, or A–Z
  • Featured section highlights admin-selected content when no filters are active
  • Preview snapshots in the widget player without altering the original instance
  • Like / unlike entries (toggle)
  • Copy ("Use This") duplicates the snapshot into the user's My Widgets
  • Report entries with a reason (inappropriate / incorrect / spam / other) and optional details
  • Pull Latest from Library lets users who copied a widget overwrite their copy's name and questions with the latest snapshot (confirmation dialog, error handling for unpublished entries)

For instance owners

  • Publish to Library dialog in My Widgets with category and course-level selectors
  • Update in Library creates a new snapshot from the current qset without unpublishing
  • Remove from Library unpublishes cleanly (cascades snapshots, no orphan data)

For support / superusers

  • New Community Library tab in Instance Admin showing reported and banned entries
  • Moderation section on selected instance: toggle Featured, Ban/Unban, view report/copy/like counts
  • Auto-ban threshold: entries hitting 5 reports are auto-hidden with admin notification

Architecture

  • Snapshot-based: Publishing creates an immutable snapshot of the name and qset. Previews, copies, and pulls always use snapshots, never the live data
  • Copy: "Use This" duplicates with FK back to the source entry for pull-from-library
  • Scoring override: Snapshot preview score screens swap the qset in memory before scoring so the entire pipeline uses snapshot data

Testing

  • Run python manage.py test api.tests.test_community_library_views
  • Publish an instance → select category/course level → verify it appears in the library
  • Edit the original instance's qset → verify library preview still shows the old snapshot
  • "Update in Library" → verify new snapshot is served on preview
  • Unpublish → verify entry is removed from community library
  • Search, filter by widget/category/course level, and each sort option
  • Like / unlike → verify count updates and persists
  • Copy → verify new instance in My Widgets with snapshot name and qset, copy_count bumps
  • Copy → verify "Pull Latest from Library" button appears in action menu
  • Pull Latest → verify name and qset update to match latest snapshot
  • Unpublish source → verify "Pull Latest" button disappears on copied widget
  • Report same entry twice from one account → second attempt returns 400
  • Report 5 times from different users → entry auto-banned, admins notified
  • Instance Admin → Community Library tab → view reported/banned entries, toggle Featured, Ban/Unban

@FrenjaminBanklin FrenjaminBanklin marked this pull request as draft April 15, 2026 15:44
@GoldenLin9 GoldenLin9 force-pushed the feature/community-library-pr branch from 6cc8cca to eb859c4 Compare April 16, 2026 20:09
@clpetersonucf clpetersonucf changed the base branch from dev/11.0.1 to dev/11.1.0 May 12, 2026 15:36
@clpetersonucf clpetersonucf added the Feature This pull request includes a new feature. label May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature This pull request includes a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants