thinkcspy
thinkcspy copied to clipboard
PreTeXt Conversion Issues
This issue will serve as a collection point for issues and discussion about the PreTeXt incarnation of the How to think book. Here is what I have received so far from @barbarer @pearcej and @bhoffman0 Thanks!
Early versions are updated here: https://blog.runestone.academy/beta/algorithms.html
-
[x] All of the answers to the MCQ questions coming up as false. (typo in my conversion already fixed)
-
[ ] I would want the activecode to be wider than it currently is and the Parsons too.
-
[ ] The pictures for the Parsons at https://blog.runestone.academy/beta/our-first-turtle-program.html are too big.
-
[ ] Code in a MCQ is displaying strangely. See https://blog.runestone.academy/beta/our-first-turtle-program.html 4.2.7
-
[ ] Explanations in PP are getting cut off by the bottom choice bleeding out of the container...
-
[ ] - can we consider just having a switch so that the index does not persist for books that do not desire it to? I don’t want to have to have my students close the dang thing every time they want to run code—it is too much of a hurdle… or I suppose when using any of these components it disappears, but I don’t like that as well because I hope they read the code first!
-
[ ] code in code blocks is pretty small compared to surrounding text.
-
[ ] I don’t love the marker for code blocks which I don’t think works as well as a full box
-
[ ] the mcq's and parsons seem to be numbered as checkpoints (weird terminology), but the active codes are missing any kind of numbering
-
[ ] many of the cross-references are broken. Brad is working to automate fixing as many as possible, but some will inevitably need manual intervention.
-
[ ] The exercises pages need to be worked on.... I think that given all of what PreTeXt has to offer it makes sense to abandon our
tabbedstuff
directive and use the features of PreTeXt for providing answers.
A few comments on what has been reported so far. Again, thanks.
The images will have to be adjusted. Pretext uses percentages for widths whereas RST is kind of free form. So it is going to take a bit of manual work to fix that. Not hard, just a pass through the book.
The code in MCQs and in the body of the text is a known problem in PreTeXt we will get it fixed.
The numbering of the checkpoints versus the unnumbered activecodes. This is a result of the fact that we didn't really have any way to differentiate between activecodes that were used in the text for students to play with and activecodes that were part of a check your understanding. The good news is that in PreTeXt we can make that sort of differentiation. But its impossible to automate.
Students do not need to close the table of contents in order to do the activecodes.
I've had so many requests over the years to have a better way to navigate around the book than clicking the main icon to go back to the main toc and then to the chapter and then using our subchapter menu. This really seems to solve the problem for us. I'm guessing we have options for the default settings such as whether it is visible or not, and whether we show all of the sections in a chapter that is not active or whether we can collapse the non-active chapters.... I personally would rather have the chapter headings only except for the current chapter.
Some general responses. Everything so far is mostly understood already.
- The tall ActiveCode and Parsons should be allowed to go past our 600px margin. @davidfarmer is aware and should provide the necessary CSS, etc.
- A "Checkpoint" is an inline exercise, versus a divisional exercise. In one scenario it would be possible to have Exercise 5.44 and Checkpoint 5.44, so the name keeps cross-references unambiguous. Both names can be changed by a publisher.
- The code blocks have a CSS conflict. @davidfarmer is aware.
- Code is in a slightly smaller font to keep it within margins. Where we allow widgets to expand horizontally, perhaps it can be enlarged.
- "but the active codes are missing any kind of numbering" - they can be put into a "listing" element and will be numbered.
@rbeezer @davidfarmer I did a little experimenting, and giving the codelens, activecode, and parsons divs a width of 150% makes them very usable. What if we simply add a class like full-width or wide to the top level div then we can catch that with a CSS rule that looks for .runestone.full-width
??
On this page:
https://blog.runestone.academy/beta/our-first-turtle-program.html
which div in the first (turtle) example do you propose adding a class?
(I'd prefer something more semantic than "wide", but I need to understand the situation before making a suggestion.)
On Thu, 7 Apr 2022, Bradley Miller wrote:
@rbeezer @davidfarmer I did a little experimenting, and giving the codelens, activecode, and parsons divs a width of 150% makes them very usable. What if we simply add a class like full-width or wide to the top level div then we can catch that with a CSS rule that looks for .runestone.full-width
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you werementioned.[AABTULF6OYMMGZZVY56E5DTVD4LGVA5CNFSM5SXPN3Y2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOOR PWSZGOIELLPLA.gif] Message ID: @.***>
For the turtle example it is the <div class="runestone ....."
We always have an outermost div which includes the runestone class for Parsons problems they look like this: <div class="runestone" style="max-width: none">
And we are putting these into our exercise
class. Which I hope is present in the version Brad is generating.
But sometimes an ActiveCode will just be in-between paragraphs, not as an exercise. As an editable example, not something to assign.
Is a width that accommodates 80 characters enough? Too much?
I see this as like a wide equation: show the whole thing if you can, otherwise give it a scroll bar.
I am fiddling with the CSS to see if the current markup is enough.
I think the code examples on this page look okay, and the others do not need to be wider:
https://blog.runestone.academy/beta/our-first-turtle-program.html
Please let me know if I missed something.
Have not tested on multiple browsers yet.
(I am aware of the CSS problem with the background on a pre.)
I think we ought to take this opportunity to do a bit of cleanup.
I would like to start by removing the alert and alert-warning classes from all of the components that use it. This is what currently gives some of them the yellowish background color. Not all of them use it and it was not done with much thought way back when. If we remove it, then we can consistently style all runestone components and give them a new and refreshed background color etc..
David, the components that need to be wider are:
- activecode coding exercises.
- parsons problems - it is very difficult for students to do parsons problems top to bottom, it is much better left to right.
- codelens - they look OK until you start to step through and then the diagrams end up underneath the code instead of next to it which makes it harder for students to follow.
- timedAssessment (when we get to that!)
The others look better when they are smaller or the same width as the text.
Quick proof of concept:

Rob - removed those classes from my local copy of pretext-runestone.xsl. I can keep working on this and give you a PR once we are all happy. Doing this now would be a good way to ensure that the Runestone Components can be styled to be compliment your various color schemes.
Meanwhile David and I are messing with each other as we are both fiddling with CSS. 🤣
I'm guessing the point I missed is that the parsons blocks should be next to, not above, the place to drag them.
It is fine to just remove CSS you don't want, like the "alert", and then I can put something back in the PTX css.
If you reload, those parsons problems are side-by-side now.
A couple more issues:
-
The text of some turtle parsons problems refers to the image to the left. That means there should be a side-by-side in the source.
-
Those images which are too large have a 100% width on them. So that also needs to be corrected in the source.
-
The div.source and div.answer in a parsons problem have a hard-coded width and height. But the given height is not tall enough to contain the items in the source. That is why it intrudes on the Check and Reset buttons. So, however that height is calculated, it is getting the wrong answer.
It would be good to just let it use the height it needs, but it is not immediately obvious to me how to keep them the right height and not change when you drag away an option.
Hit the "Show in CodeLens" on the turtle program. Do we want that to the side as well? (A bit of space could be removed before the comment lines?)
I can keep working on this and give you a PR once we are all happy. Doing this now would be a good way to ensure that the Runestone Components can be styled to be compliment your various color schemes.
Beautiful! PR will be accepted nearly instantaneously. (Or holler and have me do it, super EZ.)
I'm guessing the point I missed is that the parsons blocks should be next to, not above, the place to drag them.
Yes, and it is a research result that they are better that way. I've been told. ;-)
the components that need to be wider are:... codelens
Not sure these are implemented, but should now be super-easy with what I have.
When you hit the "Show in CodeLens" on the turtle program, up comes an iframe. Adjusting the attributes on the iframe is not enough to make it look good. So, maybe needs to be a separate issue.
On Thu, 7 Apr 2022, Rob Beezer wrote:
Hit the "Show in CodeLens" on the turtle program. Do we want that to the side as well? (A bit of space could be removed before the comment lines?)
I can keep working on this and give you a PR once we are all happy. Doing this now would be a good way to ensure that the Runestone Components can be styled to be compliment your various color schemes.
Beautiful! PR will be accepted nearly instantaneously. (Or holler and have me do it, super EZ.)
I'm guessing the point I missed is that the parsons blocks should be next to, not above, the place to drag them.
Yes, and it is a research result that they are better that way. I've been told. ;-)
the components that need to be wider are:... codelens
Not sure these are implemented, but should now be super-easy with what I have.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you werementioned.[AABTULDQKZEAG5NUP7FI2LDVD6GFRA5CNFSM5SXPN3Y2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOOR PWSZGOIEOCEWY.gif] Message ID: @.***>
Before you merge the PR please take a look at https://dev.runestoneacademy.org/ns/books/published/rune/exercises-12.html
I hacked in my cleanups and styling changes. Things look good except for the parsons problems.
Looking real nice.
The box around the math matching grows as you drop premises. The history matching has a bunch of space that gradually gets consumed. Which do we like? Whay do they behave differently?
PS I don't see the PR yet?
@bnmnetp In Chapter 11.3 of the ReStructured Text version of the book there is the .txt file on the page, however it does not appear on the respective chapter of the PreText book.
@bnmnetp Chapter 13.1 is missing content. On the reStructuredText version the page includes a lot of paragraphs as well as interactive windows, while on the pretext version there is only one paragraph displayed. I think the pretext version is missing a whole section, because what is named as 13.2 in Pretext, is 13.3 in reStructured Text.



@bnmnetp In chapter 5.4, a link is not working. On the reStructured text, clicking on this link opens a new page in the browser.
However, when you click the same link on the PreTeXt it displays an error.
Broken cross-reference link in Table 9.5.1.
In chapter 5.7, the PreTeXt book is missing some components that the reStructured version has including answers, discussion, show feedback, and Show Code tabs. Also, the solution links in the PreTeXt version seem out of place.
PreTeXt -
reStructured -
Glossary and Summary mixed in 9.20
Chapter 17.11 Exercises solution issues. In the PreTeXt version of thinkcspy some of the exercises here have a solution tab while some do not. The Restructured Text version has a completely different format for these exercises.
Missing exercise questions and duplicate answers in 10.31. Exercise 1 & 11
@campbelle2 @moisedk @phattymcfee --- These difference are to be expected...
For the problems where we do have answers they will need to be moved into an <answer>
tag. rather than using the tabbed interface of the old book.
We are no longer going to have the discussion as they were mostly spam or people posting answers not actually having discussion, so that can be eliminated.
The plan is for you to fix these issues and make pull requests, not just report them as issues. 😄
Thanks!
@bnmnetp Shall we attempt to solve any issues we come across and submit PR's before notifying that we have found an issue? Also, shall we comment issues we have in this forum, or create the issue outside of this?
We can use this issue as the central clearing house.
If you have a question on what to do, this is a great place to comment or ask for help. All the right people are subscribed to this issue.
There is a global issue where active code windows with include statements are missing in the Pretext version. I initially found the issue in chapter 19.2; there are active codes that include a different active code's class (the Point class) but the include statement is not present in the Pretext version so the active codes encounter the error: NameError: name 'Point' is not defined on line 1. This issue is present in every active code window that should have an include statement.