Skip to content

Commit

Permalink
WIP Answers method
Browse files Browse the repository at this point in the history
  • Loading branch information
mchev committed Jul 29, 2021
1 parent 0acd4b8 commit 1abdb3f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ $form = OdkCentral::projects($projectId)->forms($xmlFormId)->update([
'state' => 'open'
]);

// Getting form answers
$answers = OdkCentral::projects($projectId)->forms($xmlFormId)->answers()->get();

// Deleting a form
$form = OdkCentral::projects($projectId)->forms($xmlFormId)->delete();

Expand Down
22 changes: 22 additions & 0 deletions src/OdkCentral.php
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,28 @@ public function data($table)

}

/**
* Getting forms answers.
* TODO : documentation
*
* @param int $top
* @param int $skip
* @param boolean $count
* @param boolean $wkt
* @return $this
*/
public function answers($top = 250, $skip = 0, $count = true, $wkt = true)
{

$this->headers = [
'Content-Type' => 'application/json',
];

$this->endpoint .= '.svc/Submissions?$top=' . $top . '&$skip=' . $skip . '&$count=' . $count . '&$wkt=' . $wkt;

return $this;

}

/**
* Create a new get request.
Expand Down

0 comments on commit 1abdb3f

Please sign in to comment.