Recruiters

class psynet.recruiters.BaseCapRecruiter[source]

Bases: PsyNetRecruiterMixin, CLIRecruiter

The CapRecruiter base class

close_recruitment()[source]

Talk about closing recruitment.

notify_duration_exceeded(participants, reference_time)[source]

The participant has been working longer than the time defined in the “duration” config value.

open_recruitment(n=1)[source]

Return an empty list which otherwise would be a list of recruitment URLs.

recruit(n=1)[source]

Incremental recruitment isn’t implemented for now, so we return an empty list.

reward_bonus(participant, amount, reason)[source]

Return values for basePay and bonus to cap-recruiter application.

class psynet.recruiters.BaseLucidRecruiter(*args, **kwargs)[source]

Bases: PsyNetRecruiterMixin, CLIRecruiter

close_recruitment()[source]

Lucid automatically ends recruitment when the number of completes has reached the target.

current_survey_number()[source]

Return the survey number associated with the active experiment ID if any such survey exists.

current_survey_sid()[source]

Return the survey SID associated with the active experiment ID if any such survey exists.

exit_response(experiment, participant)[source]

Delegate to the experiment for possible values to show to the participant and complete the survey.

get_status()[source]

Return the status of the recruiter as a dictionary.

property in_progress

Does a Lucid survey for the current experiment ID already exist?

market_place_codes = {-6: 'Sent to Marketplace Intermediate', -5: 'Sent to External Intermediate', -1: 'Error', 1: 'In Screener', 3: 'In Client Survey', 21: 'Industry Lockout', 23: 'Standard Qualification', 24: 'Custom Qualification', 30: 'Quality Term: Unique IP', 31: 'Quality Term: RelevantID Duplicate', 32: 'Quality Term: Invalid Traffic', 35: 'Quality Term: Supplier PID Duplicate', 36: 'Quality Term: Cookie Duplicate', 37: 'Quality Term: GEO IP Mismatch', 38: 'Quality Term: RelevantID** Fraud Profile', 40: 'Overquota: Quota Full', 41: 'Overquota: Supplier Allocation', 42: 'Overquota: Survey Closed for Entry', 50: 'Financial Term: CPI Below Supplier’s Rate Card', 98: 'Exit: End of Router', 120: 'Pre-Client Survey Opt Out', 122: 'Return to Marketplace Opt Out', 123: 'Max Client Survey Entries', 124: 'Max Time in Router', 125: 'Max Time in Router Warning Opt Out', 126: 'Max Answer Limit', 131: 'Quality Term: Supplier Encryption Failure', 132: 'Quality Term: Blocked PID', 133: 'Quality Term: Blocked IP', 134: 'Quality Term: Max Completes per Day Terminate', 138: 'Quality Term: Survey Group Cookie Duplicate', 139: 'Quality Term: Survey Group Supplier PID Duplicate', 230: 'Quality Term: Survey Group Unique IP', 234: 'OFAC Term: Blocked Country IP', 236: 'Privacy Term: No Privacy Consent', 237: 'Privacy Term: Minimum Age', 238: 'Quality Term: Found on Deny List', 240: 'Quality Term: Invalid Browser', 241: 'Quality Term: Respondent Threshold Limit', 242: 'Quality Term: Respondent Quality Score', 243: 'Quality Term: Marketplace Signature Check'}

The LucidRecruiter base class

normalize_entry_information(entry_information)[source]

Accepts data from the recruited user and returns data needed to validate, create or load a Dallinger Participant.

See create_participant() for details.

The default implementation extracts hit_id, assignment_id, and worker_id values directly from entry_information.

This implementation extracts the RID from entry_information and assigns the value to hit_id, assignment_id, and worker_id.

notify_duration_exceeded(participants, reference_time)[source]

The participant has been working longer than the time defined in the “duration” config value.

open_recruitment(n=1)[source]

Open a connection to Lucid and create a survey.

recruit(n=1)[source]

Incremental recruitment isn’t implemented for now, so we return an empty list.

alias of LucidConsentPage

reward_bonus(participant, amount, reason)[source]

Set completed_at timestamp on participant’s LucidRID entry

class psynet.recruiters.CapRecruiter[source]

Bases: BaseCapRecruiter

The production cap-recruiter.

class psynet.recruiters.DevCapRecruiter[source]

Bases: BaseCapRecruiter

The development cap-recruiter.

class psynet.recruiters.DevLucidRecruiter(*args, **kwargs)[source]

Bases: BaseLucidRecruiter

Development recruiter for the Lucid Marketplace.

class psynet.recruiters.DevProlificRecruiter(*args, **kwargs)[source]

Bases: PsyNetRecruiterMixin, DevProlificRecruiter

class psynet.recruiters.GenericRecruiter[source]

Bases: PsyNetRecruiterMixin, CLIRecruiter

An improved version of Dallinger’s Hot-Air Recruiter.

exit_response(experiment, participant)[source]

Delegate to the experiment for possible values to show to the participant.

notify_duration_exceeded(participants, reference_time)[source]

