-
-
Notifications
You must be signed in to change notification settings - Fork 75
Add math-mode support for horizontal Parsons problems #694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This patch extends the Runestone hparsons component to support math-mode horizontal Parsons problems.
Here is one of the test cases I used in Pretext:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
block.innerHTML = this.decodeHTMLEntities(block.innerHTML); | ||
}); | ||
|
||
if (window.MathJax && MathJax.typesetPromise) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this addition!
You should have a look at parsons.js and others for how we use the this.queueMathJax(specific item).
MathJax can create a big set of timing problems and this allows us to take control. Also trying to re-typeset the whole page can be a performance issue.
}, 0); | ||
} | ||
|
||
simulateSolution() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe some comments about what the simulateSolution
function is all about? Its not clear to me.. Is this for scoring? I would have guessed that block scoring would be fine? Maybe not for some expression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bnmnetp
The Micro-parsons code was formatting the math blocks with unpredictable Ascii characters, so I simulated the correct solution in the answer area and asked Micro-parsons to output what a correct solution would look like from their end. I needed this because a correct answer is determined by comparing the text on the blocks. I was hoping there would have been an ID on the blocks, but I didn't see any, so this was my workaround. I am sure there is a better way. Let me know if you have any ideas.
I can add more details to the PR tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying! I assume all of the \
ing of characters was the cause of the weird text.
I does not look like the html representation lends itself easily to adding ids.... But it seems like it should. maybe worth investigating with Rob, and looking at a better html (or json) representation to use in the javascript.
I'm ok with your solution for now, but thinking long term.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think adding IDs could streamline future improvements and make grading in blockGrader.js
more straightforward.
I designed this PR thinking that it would be a good way to construct formulas and equations term-by-term. Unfortunately, it doesn't currently support multiple correct orderings, which would be essential for commutative operations like addition and multiplication. So getting Rob (@rbeezer) involved in coordinating how multiple orderings can be communicated to Runestone would be good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, display math tags (<me>
) are not currently supported with this PR, but <m>\displaystyle * </m>
is good to go.
Changes "code" to "answer" in the problem directions for non-coding problems. A description of the simulateSolution method was added.
This patch extends the Runestone hparsons component to support math-mode horizontal Parsons problems.