Skip to content

Render the survey in-page so uh/variant are hidden - #2

Merged
dlai-jerry merged 1 commit into
mainfrom
jerry/in-page-survey
Nov 12, 2026
Merged

dlai-jerry merged 1 commit into
mainfrom
jerry/in-page-survey

Conversation

@dlai-jerry

Copy link
Copy Markdown

Google Forms has no hidden fields, so the embedded survey showed the prefilled uh / variant questions to learners (and let them edit them).

What

  • Results screen renders the survey itself from survey_questions in each assessment JSON (4 × 1–5 scales + 1 paragraph, same as the forms).
  • On submit, answers + uh / variant are POSTed (no-cors, form-urlencoded) to the form's formResponse endpoint, so responses still land in the same Form Responses tabs. Nothing changes for analysis.
  • At least one answer required; one response per attempt (a reload shows "Thanks for your feedback!"); network errors show a retry message.
  • Falls back to the existing iframe if survey_questions is absent.

Note

If a question is edited in the Google Form, update survey_questions in the matching JSON too (entry ids come from the form's prefilled link).

Test

  • npm test: 68 passed (new tests for question normalization, formResponse URL, body building, submit).
  • Live browser run (variant B): uh/variant not shown; response with all answers + uh=claude-survey-e2e, variant=B appeared in Form Responses 2.

🤖 Generated with Claude Code

Google Forms has no hidden fields, so the prefilled uh/variant questions
were visible and editable in the embedded form. The results screen now
renders the survey questions itself (survey_questions in the assessment
JSON) and posts them, plus uh/variant, to the form's formResponse
endpoint. Responses still land in the same Form Responses tabs. One
response per attempt; falls back to the iframe when no questions are set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dlai-jerry
dlai-jerry merged commit 6ccf941 into main Nov 12, 2026
1 check passed
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.

1 participant