Conversation
…e forms, and database
…x_responses, and pausing if needed (stub/WIP); check/pause study whenever a complete response is received
…d when the study is external
…_responses input box, and clear max_responses value if checkbox is unchecked
…None: does not work in clean because django does not update a field that was not there in original POST, so it needs to be added in save method
… progress bar with other study details
…hat its optional), move to bottom of form after ppt criteria
|
Only comment is on handling the "too many respondents" cases - when we get extra people sneaking in the door, OR I guess if someone sets a max response level to under the current # of responses. Thoughts:
|
Yes, sounds great. I'll write up a draft of this in the docs so that I have a link to work with.
Agree, I'll think about it. Would a different color be too much? And/or I could update the text underneath the progress bar to "Response limit exceeded".
I wasn't planning on automatically re-starting the study - just automatically pausing. If the study is paused and then drops below the response limit because the researcher has un-validated some responses, then we could show a banner message at the top of the page (e.g. "The valid response count is below the limit for this study. Re-start the study if you want to collect more responses."). But I don't think we should automatically re-start the study for data collection without some kind of action by the researcher. In the opposite case - if the study reaches the limit because the researcher marks some previously invalid responses as valid - then this WILL automatically pause the study, with a banner message at the top of the page (e.g. "Your study has reached the valid response limit and has been paused. If you want to collect more responses, increase the limit for this study, and then re-start it."). Let me know if this sounds ok to you and if you have suggestions for wording. And we should definitely walk through these user stories to make sure everything feels clear and predictable. |
|
Oh and the two scenarios above would occur on the Individual Responses page, when the researcher is changing the valid/invalid status of any responses. But I think the exact same things should happen on the Study Edit page if the researcher changes the 'max responses' value to be higher/lower than the current valid response count. |
…response limit reached/exceeded text, add msg that study has been paused
|
|
@mekline I just made the following changes to this PR - can you let me know what you think?
The other things discussed above (related to automatic pausing behavior) are going in the next PR. |








Addresses part of #1829 but should not close the issue.
This PR does the following:
Changes to Study model:
max_responsesfield. Default is None.valid_response_count. If the study type is internal, valid responses must be (1) not a preview, (2) eligible, and (3) completed exit frame. If the study type is external then the completed field is ignored.has_reached_max_responses. This returnsTrueif the valid response count has reached/exceeded the limit, otherwise it returnsFalse. If the study does not have are response limit, then this returnsFalse.check_and_pause_if_at_max_responsesto the Study model, which is called when a response object is saved/updated and the response is completed.Changes to Study create/edit form - see screenshots below:
max_responsesfield to the study create/edit form. This field is disabled by default, and becomes enabled if the "Set a response limit" checkbox is checked. Default is None.Adds tests for the new Study model properties
valid_response_countandhas_reached_max_responses.To do (in separate PRs):
check_and_pause_if_at_max_responsesmethod.check_and_pause_if_at_max_responseswhen the response is first created.Screenshots for UI updates
"Set a response limit" checkbox (default: unchecked) and "Maximum responses" text box (default: none) on study create/edit pages, below the participant eligibility criteria section.
Valid response counts, response limits, and progress bars on the study details page.