MTurk completion code

PennController for IBEX Forums Requests MTurk completion code

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6828
    annebez1
    Participant

    If anyone has a canned script for assigning a completion code to participants who get all the way through an experiment, and if you would not mind sharing it with me, I’d be very grateful.
    Participants recruited via Amazon’s Mechanical Turk need to put in a unique code on the MTurk site to get their payments. I have done this in Qualtrics where it is set up to generate a random number between 1 and some large number (e.g., 9,999,999) for each participant who completes the task.

    #6832
    Jeremy
    Keymaster

    Hello,

    A simple enough solution is to use JavaScript to generate a unique completion code at the top of your script and print a Text element with that code in the last trial of the experiment. The general idea takes the following form in your project’s script:

    code = 'my unique completion code'
    
    Sequence( "intro" , randomize("trials") , SendResults() , "end" )
    
    newTrial("end",
      newText( code ).print()
      ,
      newButton().wait() // end = wait on this screen forever
    )
    
    code = undefined // make it harder to fetch the code by other means

    Here is a more elaborate illustration of this idea: https://farm.pcibex.net/r/BIHiHw/

    Jeremy

    #7103
    ekakoki
    Participant

    Hello,

    I’ve tried using this for my own experiment, but I couldn’t find a way to log the code. At first, I thought I could do this by simply writing this code:

    
    newText("display", "Your unique code is: " + Code).center().print()
    ,
    getText("display").log()
    

    But when I ctrl+F’ed the code that was shown on the screen when I took it, there were no matches in the results file. Is there a way to directly log the Code constant? Or better syntax in logging displays? Thank you!

    #7104
    Jeremy
    Keymaster

    Hello,

    You can use .log("code", code) on the closing parenthesis of newTrial()

    Jeremy

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