RunestoneInteractive / RunestoneComponents

Packaging of the Runestone tools for publishing educational materials using github pages
http://runestoneinteractive.org
Other
101 stars 225 forks source link

Recursively parse the instructions for parsons problems #1125

Closed bnmnetp closed 3 years ago

bnmnetp commented 3 years ago

@barbarer

Most other components recursively parse the written instructions for the questions so that you can use restructured text in the instructions. Parsons does not do this. Is there a reason why? How many questions would this break if we changed it so that the instructions were parsed? -- I'm believe any instructions that contain raw html would need to be updated to use RST instead.

barbarer commented 3 years ago

I don't think that there is a reason why. It means we can't do things like use var to highlight a variable name and I would love to have that ability.

bnmnetp commented 3 years ago

OK, I have this coded up. BUT. @barbarer @bhoffman0 If you have written parsons questions that use HTML -- especially for embedding images or code snippets in the question those questions will need to be updated to use RST to format the code or the questions.

I'm not sure I just want to launch this change without some time to modify the existing questions.

bhoffman0 commented 3 years ago

Ok, I think there are some in CSAwesome. I'll look for them. -Beryl

On Thu, Jan 21, 2021 at 11:05 AM Bradley Miller notifications@github.com wrote:

OK, I have this coded up. BUT. @barbarer https://github.com/barbarer @bhoffman0 https://github.com/bhoffman0 If you have written parsons questions that use HTML -- especially for embedding images or code snippets in the question those questions will need to be updated to use RST to format the code or the questions.

I'm not sure I just want to launch this change without some time to modify the existing questions.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/RunestoneInteractive/RunestoneComponents/issues/1125#issuecomment-764748586, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABC4GOSSOL6TUIGGOF42R63S3BGDPANCNFSM4WHZ6GTQ .

barbarer commented 3 years ago

I am not sure what you mean. I do have some Parsons problems that include html for an image. Such as the example below. What would it change to?

Thank You, Barb

.. parsonsprob:: 10_3_1_Turtle_Spiro :numbered: left :adaptive:

There is a way of arranging the statements below such that this image is created. <img src=" https://i.postimg.cc/TwXdYg6T/Blue-Triangles-Red-Circle.png" width="200" align="left" hspace="10" vspace="5" /> The turtle will draw many triangles. Move the needed pieces of the program from the left into the space on the right. Indent lines as needed.

from turtle import from sys import setExecutionLimit(50000)

wn = Screen() mateo = Turtle() mateo.setheading(90)

for repeats in range(20):

for repeats in range(20) #distractor

   mateo.color("red")
   mateo.forward(10)
   mateo.left(18)

===== mateo.color("red") mateo.forward(10) mateo.left(12) #distractor

   for sides in range(3):
   =====
   for sides in range(4): #distractor

===== mateo.color("blue") mateo.forward(50) mateo.right(120)

Dr. Barbara Ericson Assistant Professor, School of Information University of Michigan

On Thu, Jan 21, 2021 at 11:05 AM Bradley Miller notifications@github.com wrote:

OK, I have this coded up. BUT. @barbarer https://github.com/barbarer @bhoffman0 https://github.com/bhoffman0 If you have written parsons questions that use HTML -- especially for embedding images or code snippets in the question those questions will need to be updated to use RST to format the code or the questions.

I'm not sure I just want to launch this change without some time to modify the existing questions.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/RunestoneInteractive/RunestoneComponents/issues/1125#issuecomment-764748586, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKOZ7M3YJMUUZDN7OT45GHDS3BGDPANCNFSM4WHZ6GTQ .

bnmnetp commented 3 years ago

Just the same as you would in a regular paragraph.

.. image:: https://url.to.image
barbarer commented 3 years ago

Okay. So should I fix the Parsons problem now and everything will be updated on Sat?

Dr. Barbara Ericson Assistant Professor, School of Information University of Michigan

On Thu, Jan 21, 2021 at 1:20 PM Bradley Miller notifications@github.com wrote:

Just the same as you would in a regular paragraph.

.. image:: https://url.to.image

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/RunestoneInteractive/RunestoneComponents/issues/1125#issuecomment-764843925, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKOZ7MZIZPF75CLLEOCM4FDS3BV45ANCNFSM4WHZ6GTQ .

bnmnetp commented 3 years ago

Well, that's why I was asking you and @bhoffman0 . I have it on a branch, so it could wait a week or so.

It might be smart to do a release without it for Saturday (5.5.7). That release will be live on runestone.academy with lots of bug fixes. Then do another release with it (5.5.8) right after that, so that you would be able to have it and test the new parsons directions. If nothing else pops up 5.5.8 could go live in a week or I may end up with 5.5.9.

bhoffman0 commented 3 years ago

I think I've fixed them in CSAwesome. If you want a quick fix, you can move the img tag into a raw html rst right before the parsons problem and it looks the same: .. raw:: html

 <img src="../_static/turtleForwardLeftForward.png" width="150" align="left" />

.. parsonsprob:: 2_1_Turtle_L

barbarer commented 3 years ago

Let's wait till next week. I have to finish my 3rd year review materials by Wed.

Dr. Barbara Ericson Assistant Professor, School of Information University of Michigan

On Thu, Jan 21, 2021 at 1:34 PM Bradley Miller notifications@github.com wrote:

Well, that's why I was asking you and @bhoffman0 https://github.com/bhoffman0 . I have it on a branch, so it could wait a week or so.

It might be smart to do a release without it for Saturday (5.5.7). That release will be live on runestone.academy with lots of bug fixes. Then do another release with it (5.5.8) right after that, so that you would be able to have it and test the new parsons directions. If nothing else pops up 5.5.8 could go live in a week or I may end up with 5.5.9.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/RunestoneInteractive/RunestoneComponents/issues/1125#issuecomment-764852079, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKOZ7MZXZSHTN2F5FX6553TS3BXT7ANCNFSM4WHZ6GTQ .

bnmnetp commented 3 years ago

done