expectedparrot / edsl

Design, conduct and analyze results of AI-powered surveys and experiments. Simulate social science and market research with large numbers of AI agents and LLMs.
https://docs.expectedparrot.com
MIT License
172 stars 18 forks source link

Add skip rule capability for skipping a question in all cases #1039

Open rbyh opened 1 week ago

rbyh commented 1 week ago

E.g., if I don't want to administer a question it would be nice for this to work (it does not -- there is no error, but the question is administered):

from edsl import QuestionFreeText, Survey

q1 = QuestionFreeText(
    question_name="email",
    question_text="Enter your email."
)

q2 = QuestionFreeText(
    question_name="today",
    question_text="What is today?"
)

survey = Survey([q1,q2]).add_skip_rule("email", "1==1") # any true statement should work?
results = survey.run()

https://www.expectedparrot.com/content/21ae5f3a-afb4-4dd0-8954-1611889212a1

johnjosephhorton commented 1 week ago

This should be a bug

johnjosephhorton commented 1 week ago

so the problem here is that it's the first question and given how job-running is implemented, skipping the first question is awkward. My inclination here would be just throw an exception if a skip rule is applied to the first question....

johnjosephhorton commented 1 week ago

To be clear, I mean a rule that might skip the first question - a rule that's applied after the first question is answered is no problem at all.

rbyh commented 1 week ago

Noting our discussion about instead having a set of features for "draft" and other special treatment of questions depending on whether you want to skip, eg for AI vs human audience.