MTScoreAssignments: Function to score assignments and update a counter and...

Description Usage Arguments Value

View source: R/MTScoreAssignments.R

Description

This function fetches the count of assignments a worker has completed from MTurk, adds a counter for newly completed assignments, scores assignments, and posts the new counts and scores to the appropriate qualifications.

Usage

1
2
3
4
5
6
MTScoreAssignments(results = NULL, answers = NULL,
  howToScore = "relativeTotal", scoreQual = NULL, counterQual = NULL,
  updateQuals = FALSE, pointsPerHIT = 10000, pointsPerQ = 1,
  questionNames = NULL, scoreNAsAs = "wrong", NAValue = NULL,
  approve = FALSE, feedback = "Thank you.", outType = "sub",
  sandbox = TRUE, verbose = FALSE)

Arguments

results

A results object returned from MTurk.

answers

A data.frame or similar object with answers to questions in the results object. colnames of answers must match the colnames of responses in results. For results to be scored, it must have an annotation that matches the annotation in answers.

howToScore

String with a value of "runningTotal" or "relativeTotal" (default). If "relativeTotal", counterQual and pointsPerHIT need to be defined.

scoreQual

The qualification ID string that identifies the score qualification for this HIT.

counterQual

The qualification ID string that identifies the counter qualification for this HIT.

updateQuals

Logical for whether to update qualification values after scoring assignments.

pointsPerHIT

How many points each assignment is worth. Default is 10,000 because MTurk does not take decimal values. This is equivalent to percent with 2 decimal places.

pointsPerQ

A number or vector of numbers of length of answers. Default is 1. Value is passed to the MTScoreAnswers function

questionNames

Columns names of questions to be compared between results and answers. If the columns names differ between the results and answers, questionNames can take a data.frame with colnames of 'results' and 'answers'. The rows in this data frame will be used to map the columns of results to the columns in answers. Needed for call to MTScoreAnswers.

scoreNAsAs

How to score NAs; possible values:

  • "wrong" - NAs are interpreted as wrong answers

  • "right" - NAs are interpreted as right answers

  • "value" - NAs are overwritten with the value of NAValue

Needed for call to MTScoreAnswers.

NAValue

The value to replace NAs with. Needed for call to MTScoreAnswers.

approve

Logical. Whether to approve assignments after counting. This will return the results object, but with AssignmentStatus set to "ApprovedLocal". This prevents needing to refetch results to continue working with the results. Default is FALSE.

feedback

Text to send to the worker when approved. Default is "Thank you".

outType

Either set to "sub" or "full". If "sub", only the newly evaluated subset will be returned.

sandbox

Logical. Whether to use the sandbox (TRUE) or not; default is TRUE.

verbose

Logical. Whether to print additional messages or not.

Value

Returns the scored subset of the inputted results object appended with scores. If approve = TRUE, it will change the "AssignmentStatus" to "ApprovedLocal".


andrewbrownphd/MetaTurkR documentation built on Nov. 23, 2019, 4:17 p.m.