If DCL is contained within a form the hint, submit and run buttons function as submit buttons.
mhughes2k opened this issue · 1 comments
As per W3 specifications buttons default behaviour is to function as a "submit" button.
The buttons outputted have the following html:
<button class="
dcl__Button-module__button--R8ZjR
dcl__Button-module__secondary-light--3KYaF
dcl__Button-module__small--1VJc5
">Hint</button>
When clicking on the hint button within a form this causes the form to submit.
Adding the type="button" attribute to the button (via HTML inspector) causes the form to not be submitted.
This is an issue as we are wishing to embed DCL into a Moodle lesson activity and as the users to submit the answer they get from the DCL code they put together, however clicking the hint button seems to submit the question page with an empty value (as the user hasn't yet put a value in to the lesson form).
This gist should demonstrate the issue: https://gist.github.com/mhughes2k/065f7e02c5b29fde475e85f8f264c1fc