Packages

sealed trait TaskSpecification extends AnyRef

Specifies a kind of task to run on MTurk.

The code defining an individual task type will be here. An instance of this class will correspond to a single HIT Type ID, which is Mechanical Turk's way of categorizing HITs uploaded to the system. This specifies the method to convert from Prompts (as in, the type parameter seen all over this project) into XML strings that are POSTed to the MTurk API as questions shown to annotators. It also has a method for converting from annotator responses (also XML strings) into Responses.

To implement the actual logic & interface of a task, the work is done in the client-side code.

TaskSpecification is also responsible for holding HIT Type ID of its HIT Type.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TaskSpecification
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract type AjaxRequest <: AnyRef { type Response }
  2. abstract type Prompt
  3. abstract type Response
  4. abstract type WebsocketRequest
  5. abstract type WebsocketResponse

Abstract Value Members

  1. implicit abstract val ajaxRequestReader: upickle.default.Reader[AjaxRequest]
  2. implicit abstract val ajaxResponseWriter: ResponseWriter[AjaxRequest]
  3. abstract val ajaxService: Service[AjaxRequest]
  4. abstract val apiFlow: Flow[WebsocketRequest, WebsocketResponse, Any]
  5. implicit abstract val config: TaskConfig
  6. abstract val frozenHITTypeId: Option[String]
  7. abstract val hitType: HITType
  8. implicit abstract val promptWriter: upickle.default.Writer[Prompt]
  9. implicit abstract val responseReader: upickle.default.Reader[Response]
  10. abstract val samplePrompts: Vector[Prompt]
  11. abstract val taskKey: String
  12. abstract val taskPageBodyElements: List[TypedTag[String]]
  13. abstract val taskPageHeadElements: List[TypedTag[String]]
  14. implicit abstract val websocketRequestReader: upickle.default.Reader[WebsocketRequest]
  15. implicit abstract val websocketResponseWriter: upickle.default.Writer[WebsocketResponse]

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  6. final def createHIT(prompt: Prompt, numAssignments: Int, lifetime: Long = 2592000L): Try[HIT[Prompt]]

    Creates a HIT on MTurk.

    Creates a HIT on MTurk.

    If the HIT is successfully created, saves the HIT to disk and returns it. Otherwise returns a Failure with the error.

    Saving the HIT requires a serializer for it; for this reason, the method needs a upickle serializer for the Prompt type.

    prompt

    the data from which to generate the question for the HIT

    returns

    the created HIT, wrapped in a Try in case of error

  7. final def createTaskHTMLPage(prompt: Prompt, useHttps: Boolean): String
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. final def extractFeedback(answerXML: String): String

    Extracts the annotator's feedback from an answer XML string.

    Extracts the annotator's feedback from an answer XML string.

    The feedback field needs to be manually included in the form on the client in order for this to work. (Otherwise, this just returns the empty string.) Notes from the documentation for extractResponse apply here.

    answerXML

    the XML string received from the API

    returns

    the annotator's feedback

  11. final def extractResponse(answerXML: String): Response

    Extracts the annotator's response from an "answer" XML object retrieved from the MTurk API after the completion of an assignment.

    Extracts the annotator's response from an "answer" XML object retrieved from the MTurk API after the completion of an assignment.

    See http://docs.aws.amazon.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_QuestionAnswerDataArticle.html for a specification of the XML documents that may be received from the API as answers. There are helpful classes in the Java API for parsing this XML; see implementations of this method for examples.

    answerXML

    the XML string received from the API

    returns

    the well-typed data representation of an annotator response

  12. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. final lazy val hitTypeId: String

    The HIT Type ID for this task.

    The HIT Type ID for this task.

    When this is accessed with a certain set of parameters for the first time, a new HIT Type ID will be registered on Amazon's systems. Subsequent calls with the same parameters will always return this same value, for the life of the HIT Type (which I believe expires 30 days after the last time it is used. It may be 90 days. TODO check on that. But it doesn't really matter...)

    I'm not 100% sure this needs to be lazy... but it's not hurting anyone as it is.

  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. final def makeAssignment(hitId: String, mTurkAssignment: com.amazonaws.services.mturk.model.Assignment): Assignment[Response]

    Makes an Assignment data structure corresponding to a completed assignment on MTurk.

    Makes an Assignment data structure corresponding to a completed assignment on MTurk. Does not save it to disk since it hasn't been reviewed yet. TODO: this should create some sort of "reviewable assignment" instead, which perhaps can be saved immediately to avoid possible problems, and which will help ensure everything gets reviewed as appropriate.

  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  22. def toString(): String
    Definition Classes
    AnyRef → Any
  23. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped