Thursday, 15 October 2020

Where do the jsxgraph images disappear to and how to find them?

Missing jsxgraph images?

In previous posts I have talked about the convenience of using jsxgraph code to create diagrams in questions in moodle.
I use this on my suremaths.com website where I can set up data in the diagram to vary each time the question is used in a quiz.  For instance I could insert two varying angles in a triangle diagram and ask for the value of the third angle.
The value of this is that, students who get this in homework cannot just ask their friends what the answer to that question is since they have different answers. The more valuable question they have to ask is how to find the answer and this difference fosters the intended social learning for which MOODLE is designed.

Missing diagrams

Previous experience for me was that while I could set up several questions with diagrams and varying data, the completed quizzes would only display one of the diagrams when reviewed at the end. 
Searches on the web did not lead to a satisfactory answer. The closest idea was to setup id numbers for each DIV, the HTML boxes in which the diagrams are placed on the question pages.  I never managed to implement that, for one thing,  because I would have had to go through all my questions and insert the id numbers.
Crucially the quiz review in moodle uses a single page in the quiz review, displaying all the questions in one continuous page to scroll. The effect of this that all the diagrams occupy the same location on the top left of the page as defined by DIV and that is why all other diagrams disappear leaving only the box in which they were placed. 
At least that is the appearance. In reality they are all at the same location in layers with only the last one showing at the top.

So how do I get the images back?

To get the images back requires splitting the review into one page per question. On the quiz review page scroll to the bottom and choose to display one question per page. The sacrifice is that the review is slightly longer but you do get back all your diagrams and proper review.
I don't have to give up using jsxgraph! It just keeps improving!

No comments:

Post a Comment