Open rbyh opened 3 months ago
@johnjosephhorton What is the workaround? Can we auto-substitute it?
Attempt 1 failed with exception:Exception in evaluation: invalid syntax (<unknown>, line 1). The expression is: union != 'Yes, I am currently a member of a labor union'. The current info env trying to substitute in is: {'union': 'I am not now, nor have I been, a member of a labor union', 'union_comment': 'I am not now, nor have I been, a member of a labor union'}. After the substition, the expression was: 'I am not now, nor have I been, a member of a labor union' != 'Yes, I am currently a member of a labor 'I am not now, nor have I been, a member of a labor union''. now waiting 1.00 seconds before retrying.Parameters: start=1.0, max=60.0, max_attempts=5.
yeah - this is tough. One option would be to require references to question answers be in braces i.e.,
.add_stop_rule(q_union, "{{ union }} != 'Yes, I am currently a member of a labor union'")
I kind of like this - thoughts?
Yeah, I actually like that, because referencing the question name without quotes feels weird to me (ie "union == '....'" as opposed to "'union' == '....'")
So this works as-is:
.add_stop_rule(q_union, "{{ union }} != 'Yes, I am currently a member of a labor union'")
)
I could do a warning whenever someone doesn't use braces for variables. Another thought - I could also insist that this be
"{{ union.answer }}
to make it very explicit. Thoughts?
I like requiring union.answer for consistency with piping.
Coop notebook: https://chick.expectedparrot.com/content/4f1a30c2-bbcf-4f33-96a6-9475333d5253
Code to reproduce ("union" is question name and also used in the text of the answer option referenced in the conditional logic):