Skip to content
This repository has been archived by the owner on May 24, 2019. It is now read-only.

ChangeHITType

Thomas J. Leeper edited this page Nov 7, 2015 · 4 revisions

Modifying Live HITs

Sometimes it is necessary to modify a HIT or set of HITs after they have already been posted. Typical use cases are that a HIT is poorly described or there's simply a typo in the title or description, that the QualificationRequirements for the HIT were too lax or too restrictive, or the reward amount of the HIT was set incorrectly. It is possible to change these (and a few other) features of a HITType by connecting a currently live HIT to a new HITType. It is not possible, however, to change the actual contents of a HIT (e.g., the HTML form being shown to workers). If you're in a world where you HIT does not work, you need to expire it and start over (and the paying workers for unsubmittted HITs tutorial may be relevant to you).

The MTurkR documentation includes the following example, which we'll walk through in detail. First, imagine that we've created a HITType and associated HIT using the following code:

# create the HITType
hittype1 <- 
RegisterHITType(title = "10 Question Survey",
                description =
                  "Complete a 10-question survey about news coverage and your opinions",
                reward = ".20", 
                duration = seconds(hours=1), 
                keywords = "survey, questionnaire, politics")
# create a HIT of this HITType
a <- GenerateExternalQuestion("http://www.example.com/", "400")
hit <- CreateHIT(hit.type = hittype1$HITTypeId, 
                 assignments = 1,
                 expiration = seconds(days=1),
                 question = a$string)

The HITType (available as a character string in hittype1$HITTypeId[1] or hit$HITTypeId[1]) has several properties:

  • A title
  • A description
  • A reward
  • A duration
  • A set of keywords
  • An (empty) set of QualificationRequirements

These properties are then applied to any HIT that we create using this HITType and all of them are shown to workers on the MTurk website.

We can change any of these properties using the ChangeHITType() function from MTurkR. Note, however, that we cannot simply swap out the value of one these properties for a new value, instead we need to create a new HITType that has all of the properties we want and an updated value for the property we want to change.

One way to do the change is to simply create a new HITType that has all the same properties as the first one, but changes whichever feature(s) is/are incorrect. For example, if we want to change the reward amount, we simply create an otherwise identical HITType with a higher reward ($0.45 instead of $0.20):

hittype2 <- 
RegisterHITType(title = "10 Question Survey",
                description =
                  "Complete a 10-question survey about news coverage and your opinions",
                reward = ".45", 
                duration = seconds(hours=1), 
                keywords = "survey, questionnaire, politics")

To change the HITType of our HIT, we simply call ChangeHITType() by specifying the HITId of the HIT and the HITTypeId of the new HITType:

ChangeHITType(hit = hit$HITId,
              new.hit.type = hittype2$HITTypeId)

If you have the actual HITID and HITTypeId available (e.g., you didn't create the HITs in the current MTurkR session), you can just copy the values as character strings in lieu of the above:

ChangeHITType(hit = "A4NDU3N56HSD3ME91DN3",
              new.hit.type = "A93NEUWNEMWU3NNU2NDAOUICW8")

We can also skip the independent step of creating the new HITType and simply specify all the HITType properties in the call to ChangeHITType():

ChangeHITType(hit = hit$HITId,
              title = "10 Question Survey", 
              description =
                "Complete a 10-question survey about news coverage and your opinions", 
              reward = ".45", 
              duration = seconds(hours=1), 
              keywords = "survey, questionnaire, politics")

It is also possible to change the HITType for all HITs associated with a given HITType. Instead of specifying the HITId of a single HIT, we specify an old.hit.type value:

ChangeHITType(old.hit.type = hittype1$HITTypeId,
              new.hit.type = hittype2$HITTypeId)

This will use SearchHITs() to identify all current HITs associated with the old HITType and change them over to the new HITType. An old.annotation argument is also available that allows you to change the HITType of HITs according to their "RequesterAnnotation" field (e.g., with HITs created as "batches" in the Requester User Interface).

Note: if you do not know the HITType of the HIT you want to change, you can find it by using SearchHITs() to retrieve a data.frame of all HITs associated with your requester account.