The participant has been working longer than the time defined in the “duration” config value.

open_recruitment(n=1)[source]

Return initial experiment URL list, plus instructions for finding subsequent recruitment events in experiment logs.

recruit(n=1)[source]

Generate experiment URLs and print them to the console.

class psynet.recruiters.HotAirRecruiter[source]

Bases: PsyNetRecruiterMixin, HotAirRecruiter

class psynet.recruiters.LucidRID(*args, **kwargs)[source]

Bases: Base, SQLMixin

creation_time = None

the time at which the Network was created.

details

a generic column for storing structured JSON data

failed = None

boolean indicating whether the Network has failed which prompts Dallinger to ignore it unless specified otherwise. Objects are usually failed to indicate something has gone wrong.

failed_reason = None

an optional reason the object was failed. If the object is failed as part of a cascading failure triggered from another object, the chain of objects will be captured in this field.

id

a unique number for every entry. 1, 2, 3 and so on…

property1

a generic column that can be used to store experiment-specific details in String form.

property2

a generic column that can be used to store experiment-specific details in String form.

property3

a generic column that can be used to store experiment-specific details in String form.

property4

a generic column that can be used to store experiment-specific details in String form.

property5

a generic column that can be used to store experiment-specific details in String form.

time_of_death = None

the time at which failing occurred

to_dict()[source]

Determines the information that is shown for this object in the dashboard and in the csv files generated by psynet export.

type
vars = None
class psynet.recruiters.LucidRecruiter(*args, **kwargs)[source]

Bases: BaseLucidRecruiter

The production Lucid recruiter. Recruit participants from the Lucid Marketplace.

exception psynet.recruiters.LucidRecruiterException[source]

Bases: Exception

Custom exception for LucidRecruiter

class psynet.recruiters.LucidStatus(*args, **kwargs)[source]

Bases: Base, SQLMixin

creation_time

the time at which the Network was created.

details

a generic column for storing structured JSON data

failed = None

boolean indicating whether the Network has failed which prompts Dallinger to ignore it unless specified otherwise. Objects are usually failed to indicate something has gone wrong.

failed_reason = None

an optional reason the object was failed. If the object is failed as part of a cascading failure triggered from another object, the chain of objects will be captured in this field.

id

a unique number for every entry. 1, 2, 3 and so on…

property1

a generic column that can be used to store experiment-specific details in String form.

property2

a generic column that can be used to store experiment-specific details in String form.

property3

a generic column that can be used to store experiment-specific details in String form.

property4

a generic column that can be used to store experiment-specific details in String form.

property5

a generic column that can be used to store experiment-specific details in String form.

time_of_death = None

the time at which failing occurred

to_dict()[source]

Determines the information that is shown for this object in the dashboard and in the csv files generated by psynet export.

type
vars = None
class psynet.recruiters.MTurkRecruiter(*args, **kwargs)[source]

Bases: PsyNetRecruiterMixin, MTurkRecruiter

class psynet.recruiters.ProlificRecruiter(*args, **kwargs)[source]

Bases: PsyNetRecruiterMixin, ProlificRecruiter

class psynet.recruiters.StagingCapRecruiter[source]

Bases: BaseCapRecruiter

The staging cap-recruiter.

psynet.recruiters.get_lucid_settings(lucid_recruitment_config_path, termination_time_in_s, bid_incidence=66, collects_pii=False, inactivity_timeout_in_s=120, no_focus_timeout_in_s=60, aggressive_no_focus_timeout_in_s=3, initial_response_within_s=180, debug_recruiter=False)[source]
Parameters:
  • lucid_recruitment_config_path (str, path to the Lucid recruitment config.)

  • termination_time_in_s (int, maximal time a participant can spend on the experiment. If this time is exceeded,) – the participant is terminated via the front-end.

  • bid_incidence (int, default 66, the bid incidence. Bid incidence is the number of completes/(number of completes +) – participants who did not pass the qualifications). It is a percentage, so if you expect 66% of the participants to pass the qualifications, set it to 66. Set it to a realistic value, but as high as possible.

  • collects_pii (bool, default False, whether the survey collects personally identifiable information.)

  • inactivity_timeout_in_s (int, default 120, the inactivity timeout in seconds. If the participant is inactive for) – this amount of time, the participant is terminated via the front-end. Inactive means that the participant does not interact with the page (i.e., no [“click”, “keypress”, “load”, “mousedown”, “mousemove”, “touchstart”]).

  • no_focus_timeout_in_s (int, default 60, the no focus timeout in seconds. If the participant moves the mouse outside) – the window or opens another tab, the participant is terminated via the front-end after this amount of time.

  • aggressive_termination_on_no_focus (int, default 3, this the same setting as no_focus_timeout_in_s, but it is) – only used for aggressive in the consent page, since many participants are lost there.

  • initial_response_within_s (int, default 180 seconds (3 minutes). If the participant does not proceed to the consent) – within this time, the participant is terminated via the backend-end.

  • debug_recruiter (bool, default False, whether to use the development recruiter. This is useful for local testing.)