Thank you. It seems that the idea to transform double backticks into displaymath is unique for WeBWorK. It does not work in other engines, such as original AsciiMath or MathJax. Having this in mind, in the next semester I will instruct students to use regular LaTeX only. This also resolves the above mentioned problem. In the running courses I use the substitution from `` to ` in the problem grader. This is a convenient workaround for me and for now.