Discourse Surveys

I wish there was a setting to determine whether users can submit survey forms anonymously

FEATURE: Allow anonymous survey submissions gated by `surveys_allow_anonymous_submissions` by singi2016cn · Pull Request #109 · discourse/discourse-surveys

Previously, only logged-in users could submit survey responses, since SurveyController enforced ensure_logged_in and survey_responses.user_id was NOT NULL.

This change adds the surveys_allow_anonymous_submissions site setting so signed-out visitors can respond using a per-browser localStorage token for de-duplication, and includes anonymous respondents in admin response counts and CSV exports.

Commits (17 files, +651/−74)

  • Feature: Site setting + migration (user_id nullable, anon_token, partial unique index) + backend anonymous path + IP rate limiting + frontend login block removal and token management
  • Fixes: CSV export missing anonymous replies, admin panel counts omitting them, missing survey.no_survey_with_this_name
  • i18n: 26 keys fully aligned for en + zh_CN
  • Docs: README fixed 5 contradictory descriptions, added Anonymous Responses section
  • Tests: 125 cases passing (lib 26 / requests 38 / system 61)