Measuring text speed

I want to measure the typing speed of people in the php code of the hook that is triggered when someone makes a post, can this be done? I know i can do it in javascript using jquery, but I am not sure if i can do it in the php code. Need to do it that way for setting up a game rule that use the typing speed of the users to give them a badge or not.

  • Not sure what exactly you want to achieve. Time between display and submit of a form? Or the actual speed (keystroke/second)? I don't think that a plugin hook triggered when the post is submitted alone would help in any case, because you would also have to fetch the starting time and not only the end time. Maybe it would work to add a hidden input to the form with the value populated with time() and then again fetch the time in the action that processes the form input to be able to get the time difference. But a lot depends on what exactly you want to achieve in the first place.

  • Thank you, I think I've managed to calculate the typing speed and transfer it to the php engine by using a hidden input as you proposed, but the problem is that there are sometimes cases when the user makes a post and there is no wall, so i put the input in the page itself to assure that it will always be there. How can i extract an input with get_input() when this input is in a form that extends 'page/elements/html' view?

  • Solved by extending both views that are related to the case of my plugin, thanks for the help.