How can captcha enable after 3 times

There is a similar discussion for adding the CAPTCHA to the login page, but for 2.4.x instead of 3.x here:

The difference between the registration Form and the login Handler appears to continue in OJS 3.1:

In OJS 3.x, you can find the CAPTCHA code for the Registration form here:

See the constructor, fetch(), and 'readInputData()` functions.