edsl icon indicating copy to clipboard operation
edsl copied to clipboard

QuestionMultipleChoice is allowing "None" response

Open rbyh opened this issue 8 months ago • 0 comments

Expected behavior: An exception is thrown when the model does not provide a response to a question. Actual behavior: QuestionMultipleChoice and QuestionCheckBox allow "None" response:

image image

Code to reproduce:

from edsl.questions import QuestionMultipleChoice

q = QuestionMultipleChoice(
    question_name = "bad_instruction",
    question_text = "?",
    question_options = ["breakfast", "cars"] 
)

results = q.run()
results.select("bad_instruction").print(format="rich")
from edsl.questions import QuestionCheckBox

q = QuestionCheckBox(
    question_name = "bad_instruction",
    question_text = "What are your 2 favorite foods?",
    question_options = ["dogs", "cars", "blue", "movies"],
    min_selections = 1,
    max_selections = 1
)

results = q.run()
results.select("bad_instruction").print(format="rich")

rbyh avatar Jun 12 '24 11:06 rbyh