Mysterious "code" showing up in results file

PennController for IBEX Forums Support Mysterious "code" showing up in results file

Tagged: ,

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #4323
    leaena
    Participant

    Hi Jeremy,

    Having run through a test run of an experiment my assistants are coding right now, I have found that the results file outputs a spooky mysterious column that looks encoded. The name that ibex gives to it is “code”, but there does not seem to be any particular source of this in the javascript. Is this a new PennController thing?

    Thanks!
    Leo

    #4324
    Jeremy
    Keymaster

    Hi Leo,

    If you are referring to a string of ~30 alphanumeric characters, it’s a confirmation code for validation on MTurk that is generated (and commented on) in the script I gave your assistants. I report the two lines generating it here:

    code = a => a?(a^Math.random()*16>>a/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,code)
    code = code()

    It is not a new PennController thing, I copied (and slightly adapted) it from https://stackoverflow.com/a/7061193

    Jeremy

    #4325
    leaena
    Participant

    Hi Jeremy,

    Thank you for getting back to me. Unfortunately we’re running into a problem. The “code” code seems to be working, as in it sends a value to the results file. However you call it in the “consent” chunk, which you redefined for them. However, when we try to include the “consent” or “metadata” chunks (two html forms which as far as we can tell are coded to run exactly the same way as the instructions, except they are forms that require input from participants), the experiment does not load. It loads with only the instructions active, but not consent or metadata. So I am not sure how the code is even ending up in the results file I had before in the first place, since the consent chunk was deactivated for that run.

    Thanks for any help!

    Leo

    #4326
    leaena
    Participant

    Actually – we may have fixed this. Apparently they had to come after the “set number correct” thing but they are displaying now. Thank you!

    Leo

    #4327
    Jeremy
    Keymaster

    Hi Leo,

    Glad to hear you’ve solved the problem.

    Re. the code variable: the two lines from my previous message are the ones generating the code, and they appear outside a PennController trial in the script I sent your assistants, which means they are immediately executed when your participants open the experiment. The call to a newFunction element in the “consent” chunk (which should be the very first screen your participants see) is just to make sure that the value of code is inaccessible from the javascript console upon runtime, so participants cannot simply type code in it to see their MTurk code and validate their submission early.
    As for how the value of code appears in your results file, it’s just standard uses of the .log command on the PennController trials for which to record it (all of them, in the script I sent).

    Let me know if you have any questions

    Jeremy

    #4328
    leaena
    Participant

    Hi Jeremy,

    How are we intended to be using the validation code? As it is, we can use it as a unique participant identifier (if I’m understanding it correctly) which we were doing before by the unique combinations of md5Hash and timeReceived. However I am curious to know what validation method you are using and how, since the posting method I am using right now is this: https://github.com/jhupsycholing/mturk-microbatcher which is an app written by Brian Leonard at U Rochester, that posts 9 at a time (for fee reasons) and does other things like exclude blacklists and duplicate IP addresses, but which unfortunately does not allow for individual participant code validation. I am not sure how I would use a unique identifier like that even if we were not using this batcher, though – we used to use randomly generated numbers. So I am interested to know what use this code is intended to be put to and how that works.

    Thanks for anything I can learn! Much appreciated.
    Leo

    #4329
    Jeremy
    Keymaster

    Hi again,

    I simply added the code thing because the script your assistants sent me had a placeholder for it but no actual algorithm to deal with it. You should of course feel free to use your own method, especially if it was specifically designed for MTurk.

    I have not used MTurk in a very long time now and have been using Prolific instead to recruit participants, which offers extensive screening options for researchers and does not charge a fee if you need to recruit more participants. What I do to keep track of participants is simply include id={{%PROLIFIC_PID%}} in my experiment’s URL on Prolific, and Prolific will automatically replace {{%PROLIFIC_PID%}} with a unique ID for that participant. Then in my experiment, I use .log as I mentioned in my previous message, in which I use PennController.GetURLParameter("id") to fetch the value of id from the URL. So in my projects, I usually do not generate a unique ID using javascript.
    Last thing I do is include a confirmation link to Prolific on the last screen of my experiment.

    When I was still using MTurk, I used the method I illustrated here: each participant is assigned a unique ID by the two lines from my message above, which gets recorded in their results file (again, using .log) and participants are invited to copy-paste the code on MTurk so I can then match the codes in my results files and those sent to MTurk by the participants and validate their submissions (or reject them if the code they entered on MTurk does not appear in my results file).

    The tutorial describes yet another method, which can also be used with MTurk, where participants are invited to type a unique ID on the first page of the experiment (e.g. their MTurk ID).

    Jeremy

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