Command function in older version 2022.1.3 of psychopy but not 2024.2.3

URL of experiment: (ideal one) (the one not working properly)

Description of the problem:
I tried to use a command so that the participants would see either chinese or number stimuli based on the trialtype. However, the same command works in older version of psychopy (2022. 1.3) but not in 2024.2.3.

It’s just a simple command

if realtype == 1:
word = cword
word = eword

It runs fine locally but the one written with later version of psychopy has problem on pavlovia site. It will not enter realtype == 1… it always goes to else: (86.4 KB)
This is written with older version of psychopy