JAKARTA, Indonesia — Agree or disagree, the exam asked: “I would feel uncomfortable knowing my daughter’s or son’s teacher was homosexual.”

Or this, true or false: “The gender composition of an orgy would be irrelevant to my decision to participate.”

In recent weeks, foreign teachers at some private schools in Indonesia have been required to answer these questions and many more like them in what has been billed as a psychological exam.

The goal is to determine teachers’ sexual orientation and attitude toward gay rights under a 2015 government regulation that prohibits international schools from hiring foreign teachers who have “an indication of abnormal sexual behavior or orientation.”