Encoding problem for text or math answers

I’m trying to define a quiz where an answer is “()” (without quotation marks).
I’ve tried to escape it in all sorts of ways, but have failed to make it work.

I’m not sure whether this is the right place to ask. If so, I have two questions:

  • How to define a correct answer to be () ?
  • What is the underlying parser, that is, where can I look up how the generated xml is processed, to find out on my own how I can modify the questions to fit my needs? It seems to be parsed in Python, but how exactly? I could not yet locate the code for exercises on GitLab. And I frequently get an error “cannot create LoncapaProblem”. What is this? Help!

The documentation does not address the problem of special character input at all.

Thank you,

Okay so I found the answer to my first question:
To represent (), enter:


Using the code here as hint, the contents might be parsed with html.unescape(...), where html is the python library. And what this does is explained here.

However, I already ran into another problem:
I want to insert a plaintext [1], not into the answer, but above the answer. I wasn’t able to do that in the way I could enter () in the answer:
This doesn’t even give an error message, it just won’t save.

If someone has an answer to my second question, or a link to a beginner-friendly introduction to Open EdX that explains things like these, please do write.