Skip to content

Conversation

@geoff-cox
Copy link
Contributor

hparsons block feedback: grade/log/highlight by block indices

hparsons: persist/restore by indices; make math rendering display-only

@geoff-cox
Copy link
Contributor Author

@bnmnetp @ascholer This is part 2 of math support for horizontal Parsons.

It needs more testing, but any feedback would be welcome.

@bnmnetp
Copy link
Member

bnmnetp commented Jan 15, 2026

Thanks @geoff-cox Can you paste a PreTeXt example here that I can use to test? I use the sample-book so if there is an example in another PreTeXt document you can point me there too.

@geoff-cox
Copy link
Contributor Author

@bnmnetp

Here is the test exercise I used:

<exercise label="horizontal-parson-math-test" language="math">
  <title>Parsons Problem with math blocks</title>
  <statement>
      <p>Testing math mode ...</p>
  </statement>
  <blocks layout="horizontal" randomize="yes">
      <block order="2"><m>\pi</m></block>
      <block order="1"><m>\sum</m></block>
      <block order="4"><m>\beta</m></block>
      <block order="3"><m>\alpha</m></block>
  </blocks>
</exercise>

@bnmnetp
Copy link
Member

bnmnetp commented Jan 16, 2026

This looks like it is working fine, once I update the package.json file to use the new micro-parsons.

I think we can merge it, as it is clearly better than what we have, and if we run into bugs later we can deal with them then.

Sound good?

@geoff-cox
Copy link
Contributor Author

@bnmnetp, Sounds good to me.

Did you also see the update at RunestoneInteractive/micro-parsons-element#2 ?
Just thinking ahead...

To fully support math mode, I think the next big improvement would be to allow:

  • multiple correct block sequences, and
  • blocks that can start in the dropzone.

This would open the door to constructing formulas, functions, and equations that involve commutative operations.

@bnmnetp bnmnetp merged commit 14cc745 into RunestoneInteractive:main Jan 19, 2026
@bnmnetp
Copy link
Member

bnmnetp commented Jan 19, 2026

I merged the micro-parsons-element PR and incorporated that into your PR here. I also changed how we run MathJax over the blocks. See hparsons.js line 192. Now I'm getting good mathjax rendering every time I refresh. Before it was only about 1 out of 5 times that the math was rendering correctly.

Thanks.

@bnmnetp
Copy link
Member

bnmnetp commented Jan 19, 2026

I think that to support multiple correct block sequences will require a new grader to be written.

Sounds like a project for a mathematician with coding skills 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants