Skip to content

Commit

Permalink
Merge pull request #17 from AutoResearch/16-add-option-on-dealing-wit…
Browse files Browse the repository at this point in the history
…h-no-code

add approve all function on no code
  • Loading branch information
younesStrittmatter authored May 20, 2024
2 parents f4b461f + 840f26e commit 2d8eb10
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,24 @@ def _request_return(id: str, prolific_token: str):
_json=data,
)

def _approve(id: str, prolific_token: str):
__save_post(
f'https://api.prolific.com/api/v1/submissions/{sub["id"]}/transition/',
headers={"Authorization": f"Token {prolific_token}"},
_json={"action": "APPROVE"}
)


def request_return_all(study_id: str, prolific_token: str):
submissions = _get_submissions_no_code_not_returned(study_id, prolific_token)
for id in submissions:
_request_return(id, prolific_token)

def approve_all_no_code(study_id: str, prolific_token: str):
subissions = _get_submissions_no_code_not_returned(study_id, prolific_token)
for id in submissions:
_approve(id, prolif)


def _update_study(study_id: str, prolific_token: str, **kwargs) -> bool:
"""
Expand Down

0 comments on commit 2d8eb10

Please sign in to comment.