Skip to content

Associate standalone survey submissions with their event so training feedback automatically tracks on the registrants roster (#2749) - #2768

Open
1steve78 wants to merge 1 commit into
rubyforgood:mainfrom
1steve78:pass-event-id-to-survey
Open

1steve78 wants to merge 1 commit into
rubyforgood:mainfrom
1steve78:pass-event-id-to-survey

Conversation

@1steve78

@1steve78 1steve78 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🤖 suggested review level: 3 Read 📖 event ID param handling and survey completion association

Allows staff to share standalone survey links with an event attached so respondent answers automatically associate with the training and count toward its survey completion columns.

Closes #2749

What is the goal of this PR and why is this important?

  • Survey completion columns on the registrants roster and onboarding tracker only counted submissions explicitly attached to an event.
  • Training surveys are often filled via standalone links (/f/:slug) outside ticket callouts, leaving those completions unassociated.
  • Adding validated event ID query parameter support (/f/:slug?event=42) lets standalone submissions count toward the correct event without heuristic date matching.

How did you approach the change?

  • Link generation: Added offered survey links to the Forms dropdown menu (_form_actions_menu.html.erb) and updated the form editor's "Live at" link to include ?event=<id> when an event is present.
  • Validation: Added EventSurveyCompletions.survey_allowed_for_event? to ensure only survey-role forms and events that offer or deliver that survey can be associated.
  • Persistence: Passed validated @event through PublicFormsController to PublicFormSubmission, persisting event_id and stamping scholarship survey readiness.
  • Submission flow: Preserved ?event=<id> across form submissions, error re-renders, and the thank-you return link.
  • Completions: Verified EventSurveyCompletions counts event-associated standalone submissions while ignoring other events and event-less submissions.

Anything else to add?

  • Regression test coverage added across requests, view partials, helpers, and services.

@1steve78
1steve78 marked this pull request as ready for review October 21, 2026 07:30
area: registration
display_status: admin_facing
released_on: 2026-10-21
pr_number: 2749

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be 2768, right?

Comment thread app/helpers/forms_helper.rb Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment should be updated or removed now?

@1steve78

Copy link
Copy Markdown
Contributor Author

Thanks for the review! I'll correct the pr_number to 2768, update the outdated comment in forms_helper.rb, and resolve the conflicts in public_forms_controller.rb and public_form_submission.rb. I'll rerun the relevant tests and push the fixes.

…feedback automatically tracks on the registrants roster (rubyforgood#2749)
@1steve78
1steve78 force-pushed the pass-event-id-to-survey branch from b25d651 to 3603ef2 Compare October 25, 2026 12:53
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.

Count standalone survey submissions toward an event's survey columns

2 participants