mumuki / mumuki-laboratory

:microscope: Where students practice and receive automated and human feedback

Home Page:http://mumuki.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Solution submission should be disabled while switching exercises

julian-berbel opened this issue · comments

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!