## WeBWorK Problems

### Asterisk appears in Compute( "$a x " )->reduce; HOW TO GET RID OF IT? ### Asterisk appears in Compute( "$a x " )->reduce; HOW TO GET RID OF IT?

by Aba Mbirika -
Number of replies: 3
When I create a quadratic function like:
$f = Compute( "x^2 +$a x + b" )->reduce;

Then if $a is randomly chosen to be 3, for instance, the quadratic appears on the screen as: x2+3 * x+b Instead, I would like it to appear as: x2+3x+b Is it possible to remove the asterisk? Thanks much, aBa In reply to Aba Mbirika ### Re: Asterisk appears in Compute( "$a x " )->reduce; HOW TO GET RID OF IT?

by Alex Jordan -
If you are using the BEGIN_TEXT...END_TEXT environment to display the problem and the Math Objects, then you need to precede it all with Context()->texStrings; and end it with Context()->normalStrings; My first guess would be that this is the issue.
Context()->texStrings;
BEGIN_TEXT
...
END_TEXT
Context()->normalStrings;

See if this fixes things for you. ### Re: Asterisk appears in Compute( "$a x " )->reduce; HOW TO GET RID OF IT? by Aba Mbirika - Thanks Alex. That absolutely fixed the problem. I am new-ish at authoring problems, so I take much content from the NPL. The one I "lifted" has TEXT(EV3(<<'EOT')); EOT So indeed this is old code. Thanks for the tip. And have a nice day! Shalom, aBa In reply to Aba Mbirika ### Re: Asterisk appears in Compute( "$a x " )->reduce; HOW TO GET RID OF IT?
To explain a little what is happening here, suppose $f=Formula("x/3"). Then$f is a complex hash of information, including how to represent $f as a string for say other math objects, as well as how to represent it as a string to be processed with tex. By default, Context()->normalStrings is in place, and if you had$g=Formula("$f+1");, then$f is replaced with x/3, and you have something equivalent to $g=Formula("x/3+1");. But for display to students, you want$f to come out as \frac{x}{3}. Setting Context()->texStrings makes this happen.
Lastly you go back to Context()->normalStrings, because if you now used $g=Formula("$f+1");, you'd get an error from \$g=Formula("\frac{x}{3}+1").
{"ft_lang_label":"__label__en","ft_lang_prob":0.8944843,"math_prob":0.8211393,"size":3374,"snap":"2021-43-2021-49","text_gpt3_token_len":910,"char_repetition_ratio":0.11602374,"word_repetition_ratio":0.6407942,"special_character_ratio":0.27593362,"punctuation_ratio":0.13380282,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99466586,"pos_list":[0,1,2,3,4,5,6,7,8],"im_url_duplicate_count":[null,null,null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-10-20T01:10:09Z\",\"WARC-Record-ID\":\"<urn:uuid:f2a9e91e-1c1e-4f3a-ac29-be4c4a1d7a44>\",\"Content-Length\":\"91311\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:065c1ad8-7d47-4729-a039-2abfc59b6aaf>\",\"WARC-Concurrent-To\":\"<urn:uuid:3d97a510-48b7-4bdc-bfac-e799035abe30>\",\"WARC-IP-Address\":\"34.204.106.157\",\"WARC-Target-URI\":\"https://webwork.maa.org/moodle/mod/forum/discuss.php?d=3536\",\"WARC-Payload-Digest\":\"sha1:JSXNZDFE5XJ2WNTUSD7Z4SS7R242VK7T\",\"WARC-Block-Digest\":\"sha1:IBFEGL5DMWPFDI4O4VICWURTRZLETHT6\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-43/CC-MAIN-2021-43_segments_1634323585290.83_warc_CC-MAIN-20211019233130-20211020023130-00600.warc.gz\"}"}