Add a "TEST" message to survey landing page if in test mode #279
Replies: 10 comments 3 replies
|
Hi, so sorry you had this experience. We talked about this internally before, but ended up not doing this because setting I agree it's a problem though if in most cases people probably intend on running it with a db connection. Perhaps a different argument could be passed, like |
|
It's okay, it wasn't for a scientific study or anything, so not a disaster. But it was a very educational experiment lol. I think your proposal makes sense. The only thing I might suggest is perhaps instead of local = TRUE, something like show_banner = FALSE, so it's very clear that that argument merely toggles the warning banner. |
|
I've just pushed a change to a new branch where I replaced the Live deployment — connects to PostgreSQL (default): Preview/testing — saves to preview_data.csv, shows a red warning banner: Local/offline — saves to local_data.csv, no banner: I'm leaning towards this because
The new mode parameter makes intent explicit and is the single source of truth. There's no separate flag to forget — changing What happens in preview mode:
What happens in local mode:
Backward compatibility:
One open question: I'm also wondering whether Curious what you think? Tagging @pingfan-hu as well to ask his thoughts. |
|
After debating, I agree that we could introduce a new |
|
Fantastic. This all looks and sounds great. Thank you for making the change, and so quickly! |
|
I'm still going back and forth with a design setting on this. While it works functionally to add a survey-settings:
mode: previewThat way the mode will be stored in the _survey/settings.yml like all other settings, and the And also, if we do this, then I think we could just leave the function names alone since really nothing else is changing. |
|
Oooh, I actually like that so much better. When working on the survey, I spent a lot more time looking at |
|
BTW, let me know if you'd like me to create a PR updating the documentation to reflect this change. I don't think I can be very helpful when it comes to your codebase, but I would be happy to update the docs if it would save you some time. |
|
This is now fully implemented in v1.2.0. |


Uh oh!
There was an error while loading. Please reload this page.
Description
Hi,
Just a suggestion, I think it would be nice if there were a failsafe against doing what I just did, which is accidentally deploying my survey to hundreds of people, only to discover that I'd left ignore = TRUE in the sd_db_connect() call. I was making a quick edit to the survey locally and I told myself, "I'll remember to change it back", but of course I forgot.
I'm not sure what the right design for this would be in terms of implementation, but I think in terms of UX, I'm imagining a banner or big text box that says "this survey is in preview mode, your responses are not being recorded" while ignore = TRUE.
Thanks for considering it!
All reactions