Forum archive 2000-2006

Šarūnas Burdulis - Answer Preview, images mode

Šarūnas Burdulis - Answer Preview, images mode

by Arnold Pizer -
Number of replies: 0
inactiveTopicAnswer Preview, images mode topic started 10/24/2006; 10:47:15 AM
last post 11/3/2006; 12:17:45 PM
userarūnas Burdulis - Answer Preview, images mode  blueArrow
10/24/2006; 10:47:15 AM (reads: 222, responses: 4)
Webwork and PG versions 2.2. We use problems were students have to enter inequality sign as part of the answer. The problem is that in Answer Preview cell less-than and greater-than signs are rendered incorrectly (answer evaluator works correctly), for example less-than is shown as an upside down exclamation mark. This is of course what happens if less-than sign is TeX'ed as text (as opposed to verbatim or math modes). Answer Preview image alt tag is \text{<}.

Is this something that can be configured/fixed in Webwork, or should something different be used in a problem file? These are old .pg files and the Answer Preview problem wasn't reported until now...

Thanks, Sarunas

<| Post or View Comments |>


userMichael Gage - Re: Answer Preview, images mode  blueArrow
10/24/2006; 11:31:20 AM (reads: 265, responses: 0)
I suspect this can be fixed in the problem .pg file -- the answer evaluators have some control on preparing the preview string and early versions might not be completely compatible with current typeset previewing abilities.

If this is a library file then it would help to use the PG editor to file a report in the bugzilla database. (Click "edit this problem" and then enter a description of the problem in bugzilla. The first time you do this you will need to give bugzilla an email address so that it can notify you about fixes.) If it is not a problem library you can also report it to bugzilla, but you should include the code for the problem.

You can also report back the path to the problem here and we can see if there is something obvious that needs to be done.

-- Mike

<| Post or View Comments |>


userarūnas Burdulis - Re: Answer Preview, images mode  blueArrow
10/30/2006; 2:09:54 PM (reads: 225, responses: 0)
This particular .pg file is from the Dartmouth's Stewart library: http://webhost.math.rochester.edu/webworkdocs/ww/viewSource/dartmouthLibrary/Stewart/setStewartCh13S1/problem_5.pg.

I have looked at answer macros documentation, but I'm unable to figure out, how str_cpm("<=") can be fixed for preview. Any hints?

Thanks, Sarunas

<| Post or View Comments |>


userDavide P. Cervone - Re: Answer Preview, images mode  blueArrow
11/1/2006; 6:04:58 PM (reads: 197, responses: 0)
It is possible to use the new parser to do the string checking for you. The Parser handles the TeX display of constants differently from the standard string answer checker, and it also provides a method for you to set the TeX string for it to use. Here is a code snippet that you could use to replace ANS(str_cmp("<=")) in the problem you cite above:
   loadMacros("contextString.pl");
Context()->strings->are(
'<' => {},
'<=' => {},
'=' => {},
'>=' => {},
'>' => {},
);
ANS(string_cmp("<="));
(The empty braces could be used to define the TeX string to use, or other parameters, but there is no need to in this case).

You might also consider replacing the second answer blank by a pull-down menu that contains the five choices that you want to use. This might make it unnecessary to have the explanations of what to type and which blanks are for what. If you want to try that, you can replace the second ans_rule call with

   pop_up_list(
"" => "",
"<" => "<",
"<=" => "<=",
"=" => "=",
">=" => ">=",
">" => ">",
)
Here, the first of the two copies of each inequality is the label used in the popup menu, and the second is the answer string that it produces.

Finally, it would be possible to use the new parser to define the inequalities so that students can type their answers as, for example, x^2 + y^2 + z^2 <= 25, but that would take a bit of coding and I don't currently have time to do it. I'll try to get to it soon and post an example here.

Davide

<| Post or View Comments |>


userarūnas Burdulis - Re: Answer Preview, images mode  blueArrow
11/3/2006; 12:17:45 PM (reads: 187, responses: 0)
Thanks Davide,

Your suggestions/code worked perfectly!

Sarunas

<| Post or View Comments |>