Author Topic: Human Verification  (Read 10404 times)

SmartBoy16

  • Contributor
  • Fanatic
  • **
  • Posts: 587
  • Looking for inspiration.....
    • View Profile
    • Email
Re: Human Verification
« Reply #15 on: 2010-08-10, 01:20:09 AM »
Can I see the source of that durnurd?

Right Click -> View Source
Looking to the skies.....

Jam0864

  • Contributor
  • Fanatic
  • **
  • Posts: 744
    • MSN Messenger - marmalade0864@hotmail.com
    • View Profile
    • Jam0864's Content Dump
    • Email
Re: Human Verification
« Reply #16 on: 2010-08-10, 03:32:30 AM »
Can I see the source of that durnurd?

Right Click -> View Source
It's PHP, it doesn't work like that. It's executed server-side and HTML is sent to the browser.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Human Verification
« Reply #17 on: 2010-08-10, 05:26:13 AM »
Given a set of 5 options and 3 sets, that's a total of only 5^3 or 125 different values to choose randomly from.

You have to keep in mind how much work the user is doing versus how likely it is that a random guesser could get this right.  I'm still not sure I understand your scheme, but it seems to me like you still have basically the same ratio between user work to probability of random correctness.  Ideally my version of the test would be presented on 1 page where you have to select 3 correct answers and *then* submit everything at once rather than go through 3 separate trials.  But each answer is still a separate question that the user has to think about.  Does your solution provide the user with the opportunity to think about fewer images (and/or fewer words to match) while providing a lower chance of correct random guessing?

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: Human Verification
« Reply #18 on: 2010-08-10, 01:53:35 PM »
Fewer images to look at, yes.  There would be only 6 images instead of 15 or 20 (assuming 6 images for the matching, 5 images for each of 3 or 4 groups for your method).  Less of a random correct guess, yes.  The number of incorrect answers is much larger for matching vs. your method (719 vs 624).  Fewer words to deal with, yes, since there's only 6 words instead of 15 or 20 options to choose 3 or 4 from.
Edward Dassmesser

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: Human Verification
« Reply #19 on: 2010-08-10, 01:55:55 PM »
I make no claims about the code's prettiness.
Code: [Select]
<?php

$checkMode 
false;
$nextSeed rand();
if (isset(
$_GET['seed']) && isset($_GET['value'])) {
        
$seed $_GET['seed'];
        
$checkMode true;
} else {
        
$seed $nextSeed;
}

?>

<html>
<head>
<script language="javascript">
function validate(value) {
        location.href = "<?= $_SERVER['PHP_SELF'] ?>?seed=<?= $nextSeed ?>&value=" + value.innerHTML;
}
</script>
</head>
<body>
<?php

function base64EncodeImage($url) {
        
$imageData file_get_contents($url);
        return 
base64_encode($imageData);
}

function 
getWords(&$searchTerm) {
        
$words file('words.txt');
        
$indices array_rand($words,5);
        
shuffle($indices);
        
$searchTerms = array();
        foreach (
$indices as $idx) {
                
$searchTerms[] = $words[$idx];
        }
        
$searchTerm $searchTerms[array_rand($searchTerms)];
        return 
$searchTerms;
}
srand($seed);
$searchTerms getWords($realTerm);

if (
$checkMode) {
        if (
trim($realTerm) == $_GET['value']) {
                echo 
'Correct<br>';
        } else {
                die 
'Incorrect';
        }
        
srand($nextSeed);
        
$searchTerms getWords($realTerm);
}
$contents file_get_contents('http://images.google.com/images?q=' $realTerm);
preg_match_all('/"(http[^"]*gstatic[^"]*)"/s',$contents,$arr);
$arr array_slice($arr[1],0,10);  //Only use the first 10 results
$indices array_rand($arr,4);  //Pick 4 random images from the first 10

foreach ($indices as $idx) {
        
$imageData base64EncodeImage($arr[$idx]);
        echo 
"<img src=\"data:image/png;base64,$imageData\">\n"//Display the image as a base-64-encoded image so the filename isn't shown
}
?>

<br>
<select onchange="validate(this.options[this.selectedIndex])">
<option selected>--Choose One--</option>
<?php foreach ($searchTerms as $term) { ?>
<option><?= $term ?></option>
<?php ?>
</select>
</body>
Edward Dassmesser

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Human Verification
« Reply #20 on: 2010-08-10, 07:44:21 PM »
Fewer images to look at, yes.  There would be only 6 images instead of 15 or 20 (assuming 6 images for the matching, 5 images for each of 3 or 4 groups for your method).  Less of a random correct guess, yes.  The number of incorrect answers is much larger for matching vs. your method (719 vs 624).  Fewer words to deal with, yes, since there's only 6 words instead of 15 or 20 options to choose 3 or 4 from.

I'm still not seeing it -- how hard would it be for you to try to make a demo of your version?

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: Human Verification
« Reply #21 on: 2010-08-11, 08:06:39 AM »
Have you ever taken a quiz where there was matching involved?  Like a list of words on one side with blanks, and a list of definitions on the other side with letters, and you had to fill in the blanks with the letter for the correct definition of the word.  That's what I'm talking about, except with images and nouns instead of words and definitions.
Edward Dassmesser

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Human Verification
« Reply #22 on: 2010-08-11, 01:15:43 PM »
Well, in a sense, you have to look at more images for your test than mine because the only reason I am picking 3 images is because often times Google images' first result does not give a good picture of a specific term.  If you are only picking one image per word, sure, your chances might be a *little* bit better with your test that you can rule out all the other words using the other images and figure out an ambiguous image, but I think you eliminate a lot more ambiguity by showing 3 images per word.  The chances of getting 2 words whose images look completely unrelated to the words is relatively high in your test, I fear.  Also, that process of elimination can be significantly more taxing on the user.  Easier to have more clues.  When I think about it, looking at images is much quicker than picking a word from a list, too, so it seems easier to select 1 of 6 words 3 times that to select 1 of 6 words 5 times (and let the remaining word be the only choice).  Technically you're not selecting 1 of 6 words each time, but in a sense you are because you still want to consider every word for every image in case you didn't pick the best match in an earlier choice.  If we were to make the user pick from a completely separate list for each image clue (or trio of image clues), I think it would be about the same amount of effort on the user's part, but provide significantly more security in eliminating random success: 6^5 = 7776.