WeBWorK Problems

Answer boxes for limits of integration - with support for MathQuill

Re: Answer boxes for limits of integration - with support for MathQuill

by Nathan Wallach -
Number of replies: 0
Glenn - The use of the CSS descendant selector to handle the regular (non-MathQuill) formatting is a huge improvement over the original approach of manually determining and using the ids of the input boxes whose formatting needed to be modified. Thanks for helping improve this formatting approach.

I've adopted your selector in the attached sample (plain) PG file which should be considered a replacement for the file in the prior post of this thread.

Thanks also for providing the PGML sample - which makes this approach relevant for both styles of coding problems.

About use in Gateway quizzes - it could be that such uses would run into some "scope conflicts" if the same class names were used in different problems but with slight differences in the CSS setting used in different problems included in a single gateway quiz.  One setting I have found it useful to sometimes tweak a bit is the value of "left" in .divOnLineWithIntegrationLimits (also sometimes in .gridForPairOfIntegrationBounds) which helps reduce excess white-space in the lines being displayed by the browsers. Since there "scoped" property of the HTML style tag was deprecated and is not supported by most browsers, I'm not sure there is an easy approach to avoiding such potential issues. Maybe there is a better approach to keep the spacing reasonable without the use of negative values of "left" with "position: relative;".

Since openDiv() and openSpan() provide the ability to "wrap" any reasonable section of PG generated HTML code in a unit which can be assigned a class name, the use of such a wrapper and the type of descendant selector you used can make it easy to add formatting to input boxes without any need to add a new feature to PG to attach styling or an additional class name to input boxes directly.