WikiEducationFoundation / WikiEduDashboard

Wiki Education Foundation's Wikipedia course dashboard system
https://dashboard.wikiedu.org
MIT License
392 stars 630 forks source link

New Answers and AnswerGroups created even in preview mode #819

Closed ragesoss closed 8 years ago

ragesoss commented 8 years ago

Preview mode should not save any responses to the database.

jonathanhudak commented 8 years ago

What survey are you seeing this on?

ragesoss commented 8 years ago

Everywhere. I just replicated it on staging. I go through a survey in preview mode, and after I submit there are 6 new records in Rapidfire::AnswerGroup.

On production, there are recorded responses from 7 unique users, all Wiki Ed staff, and they are the ones who took it in preview mode.

Actually, I haven't confirmed that records get saved outside of preview mode. There are still no responses from the live survey.

ragesoss commented 8 years ago

Okay, confirmed that it seems to work fine via email.

jonathanhudak commented 8 years ago

With this simple survey no new AnswerGroups or Answers are created upon submitting in preview mode

https://dashboard-testing.wikiedu.org/surveys/2?preview

Are we sure these surveys are being taken with the preview url param?

ragesoss commented 8 years ago

Only happens if course chooser is enabled. I added a second question group, and still no new records, but then when I enabled course picker and did it again, two new ones.

jonathanhudak commented 8 years ago

Ah! Ok, hmm the url param isn't being passed then. Ok thanks that helps track down the cause.

jonathanhudak commented 8 years ago

@ragesoss found the cause. This commit should fix. I've confirmed locally.