maths / moodle-qtype_stack

Stack question type for Moodle
GNU General Public License v3.0
138 stars 147 forks source link

iframe covers area much larger than applet within #1177

Closed guidopinkernell closed 2 months ago

guidopinkernell commented 2 months ago

A geogebra applet is displayed within an iframe. The attached example shows that the iframe covers an area that is much larger than the applet within hence creating empty spaces around the applet which put other question information out of view. I have played around with applet size definitions, and it seems that these have no influence on the area that is occupied by the iframe.

questions-authotry-iframe larger than applet-20240426-0744.zip

georgekinnear commented 2 months ago

I think this is actually an issue with the docs, because there is a way to control the size of the [[geogebra]] iframe using something like [[geogebra width="600px" height="300px"]]

From a quick look at the code here https://github.com/maths/moodle-qtype_stack/blob/dc19c913b6c4a8fc8b8ef20ae31ced699d23dd7b/stack/cas/castext2/blocks/geogebra.block.php#L286-L288

it seems like the options are the same as for the jsxgraph block, so perhaps we could just copy this section of the docs: https://docs.stack-assessment.org/en/Authoring/JSXGraph/#block-options into https://docs.stack-assessment.org/en/Authoring/GeoGebra/ ?

sangwinc commented 2 months ago

@smmercuri could you please look into this? If it's just an update to the docs then could you follow @georgekinnear's suggestion and resolve this please?

guidopinkernell commented 2 months ago

Thanks for looking into this. Actually, George is right. The problem is solved by adding information about size of the iframe etc into the block's head. Inside the block, size information for the applet itself needs to stay, though. It seems that the documentation is not complete. I will add what is necessary.