The problem

Recently, a number of students on khan Academy discovered a means to cheat through taking hints offline and also not having actually them counted towards their digital profile. Once going through exercises on khan Academy you answer the problems given come you and also receive feedback top top whether her answer to be correct or incorrect. If you gain stuck on a difficulty you are able to take hints and also have that trouble counted together incorrect. Examine out this exercise if you want to shot it yourself. The images below show the user obtaining a correct answer and also taking a note respectively.

You are watching: How to cheat in khan academy

*
.align-center width=”100.08f4f32d1c7b49be91940769544f9246738fa263bda282b485c2c255cc064ffb6”

*
.align-center width=”100.08f4f32d1c7b49be91940769544f9246738fa263bda282b485c2c255cc064ffb6”

The cheaters realized the if castle disconnected indigenous the internet, take it the hints, and reconnected, they would certainly still have actually a difficulty counted together correct. Acquisition offline clues worked this way because our servers expect a inquiry from the client when users take a note or prize a problem. If the individuals were disconnected native the net the server would never see the request and the inquiry was no stored almost everywhere on the client so it would certainly be lost.

How walk we solve this?

In bespeak to attend to the offline cheating, we decided to readjust how the client sends requests to the server. By utilizing the client’s regional storage, we might store failure requests to be retried when the user reconnected to the internet. This solution has actually the included benefit of remove the require for the client to be linked to the server all the time. Users through a spotty internet link would have actually a better experience because everything would work also if the internet reduced out for a short duration of time.

In our new architecture, anytime a user performs an activity a wire representing that activity is save on computer in a queue the is conserved to localstorage. When the queue is consumed, each action is mapped come a duty that implements the action. This approach allows us come have an ext control end what happens as soon as a inquiry is not received by the server. The brand-new queue retries any type of actions the fail and also implements a direct backoff role so as not to be constantly sending out requests when the user is not connected to the internet.

Below is picture that mirrors the old design (left) and also the brand-new architecture (right). If the old customer never received a response from the server the request would never be retried. In the brand-new architecture the inquiry is retried until it get the server and also we gain a response.

*
.align-center width=”100.08f4f32d1c7b49be91940769544f9246738fa263bda282b485c2c255cc064ffb6”

A nice an effect of this design is that it have the right to be generalised to work in various other parts of our system. Password that faces sending requests to the server deserve to be to update to usage this architecture and work an ext consistently even with a poor internet connection. Sustaining an offline mode also becomes a possibility since you deserve to just save all of the actions the user makes and also send them to the server in ~ a later on time when the user has reconnected come the internet.

The downside

One that the greatest downsides with this implementation is that with some editing of the user’s neighborhood storage, a note request have the right to be erased from the action queue. We made decision this was acceptable because that a pair of reasons. First, our typical classroom user is unlikely to know how to modify their local storage. Second, also if the user edit their regional storage, the is visually obvious to those in the exact same room that they room up come something. A teacher can quickly see students messing about with the chrome devtools and act accordingly.

See more: How Many Atoms Does Lead Have, How Many Atoms Are In A Gram Of Lead

Conclusion

A client based style makes because that a much better user experience because a spotty connection does not create a obstacle to utilizing our application. In our case, it also made it much harder to cheat on exercise problems and was a an excellent way to make server requests more reliable. Additionally, this architecture makes having an offline mode more feasible.