Skip to content

Commit

Permalink
add approve all function on no code
Browse files Browse the repository at this point in the history
  • Loading branch information
younesStrittmatter committed May 20, 2024
1 parent f4b461f commit 840f26e
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 840f26e

Please sign in to comment.