Skip to content

Add survey-assignment linking, group mentors, and analytics#623

Open
jon-bell wants to merge 3 commits intostagingfrom
claude/survey-assignment-grading-bggg1
Open

Add survey-assignment linking, group mentors, and analytics#623
jon-bell wants to merge 3 commits intostagingfrom
claude/survey-assignment-grading-bggg1

Conversation

@jon-bell
Copy link
Contributor

@jon-bell jon-bell commented Mar 1, 2026

Summary

This PR adds comprehensive survey management features including linking surveys to assignments, assigning mentors to student groups, and providing analytics views for survey responses across groups.

Key Changes

Survey-Assignment Linking

  • Added assignment_id and available_at columns to surveys table
  • Surveys can now be optionally linked to assignments, making them visible on submission pages
  • available_at field controls when surveys become visible to students
  • Updated RLS policies to respect available_at timestamp

Group Mentor Assignment

  • Added mentor_profile_id column to assignment_groups table
  • Instructors can now assign mentors to student groups via the groups management page
  • New bulk grading mode "by_group_mentors" automatically assigns submissions to their group's mentor
  • Includes validation for submissions without groups or mentors

Survey Analytics & Status Tracking

  • New SurveyAnalytics component displays statistical analysis of survey responses
  • Supports filtering by numeric questions (rating, nouislider, text types)
  • Shows statistics (mean, median, min, max, count) broken down by group and overall
  • New SurveyStatusBanner component displays survey completion status on assignment submission pages
  • Students can see pending, completed, or overdue survey status with quick links

Database Functions

  • get_survey_status_for_assignment(): Returns survey completion status for a student on a specific assignment
  • get_survey_responses_with_group_context(): Aggregates survey responses with group and mentor information for analytics

UI Enhancements

  • Survey creation/editing forms now include assignment linking and available_at date picker
  • Groups management page includes mentor assignment dropdown
  • Survey responses view integrates analytics component
  • Bulk grading interface supports new "Assign to group mentors" mode

Implementation Details

  • Proper RLS policies ensure only instructors/graders can access analytics
  • Mentor assignment respects existing grading conflict checks
  • Survey availability is controlled by both publication status and available_at timestamp
  • Group mentor assignments are preserved when copying groups between assignments

https://claude.ai/code/session_01C4xcTvQXMFsm7A3osxUwMF

- Link surveys to assignments via optional assignment_id FK on surveys table
- Add available_at field to surveys for controlling when they become visible
- Add mentor_profile_id to assignment_groups for TA mentor assignment
- Copy mentors when copying groups between assignments
- Show survey completion status banner on student submission pages
- Add survey analytics with quantitative comparison across groups
- Add "Assign to group mentors" mode in bulk review assignment
- Show linked assignment column in instructor surveys table
- Update RLS policy to enforce available_at visibility for students

https://claude.ai/code/session_01C4xcTvQXMFsm7A3osxUwMF
The hook was previously called inside a Controller render prop callback,
which violates the Rules of Hooks. Moved it to the component body.

https://claude.ai/code/session_01C4xcTvQXMFsm7A3osxUwMF
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 1, 2026

Warning

Rate limit exceeded

@jon-bell has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minutes and 10 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 14a4890 and e3d7b89.

📒 Files selected for processing (13)
  • app/course/[course_id]/assignments/[assignment_id]/submissions/layout.tsx
  • app/course/[course_id]/manage/assignments/[assignment_id]/groups/page.tsx
  • app/course/[course_id]/manage/assignments/[assignment_id]/reviews/bulk-assign/page.tsx
  • app/course/[course_id]/manage/surveys/SurveysTable.tsx
  • app/course/[course_id]/manage/surveys/[survey_id]/edit/page.tsx
  • app/course/[course_id]/manage/surveys/[survey_id]/responses/SurveyResponsesView.tsx
  • app/course/[course_id]/manage/surveys/new/form.tsx
  • app/course/[course_id]/manage/surveys/new/page.tsx
  • components/survey/SurveyAnalytics.tsx
  • components/ui/survey-status-banner.tsx
  • supabase/functions/assignment-group-copy-groups-from-assignment/index.ts
  • supabase/migrations/20260222000000_survey_assignment_grading.sql
  • utils/supabase/SupabaseTypes.d.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/survey-assignment-grading-bggg1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

2 participants