Change mathQuillOpts a bit and disable MathQuill for parserWordCompletion.pl #555
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The stringify_answers method of Translator.pm now JSON encodes the mathQuillOpts key of the answer hash if defined and a hash reference. This allows the value of that key to be a hash. This is easier to work with than manually creating JSON strings. Furthermore, it can be directly passed to the mqedit.js javascript as a data attribute with an object value.
So this changes the way the mathQuillOpts answer hash key works.
Previously to disable the spaceBehavesLikeTabs option (i.e. to enable typing of spaces) and the disable rootsAreExponents you would need to do
$ans->cmp(mathQuillOpts => "spaceBehavesLikeTab: false, rootsAreExponents: false")
Now you will do
$ans->cmp(mathQuillOpts => { spaceBehavesLikeTab => 0, rootsAreExponents => 0 })
This changes the usage from before, but I doubt many were using these options yet.
Note that you can also use
$ans->cmp(mathQuillOpts => "disabled")
to disable MathQuill answers for an answer blank. (This is done in the webwork2 code).This also automatically disables MathQuill answer boxes when the answer is a parserWordCompletion.pl answer.
This is paired with the webwork2 pull request openwebwork/webwork2#1288.