The grading scheme of almost all of the mathematics courses in my university is such that a substantial amount (e.g., $ \geq 20 \ \text{percent}$) of a student's grade is based on homework assignments.
In most upper-level mathematics courses, the grade is based almost exclusively on homework (indeed, there are some courses in which the mark is based entirely on homework).
However, there is a clear problem with this: nowadays, any student can make a math.stackexchange account and receive an answer to any mathematical question at the undergraduate (and even graduate) level within hours at most and reproduce whatever answers he or she receives on his or her homework assignment. Thus, in principle, a student can pass the course, or even get an $A$, without understanding anything.
Of course, in theory, homework questions are frowned upon on the math.se website, but in practice, an answer is almost always given.
So, my question is,
Is there any solution to this problem besides relegating the role of homework in university-level mathematics? Has the existence of this website affected how instructors choose to allocate marks in mathematics courses?