What is the correct way to use logical operators in a formula?

For the life of me, I can’t figure out what’s the mistake I am making.

Here’s the schema (link). The mischievous field is play1_isCorrect (the last one).

It has a simple logical condition as a formula, based upon the two aforementioned fields.

if (field("play1_q") == 1 and field("play1_a") == 2) then true else false end

However, the sample data generated, assigns False to this field, for all the rows. Its behaviour is as if the condition is completely skipped:

The condition ( play1_q is 1 and play1_a is 2) is obviously evaluated wrongly.
Where am I going wrong?

By putting single quotes around the values, thus:

if (field("__play1_q") == ‘1’ and field("__play1_a") == ‘2’) then true else false end

it was resolved.

I know you are laughing up your sleeves. I know that I have been idiotic! :grimacing: