Preview of drop zones of ddimageortext question messed up when using SVG background image

Preview of drop zones of ddimageortext question messed up when using SVG background image

by Alexander Lebeth -
Number of replies: 4

We 're using SVG images as background images in ddimageortext questions, because of the superior quality when rendered on retina and other hi-resolution monitors compared to PNG or JPG. In general, this works great, als long as you set explicit width/height inside the SVG itself (Example: <svg x="0px" y="0px" width="410" height="410" viewBox="0 0 410 410"> )
But recently we recognized an issue: the preview which shows the drop zones interactively when editing the question is visually messed up and doesn't correspond to the final result. Please see the screenshots below, where the final view is flawless, but the preview while editing is messed up. I attached the exported question in XML format and as well I attached the mere SVG file to this post. If someone knows the reason or a solution for this problem, we would be thankful.


Screenshot of messed up preview:

messed up preview

Screenshot of good final result:

Final result

Attachment example_svg-image.svg
Average of ratings: -
In reply to Alexander Lebeth

Re: Preview of drop zones of ddimageortext question messed up when using SVG background image

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
As it says when you post to this forum: tell us which Moodle version are you using?
In reply to Tim Hunt

Re: Preview of drop zones of ddimageortext question messed up when using SVG background image

by Alexander Lebeth -
Sorry: I am using Moodle 3.6.10 (Build: 20200511)
In reply to Alexander Lebeth

Re: Preview of drop zones of ddimageortext question messed up when using SVG background image

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
That is a very old version of Moodle, which is no longer supported. A log of improvements were made to the grade drop question types in Moodle 3.9. You could try them out at https://qa.moodledemo.net/ to see if they would fix your problem, then plan your upgrade.
In reply to Tim Hunt

Re: Preview of drop zones of ddimageortext question messed up when using SVG background image

by Alexander Lebeth -
Thank you very much! In version 3.11 dev the SVG works! I've found out, that the messed-up preview derives from a restriction of the height of the background image to 400px. The height in the SVG I used, exceeded 400px.