public static function fromSimpleXML($xml) { $returnval = new MechanicalTurkHit(); $my_xml = $xml->Question; $xml = simplexml_load_string($my_xml); $returnval->setDescription("" . $xml->Overview->Text); return $returnval; }
public function GetHIT($hit_id) { $params = array('HITId' => urlencode($hit_id)); $request = new MechanicalTurkRequest("GetHIT", $params, $this->options['sandbox']); $res = $request->go(); if ($res->OperationRequest->Errors) { $this->print_errors($res->OperationRequest->Errors->Error); return false; } else { return MechanicalTurkHit::fromSimpleXml($res->HIT); } }