Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution submission should be disabled while switching exercises #1716

Open
julian-berbel opened this issue Nov 3, 2021 · 0 comments
Open

Comments

@julian-berbel
Copy link
Member

julian-berbel commented Nov 3, 2021

Yesterday we ran into a weird behavior where a user opened up a discussion on a confirmation type exercise with a wrong solution.

How could this be? confirmation exercises only require the user to press a button.

Well, upon inspecting the assignment, while the solution field should have been empty, it instead had a solution for the following exercise in the same guide.

It's not 100% certain how they ran into this problem, but I did figure out a way to reliably reproduce this behavior.
By opening dev tools and setting up network throttling to an excruciatingly slow connection, it is pretty easy to press on another exercise's box on the guide listing and while the current exercise's form has not yet disappeared, submit a solution.

The browser url will change immediately after pressing the exercise box, and since the form for the old exercise is not gone yet, pressing the submit button will cause the solution to "be sent to the wrong exercise".

We could prevent this by disabling submitting a solution while switching exercises, or I guess grabbing the current exercise from a hidden input in the form when building the submit url instead of using the current window location could work too!

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

No branches or pull requests

1 participant