WeBWorK Problems

cmp_class must be in all lowercase?

Re: cmp_class must be in all lowercase?

by Davide Cervone -
Number of replies: 0
You are right, the value of cmp_class does get set to lower case. There is no easy way to override this at the moment, as it is hard coded into several routines that would require editing the MathObject code to fix. I will look into doing that.

In the meantime, the only thing I can suggest is to use an HTML entity to represent the capital letter (so that it is not affected by the lower-case transformation). So something like

    $VAR = "".ord($var).";";
    ...
    cmp_class => "an equation of the form $VAR = ___"
should work. This makes $VAR be a numeric entity for the letter stored in $var. For example, if $var = "B", then $VAR will be B, which will not be changed when it is turned to lower case, and then when displayed in the browser, you will see a B.

It's a hack, but the easiest solution I can think of.

Davide