Don't show results for anonymous surveys #19753
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When giving students surveys, we clearly state that their results will be anonymous and teachers will not be able to see them. We make sure to only show teachers aggregated results after they have responses from 5+ students. We also make sure that unlike other puzzle types, when the teacher navigates to that level we don't let them see the student's last attempt
Poorva recently realized however that teachers generally have access to their students passwords. This means they could log in as the student, and still see the last attempt (i.e. their answers). This PR makes it so that once a survey has been submitted, we won't show the previous responses anymore - even to the student who submitted them.
One remaining hole is that if you later unsubmit the survey (or unlock it in the case of a lockable level), the previously submitted answers will again be revealed. Avoiding this is difficult for the following reason: