cloudyr / MTurkR

R Client for the MTurk Requester API
https://cloud.r-project.org/package=MTurkR
91 stars 18 forks source link

CreateQualificationType error for .xml with multiple overview sections #117

Closed darrellpenta closed 5 years ago

darrellpenta commented 7 years ago

Thank you, @leeper. MTurkR and MTurkRGUI are amazing packages.

Wondered if you might have any insight on an issue when trying to create qualifications with more than one overview section. The function (as below) works when qtest = qualitifcationstest1.xml and qanswer = answerkey1.xml. It also handles additional questions and answers without any issues.

qual_test <- 
      MTurkR::CreateQualificationType(
      name = "MyTest",
      description = MyDesription,
      test = qtest,
      answerkey = qanswer,
      retry.delay = 1,
      test.duration = 600,
      status = "Active",
      keywords = qkeyword)

However, if I add <Overview><Text>Overview 2</Text></Overview> along with an additional group of questions, I get:

> Error in rbind.data.frame(Overview = list(ElementNumber = 1L, Element = "Overview",
   :numbers of columns of arguments do not match

There doesn't appear to be any trouble using the same file when creating a qualification manually through the MTurk CLI.

Not sure whether this was previously addressed https://github.com/cloudyr/MTurkR/issues/8, or what the status might be.

Package info: MTurkR 0.7.11 2017-01-18 MTurkRGUI 0.1.5 2017-01-18

System Info: R version 3.3.2 (2016-10-31) System x86_64, darwin13.4.0 (Mac Osx)

.

leeper commented 7 years ago

I've just sent a patch that I will get around this. Want to try reinstalling MTurkR from GitHub and trying again?

darrellpenta commented 7 years ago

Excellent! Thank you. I reinstalled from GitHub and this seems to have solved the issue. Can't express how much I appreciate your reply and your efforts in creating such a useful package.

leeper commented 7 years ago

Excellent.

darrellpenta commented 7 years ago

Hi, Thomas, So I've FINALLY managed to transition away from using the CLT and into the wonderful world of MTurkR. I had one question, not pressing, but thought I'd ask:

I'm using the BulkCreateFromHITLayout function to post hits from a layout I created in the AWI. It's working beautifully. The only concern (...again, not major) is that I get warnings:

In CreateHIT(hitlayoutid = hitlayoutid, hitlayoutparameters = >GenerateHITLayoutParameter(names = names(input), : HITType specified, HITType parameters (title, description, reward, duration) ignored 2: drop ignored

Of course, the function doesn't appear to work if the parameters are not already specified in the local environment. This is totally understandable.

I'm writing up a workflow document for my lab (which I'm happy to shared with you) and thought it would be good to explain about the warnings....

No rush... and again, thanks for this REMARKABLE effort.

leeper commented 7 years ago

@darrellpenta Can you show the exact code that is generating that warning?

darrellpenta commented 7 years ago

Hey @leeper

I've got an annotated R script (and everything else you'd need) to recreate the warnings. Please let me know if you didn't get the invite to the repository, and please let me know if there are any issues getting things to work.

leeper commented 7 years ago

@darrellpenta Thanks. These can be safely ignored. It's an unfortunate consequences of how I've setup the use of ..., passing values to both RegisterHITType() and CreateHIT() inside the BulkCreateFromHITLayout() function.

If you set verbose = FALSE, these will go away entirely per code here.

I'll put it on my todo list to stop the title, description, reward, and duration arguments from getting passed to CreateHIT() here, thus eliminating the warning.

darrellpenta commented 7 years ago

Thanks for the info, @leeper. In fact, I've been ignoring the warnings all along as the function works perfectly well!