Skip to content

feat: Implement pre and post survey phases#124

Open
vnthanhdng wants to merge 2 commits intoChangePlusPlusVandy:mainfrom
vnthanhdng:main
Open

feat: Implement pre and post survey phases#124
vnthanhdng wants to merge 2 commits intoChangePlusPlusVandy:mainfrom
vnthanhdng:main

Conversation

@vnthanhdng
Copy link
Copy Markdown
Contributor

No description provided.

@vnthanhdng
Copy link
Copy Markdown
Contributor Author

Backend

  • added phase: "pre" | "post" (default "post").
  • createSurveyResponse now validates and stores phase; list/stats/export accept a phase filter; stats now group by phase and only count questions belonging to that phase; CSV exports include a Phase column.
  • added getSurveyPhasePresence helper; updateUserProgress and batchUpdateUserProgress now accept preSurveyComplete/postSurveyComplete, merge with existing flags so single-phase updates don't clobber the other, and auto-satisfy a phase if the survey has no questions for it. All three Progress init sites seed {webinar, preSurvey, postSurvey, certificate}.

Frontend

  • each question card has a Pre/Post select; new questions default to "post"; phase is sent when creating Question docs.
  • takes a phase prop, filters questions by phase, sends phase on submit, sends phase-aware progress flags (pre → preSurveyComplete; post → postSurveyComplete + webinarComplete, preserving the previous side-effect), shows phase-specific empty state and title.
  • split state into preSurveyCompleted / postSurveyCompleted (with legacy survey fallback for old progress docs), added a Pre-Survey tab before Workshop, renamed Survey → Post-Survey, both tabs reuse the same SurveyModal with a different phase prop.

note: existing Question/SurveyResponse/Progress docs default to "post" semantics, so already-completed courses continue to read as complete.

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