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

TODO: in updateDBWithHits default, properly screen hits against database/collection info #15

Open
ardila opened this issue Sep 30, 2014 · 4 comments

Comments

@ardila
Copy link
Member

ardila commented Sep 30, 2014

OK sorry for freaking out... something weird seems to have happened with updateDBWithHITS, as I called it and I got a bunch of AccepTimes from June. Not sure what happened yet.

@hahong
Copy link
Contributor

hahong commented Sep 30, 2014

Whoa, that was quite scary... let me know how it goes.

@ardila
Copy link
Member Author

ardila commented Sep 30, 2014

I don't understand how updateDBWithHits works currently. It seems that the default behavior was changed from getting hits according to the hitids attribute, to boto.mturk.connection.search_hits(). It seems like this should almost never work. Am I missing something?

@yamins81
Copy link
Contributor

Need to pass the list of hits. When not passed, this will get ALL the existing hits Amazon has stored for the our account. The advantage of using search_hits() is that it uses Amazon as a global store for the hits, as opposed to the local machine. However, this means we need to filter the hits to only take those destined for the collection of interest.

Thus, here is a todo: @hahong it might be a good idea if we added the destination database/collection for each hit to the data sent to Amazon by the task JS, and then cause the updateDBWithHits function to continue to use search_hits as a default (when list of hits is not passed), but automatically screen the hits against the desired database/collection.

@yamins81 yamins81 reopened this Sep 30, 2014
@yamins81 yamins81 changed the title Possible security breach TODO: in updateDBWithHits default, properly screen hits against database/collection info Sep 30, 2014
@hahong
Copy link
Contributor

hahong commented Oct 3, 2014

Commit b98ac93 should do this. It works as follows:

  • You set set_destination=True when creating an instance of Experiment. Of course, collection_name should be meaningful (not the default "TEST"). Optionally you can set mongo_dbname which has the default value of "mturk".
  • If set_destination is True, prepHTMLs() will replace var dstDB and var dstDB in the JS section in the html by using the standard search-and-replace mechanism.
  • There are multiple different ways to get these back in the response. In my implementation ("objectome_64objs_v2a/web/objectome_64objs_v2a.html"), there is a new field "Destination" with properties "DB" and "collection".
  • Rest is the same.

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