mebis-lp / moodle-qtype_geogebra

GitHub Repository for qtype_geogebra
https://moodle.org/plugins/qtype_geogebra
7 stars 13 forks source link

MBS-6453: Avoid submission of question form when clicking GGB buttons #64

Closed PhMemmel closed 2 years ago

PhMemmel commented 2 years ago

Closes #63 Closes #57

Care: This PR also includes the change suggested in #57.

Implementation details: I use a Mutation Observer to track the adding of button elements in the GGB applet itself and convert all of the buttons (which are by default 'submit' buttons) to standard buttons (type 'button'), so they will not trigger a form submission.

This is not an optimal approach, but trying to catch the event and prevent the submission in certain cases has other downsides, see #63 for details.

murkle commented 2 years ago

@PhMemmel We will change the button type to "button" in GeoGebra (so you won't need the hack 😄 )

ref APPS-4099

PhMemmel commented 2 years ago

@murkle Awesome, thank you! Please make sure you catch every button ;-) Is APPS-4099 publicly available somewhere?

PhMemmel commented 2 years ago

Closed, will be solved in GGB app itself.

murkle commented 2 years ago

Please test with v719 (not released yet) applet.setHTML5Codebase("https://www.geogebra.org/apps/5.0.498.0/web3d");