Skip to content

Commit

Permalink
add approve no code
Browse files Browse the repository at this point in the history
  • Loading branch information
younesStrittmatter committed May 20, 2024
1 parent f06f41c commit 52b24f3
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/autora/experiment_runner/firebase_prolific/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
publish_study,
get_submissions_incompleted,
request_return_all
approve_all_no_code
)


Expand Down Expand Up @@ -55,6 +56,17 @@ def _firebase_prolific_run(conditions, **kwargs):
Returns:
observations
"""
if not 'exclude_studies' in kwargs:
exclude_studies = ["default"]
else:
exclude_studies = kwargs["exclude_studies"]

if not 'approve_no_code' in kwargs:
print('Warning: Approving submissions with no code. Set approve_no_code to False if no code submissions should be requested to return')
approve_no_code = True
else:
approve_no_code = kwargs['approve_no_code']


# set up study on firebase
send_conditions("autora", conditions, kwargs["firebase_credentials"])
Expand All @@ -68,6 +80,7 @@ def _firebase_prolific_run(conditions, **kwargs):
kwargs["prolific_token"],
total_available_places=len(conditions),
completion_code=kwargs["completion_code"]
exclude_studies=exclude_studies
)

# get the specification on prolific
Expand All @@ -83,7 +96,10 @@ def _firebase_prolific_run(conditions, **kwargs):
# check prolific
if prolific_dict:
if not counter % 5:
request_return_all(study_id, kwargs["prolific_token"])
if approve_no_code:
approve_all_no_code(study_id, kwargs["prolific_token"])
else:
request_return_all(study_id, kwargs["prolific_token"])
incomplete_submissions = get_submissions_incompleted(study_id,
kwargs["prolific_token"])
check_firebase = check_firebase_status(
Expand Down

0 comments on commit 52b24f3

Please sign in to comment.