Adding reCAPTCHA before the experiment

PennController for IBEX Forums Support Adding reCAPTCHA before the experiment

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #11049
    metehanoguzz
    Participant

    Hi everyone, I am trying to prevent bot submissions to my study.

    Do you know if there is anyway of doing this like adding a reCAPTCHA at the beginning of the study? If you know any other ways of avoiding bots, I would be very happy to hear those.

    Best,
    Mete

    • This topic was modified 1 year, 7 months ago by metehanoguzz.
    #11145
    mtborneo
    Participant

    Hi, did you figure it out? I’m trying to do the same thing but I have no idea how

    • This reply was modified 1 month ago by mtborneo.
    #11147
    metehanoguzz
    Participant

    Hi!

    No, I could not figure it out. I used other measurements (RTs, attention check questions) to detect bots and remove them from the analyses.

    If you ever figure this out, could you please let me/us know here?

    #11148
    mtborneo
    Participant

    Hi! Thanks for replying! I wanted to avoid collecting those data and find a way of aborting the experiment if they fail the attention check, but as of right now I haven’t figured it out. I’ll let you know if I ever do lol

    #11154
    utkuturk
    Participant

    There are many ways to do it. You can either use “fake-captcha” or host your own pcibex and have a backend and api to do real captcha (overkill) or you can do mouse tracking.

    I use mouse tracking and tell participants sometimes they might be asked to check a box. Bot mouse movements and human mouse movements are different, pcibex already has support for mouse tracking.

    Fake catpcha:

    – Go to any captcha picture generator website. get couple of captcha images. put the image file names and answer text in a csv file and create a template trials like this:

    `
    Template(“captcha.csv”, row =>
    newTrial(“captcha”,
    newText(“title”, “Human Verification”).bold().print(),
    newText(“instruction”, “Type the characters you see in the image:”).print(),
    newImage(“captchaImg”, row.img).size(250, 80).print(),
    newTextInput(“captchaInput”).print(),
    newText(“error”, “Incorrect, please try again.”).color(“red”),
    newButton(“Submit”).print()
    .wait(
    getTextInput(“captchaInput”)
    .test.text(new RegExp(“^\\s*” + row.answer + “\\s*$”, “i”))
    .failure(
    getText(“error”).print(),
    getTextInput(“captchaInput”).clear()
    )
    )
    )
    )
    `

    Real captcha:

    – Or start hosting your own pcibex. add google/amazon script api to your page template ( <script src=”https://www.google.com/recaptcha/api.js&#8221; async defer></script>)
    – Then add trials like this to your pcibex code and then verify the tokens in your backend.

    `
    newTrial(“captcha”,
    newText(“instruction”, “Please complete the CAPTCHA to continue.”).print(),
    newHtml(“recaptchaWidget”,
    “<div class=’g-recaptcha’ data-sitekey=’YOUR_SITE_KEY’></div>”
    ).print(),
    newFunction(“checkCaptcha”, () => new Promise(resolve => {
    const interval = setInterval(() => {
    const response = grecaptcha.getResponse();
    if (response.length > 0) {
    clearInterval(interval);
    resolve();
    }
    }, 500);
    })).call().wait(),
    newButton(“Continue”).print().wait()
    )
    `

    Mouse tracking:

    – Add mouse trackers and a random checkbox to subset of your trials.
    – Track TrialN in your experiments

    `
    Header(
    newVar(“TrialN”, 0).global(),
    )
    .log(“trialN_header”, getVar(“TrialN”))
    `

    – When you create a template code for your filler or experimental trials, add an if statement like this and add mouse tracker start, randomcheckbox, and mouse tracker stop.

    `
    Template(“experiment.csv”, row =>
    newTrial(“exp”,
    getVar(“TrialN”).test.is(v => v % 20 === 0).success(
    newMouseTracker(“mouse”).log().start()
    ),

    // rest of your experiment code doing normal experiment stuff…

    // clear everything on the screen

    getVar(“TrialN”).test.is(v => v % 20 === 0).success(
    //some checkbox code
    ,
    getMouseTracker(“mouse”).stop()
    ),

    `

    #11162
    metehanoguzz
    Participant

    Hi Utku,

    This makes so much sense! Thank you so much for your response. I will probably add the “fake captcha” to my future studies.

    Best,
    Mete

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.