A-priori to data collection, you can create an internal variable in SoSci Survey and use a simple PHP filter on a page following the attention check to store the code:
if (value('AB01_01') > 2) {
put('IV01_01', 1);
} else {
put('IV01_01', 0);
}
If you already started data collection, you will need a little IF
in excel.
=IF(A1 > 2; 1; 0)