Mathquill - \MathQuillMathField command deleted after using latex() parser

153 views Asked by At

Im useing the \MathQuillMathField command dynamically by user actions on the MathField

example

mathFieldSpan = document.getElementById('math-field');
fillInTheBlank = document.getElementById('fill-in-the-blank')
mathField = MQ.MathField(mathFieldSpan);
fillInTheBlank = MQ.StaticMath(document.getElementById('fill-in-the-blank'));

//add new input field with ```\MathQuillMathField``` command to the mathField object.
function mathFieldBtn() {
  mathField.write('\\MathQuillMathField{}');
}

//display the received math input in static mathQuill element - fillInTheBlank
function save() {
  fillInTheBlank.latex(mathField.latex());
}

But the \MathQuillMathField removed after running mathField.latex() method

How can I save the empty field (\MathQuillMathField) dynamically and display it in staticMath object?

My goal is to allow partial input in static math expression (let the student fill in the answer for example)

0

There are 0 answers