openlab-at-city-tech / webworkqa

WeBWorK integration for WordPress and BuddyPress
GNU General Public License v2.0
4 stars 2 forks source link

Long division problem text not formatted correctly #144

Closed bree-z closed 5 years ago

bree-z commented 5 years ago

I'm not sure if this is related to #143 , but the parts of the long division problem text isn't being formatted correctly on the OL-WW side. E.g.:

WW: http://mathww.citytech.cuny.edu/webwork2/WW-Dev/Polynomials_-_Division/2/?effectiveUser=student1&user=student1&key=VYKlNLYNiiOn8eSkR5GcGwItwPMTjs52

OL-WW: http://openlabdev.org/webwork-playground/#:problemId=local2/setPolynomial_Division/long-division-nonmonic-linear.pg

WW screen shot 2019-01-22 at 1 39 11 pm

OL-WW screen shot 2019-01-22 at 1 39 45 pm

Thanks!

bree-z commented 5 years ago

Apologies if this should have been part of #131 !

boonebgorges commented 5 years ago

There's a slight relation to #131, because the particular formatting of this problem means that empty LaTeX chunks are getting pushed to OL-WW. I've just added a check that ensures that these empty chunks are not processed by the browser.

The root issue here is that the formatting in the long division problem is not native LaTeX, but appears to be powered by the creative use of inline div styles. This styling was being stripped by my security tools. I have loosened the restrictions for this type of content and it appears to resolve the issue. This will only apply to newly posted items - existing ones are in OL-WW without the full markup. See eg http://openlabdev.org/webwork-playground/#:problemId=local2/setPolynomial_Division/long-division-nonmonic-linear.pg:questionId=11806

cc @drdrew42 just as a heads up about the display: table-row etc tricks. It's fine to use them but it's good to keep in mind that new things like this will likely need to be whitelisted in the future.

bree-z commented 5 years ago

Thanks, Boone! I've tested a bunch of these, and all seem fine.