/** * Get Contract Status by ContractID * * @param $contractId * @return int */ public function getStatus($contractID) { $contract = $this->contract->findContract($contractID); if ($contract->pdf_process_status == Contract::PROCESSING_COMPLETE and !$this->pages->exists($contractID)) { return Contract::PROCESSING_FAILED; } return $contract->pdf_process_status; }
/** * Text send to RC * * @param $contract_id * @return bool */ public function copyTextToRC($contract_id) { $tasks = $this->task->getAll($contract_id); foreach ($tasks as $task) { $this->page->saveText($contract_id, $task->page_no, $task->assignments->assignment->answer, false); } $contract = $this->contract->find($contract_id); $contract->mturk_status = Contract::MTURK_COMPLETE; $this->logger->info('Contract text updated from MTurk', ['Contract id' => $contract_id]); $this->logger->activity('mturk.log.sent_to_rc', null, $contract_id); return $contract->save(); }
/** * Full text search * @param $contract_id * @param Request $request * @return array */ public function search($contract_id, Request $request) { return response()->json($this->pages->fullTextSearch($contract_id, $request->input('q'))); }