Skip to content

Commit

Permalink
Merge pull request #8 from AutoResearch/7-add-option-to-approve-on-no…
Browse files Browse the repository at this point in the history
…-code

add approve no code
  • Loading branch information
younesStrittmatter authored May 20, 2024
2 parents f06f41c + 52b24f3 commit b220bb8
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 b220bb8

Please sign in to comment.