shevandrin / rqti

Create QTI Exercises and Exams from R
https://shevandrin.github.io/rqti/
GNU General Public License v3.0
4 stars 2 forks source link

error, if xml contains html entities #144

Closed shevandrin closed 9 months ago

shevandrin commented 9 months ago
librarian::shelf(qti, mathml)
task <- new("Essay")
task@content <- list("<math><mrow><mover accent=\"true\"><mi>p</mi><mo>&Hat;</mo></mover><mo>&pm;</mo><mrow><mi>z</mi><mo>&sdot;</mo><msqrt><mstyle displaystyle=\"true\"><mfrac><mrow><mover accent=\"true\"><mi>p</mi><mo>&Hat;</mo></mover><mo>&sdot;</mo><mrow><mo>(</mo><mrow><mn>1</mn><mo>-</mo><mover accent=\"true\"><mi>p</mi><mo>&Hat;</mo></mover></mrow><mo>)</mo></mrow></mrow><mi>N</mi></mfrac></mstyle></msqrt></mrow></mrow></math>")
upload2opal(task, display_name="issue_144")

outcome: https://bildungsportal.sachsen.de/opal/auth/RepositoryEntry/43123802114?0

https://bildungsportal.sachsen.de/opal/auth/RepositoryEntry/43123802115?0 @johannes-titz i would ask you to try it with your examples

shevandrin commented 9 months ago

if it meets your requirements, than we need to change all xml in tests

johannes-titz commented 9 months ago

I will test it out, but I will need some time. I just created the exam for this semester and do not want to introduce any changes until the exam is fixed.

johannes-titz commented 9 months ago

I did some testing, more of heuristic nature, but I have the feeling that with doctype for mathml (up to date version), the exam is very slow to load...without it, it loads instantly. maybe you can also test this? It would kinda make sense if external resources must be loaded. The question is how big are these resources and are they loaded multiple times?

shevandrin commented 9 months ago

@johannes-titz i change the approach, now i used html decoder and deleted DOCTYPE

johannes-titz commented 9 months ago

Did you experience performance issues with the prior implementation too?

Okay, maybe you can show me how it is implemented, I am interested.

Edit: Ok, now I see that you just call decode; so not much to show, I guess :). Okay, I will test it and then we can close it.

johannes-titz commented 9 months ago

This works; I did not experience any problems with loading so far. I will close it for now.