Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grant bonus for more than 100 people #14

Open
robertafreitaslemos opened this issue May 12, 2020 · 3 comments
Open

Grant bonus for more than 100 people #14

robertafreitaslemos opened this issue May 12, 2020 · 3 comments

Comments

@robertafreitaslemos
Copy link

Hi, Tyler.

I am trying to use GetAssinment and GrantBonus. The GetAssignment function returns only 100 assignments, event though my hit has more 1000. I saw that you closed a previous issue related to this. Do you have any updates?
Thank you.

@zengtima
Copy link

zengtima commented Nov 23, 2020

Is this resolved yet? The same issue has happened to me. I can't retrieve assignments more than 100 using GetAssignment

I tried to solve the problem by reading from the second or third page using GetAssignments(hit = hits, pagetoken = '2'), but the function doesn't seem to be sensitive to anything put in as pagetoken (2, "2", 3, "3", etc.)

I am using version 1.1.4

Thank you!

ps. There used to be a related post: #3. I wonder what solved the problem in that case.

@d-bohn
Copy link

d-bohn commented Aug 18, 2021

I am also having the issue of not being able to retrieve more than 100 assignments (#3).

Examining the source code for GetAssignments() it appears as though it should be looping through the pages using the NextToken parameter, yet when called it only returns 100 results. If I manually call pyMTurkR$Client$list_assignments_for_hit() and pass a page token to it, it will retrieve all of the results, so there must be an error on the R side of things. For example,

tmp1 <- pyMTurkR$Client$list_assignments_for_hit(HITId = hit_id,
                                                 MaxResults = 100L
                                                 )
tmp2 <- pyMTurkR$Client$list_assignments_for_hit(HITId = hit_id,
                                                 MaxResults = 100L,
                                                 NextToken = tmp1$NextToken
                                                 )
identical(tmp1, tmp2) # Returns false

works fine. But,

tmp3 <- GetAssignments(hit = hit_id)

only returns 100 results.

I am using the latest version of pyMturkR (1.1.14).

@d-bohn
Copy link

d-bohn commented Aug 18, 2021

I dug into the code a little bit becuase this was annoying me and I found the issue. The GetAssignments function breaks a for loop based on the number of results fetched. However, the results parameter can only be between 0-100, thus causing the function to only ever supply the first 100 cases. Here is a quick fix commenting out the lines (279, 284) that are causing the issue. When I have more time I can create a pull request (or if someone else gets to it before me, feel free!).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants