SCCapstone / Swearengineers

Math Quizzes
https://math-quizzes-sc.appspot.com
Apache License 2.0
0 stars 0 forks source link

App gets rid of all the spaces in a question text. #48

Closed josemvidal closed 7 years ago

josemvidal commented 7 years ago
cursor_and_mathquizzes_and_google_hangouts_-_jmvidal_gmail_com
jeSager commented 7 years ago

LaTeX

It's a Latex box. You can escape spaces in latex like: "one\ two" I'm sure we can accomplish that with javascript, but ...

Instruction Box?

If we make it easy to add long instructions in that box, it's hard to keep it in table form to view problems quickly. Since it's math for K-12, most of the questions will be "5+5=?" or "x^2 +x+5=?" Just allowing text will make the output tables pretty useless if we only displayed part of the text ... or very long if we displayed all of it. I planned to an instruction box later for that sort of thing. If you think it's better we can make one box do both.

Two options for keeping LaTeX and plain text in that box:

@napolija already fixed the input that way, but it broke a couple things. He did this by deleting two characters from my code. The update broke the output tables and it also broke the ability to have one-click latex buttons. So, I deleted his update because it broke more than it fixed.

It was a good idea, and I know he worked hard to find those two characters to delete, but I didn't have time to fully implement his update while I'm doing everything else. I'm glad he's thinking about it and trying --- which is more than some people with 6 commits.

1. What that update needed to make it work:

2. Easier way??

josemvidal commented 7 years ago

Just tell the user "Remember to surround your math with $, as in $E=mc^2$" and don't try to do anything clever.

As per 2., note that $fun$ is not the same as "fun". The first one is italic and there is extra space between the f and u. It looks awfull. $joe's$ also looks horrible. Math is not typeset like English.

jeSager commented 7 years ago

Delete

Can't really blame me for deleting that update. Changing the input, changes all the output. I don't think anyone's really interested in updates that fix one thing by deleting two characters and, at the same time, completely break the rest of the site's output. With that update, all the LaTeX would have extra dollar signs around it, and you still wouldn't see any spaces. Ha! You'd just have the illusion of spaces offered by the input screen.

Nothing Clever

Above I linked to MathJax's example to rendering transforms all at once. I intentionally broke it below so we can see how the page renders with and without it. If you refresh each page a few times, you'll see the difference. You'll see unrendered LaTeX and watch it transform on the 'bad one.' I was just trying to avoid that because it will make the tables jump around when you click on a page.

bad render - broke the all-at-once function

Maybe it's not so bad? Whichever you like. Right now we're using individual script tags on all the problem output fields (which do not display unrendered LaTeX either). That will need to change because the LaTeX will not be confined to a field.

josemvidal commented 7 years ago

I'm not sure I follow you.

There will always be a delay as the javascript and turns latex into MathML. All math websites have the delay. Look at https://math.stackexchange.com/

What I suggested above is to do exactly what they do, see their help page https://math.stackexchange.com/editing-help#latex (Well, they also use markdown, which you are not using)

jeSager commented 7 years ago

It's not the delay I'm trying to avoid. It's viewing the raw LaTeX whenever a page is rendered, watching the transform, and have the tables bounce while this all happens. I just opened the 'bad page' above and did a screenshot (very quickly). The function that mathjax provides avoids this. No raw LaTeX. You will just see white on whatever html element you use it on until after MathJax finishes sending it's return. I used the exact same page. It's different though. I broke one.

You cannot see raw LaTeX in the output pages of our site currently because we're using script tags. Without the MathJax All-At-Once function, we will. Also, it'll probably be more evident flipping through pages than with my one example. Maybe press F5 a few times?

Just showing you what's recommended. I won't implement it if you don't want it. Sounded like you didn't.

bad

josemvidal commented 7 years ago

Functionality first: in life, and in how I grade for this class.

Once the app does everything it is supposed to do then you can worry about getting rid of the jumps.

jeSager commented 7 years ago

Fix Preview

screenshot from 2017-03-14 00-22-00