Jump to content

Typing Test


noirsith

Recommended Posts

I'm developing a typing test using php, and have figured out a way to check the speed but not accuracy.

 

All the info being typed by the person is stored into a table as a varchar but I don't know how I would go about parsing it to see how accurate it is compared to the actual file they were copying. Is there a way to do this or do I have to send each word into a table cell and compare it to what it should be? If so how would I go about doing that?

 

Thank you much!

Link to comment
https://forums.phpfreaks.com/topic/117179-typing-test/
Share on other sites

Matthew3, the strcmp() function is basically the same as $str1 == $str2, but it only uses the C locale.  Now, back on topic...I'd suggest the similar_text() function:

 

$str1 = "Lol";

$str2 = "Rofl";

$percent = (float) 0;

similar_text($str1, $str2, $percent);

echo $percent; //Will echo 57.1428571429

Link to comment
https://forums.phpfreaks.com/topic/117179-typing-test/#findComment-602741
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.