-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.1.7, 4.1.8, 4.2.4, 4.3
-
MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE
Summary
When printing drag-and-drop questions, the drop zones and items are not correctly resized if the background image is wider than the question container, hence is scaled down. We encountered this problem while archiving quiz attempts as PDF documents.
This affects both qtype_ddmarker and qtype_ddimageortext.
I tested this behavior on 4.1, 4.2, and 4.3. However, it is likely to affect older versions as well. This problem was discovered by and hence affects multiple universities.
Expected Behavior
Question background image, drop zones and drop items are scaled correctly to fit the printed document. Drop zones and drop items are positioned and scaled correctly, based on the actual height and width of the resized background image.
See attachments:
- qtype_ddmarker_expected.png
- qtype_ddimageortext_expected.png
Actual Behavior
The question background image is resized correctly and fits the question container. Drop zones and drop items, however, are misplaced to positions based on the natural dimensions of the background image instead of the actual, resized height and width.
See attachments:
- qtype_ddmarker_actual.png
- qtype_ddimageortext_actual.png
- Testquiz_Attempt_review_DIN_A0.pdf
Additional Notes
The problem vanishes when using absurdly wide paper sizes (e.g., DIN A0). Attached you can find the above included attempt report printed to DIN A0 as Testquiz_Attempt_review_DIN_A0.pdf
Steps to reproduce
A Moodle backup of a full test quiz to reproduce this issue is attached as example-quiz.mbz!
- Log in as teacher or admin
- Create a test course
- Create a test quiz inside the course
- Add new questions of the following types: "Drag and drop markers", "Drag and drop onto image"
- For each question, use a background image that is at least 2000 px wide, forcing it to be resized by the responsive CSS to fit into the question container.
- Start an attempt, assign drag and drop items within both questions and submit the attempt
- Open the attempt review page
- Print the attempt report as PDF using DIN A4 as paper format
- Note: The bug is already visible inside the print preview!
Related Issues
Thanks!