2015-10-14 1 views
1
library("MTurkR") 
    credentials(c("EXAMPLEAWSKEY","EXAMPLEAWSSCERETKEY")) 
    AccountBalance() 
    #Fetching AccountBalance=$0.00 

    # First set qualifications 
    # ListQualificationTypes() to see different qual types 
    qualReqs = paste(

     # Set Location to US only 
     GenerateQualificationRequirement(
      "Location","==","US"), 

     sep="") 

    # Create new batch of hits: 
    newHIT = CreateHIT(

     # layoutid in sandbox: 
     hitlayoutid="EXAMPLEHITLAYOUTID", 
     sandbox=T, 
     annotation = "HET Experiment with Pre-Screen", 
     assignments = "1200", 
     title="Rate this hypothetical representative", 
     description="It's easy, just rate this 
      hypothetical representative on how well 
      she delivers funds to his district", 
     reward=".50", 
     duration=seconds(hours=4), 
     expiration=seconds(days=7), 
     keywords="survey, question, answers, research, 
       politics, opinion", 
     auto.approval.delay=seconds(days=15), 
     qual.reqs=qualReqs 
    ) 

    # Get HITId (record result below) 
    newHIT$HITId 

    HITStatus(hit="EXAMPLEHITID") 
    #not able to fetch HIT STATUS. 
    #I Can see HIT been Created in Worker Sandbox, But after submitting the by the worker I am not able to fetch anything. 

review = GetAssignments(hit="Example HITID", 
    status="Submitted", return.all=T) 

Je reçois l'erreur suivante:obtenir le statut de HIT tout en créant HIT en utilisant Mturkr Package en R

Error (AWS.MechanicalTurk.HITDoesNotExist): Hit 3IV1AEQ4DRV9ICWQ5F0YS4QBNVOJ85 does not exist. (1444808078544)

# Error in while (request$total > runningtotal) { : # missing value where TRUE/FALSE needed

Répondre

0

Celui-ci est assez simple, en fait, malgré le message d'erreur pas très instructif (seconde). Vous avez créé un HIT dans le sandbox mais vous essayez de vérifier son état sur le serveur live, où il n'existe pas.

Vous pouvez résoudre ce problème en transmettant un argument sandbox = TRUE (ou sandbox = FALSE) à chaque fonction et de le faire de manière cohérente sur l'ensemble de votre code. Une alternative plus facile est de spécifier une option globale:

options(MTurkR.sandbox = TRUE)

au début de votre code, vous pouvez basculer facilement sur et en dehors, au besoin.

+0

Merci pour votre aide. –