From: Davide P.C. <dp...@un...> - 2005-07-06 15:59:33
|
> This script is great. > I've converted the rochester problem library and haven't found > any glitches yet. I'm glad it is working out for you. > I think we should add the string compare functions as well. OK, no problem. I'll add them to the table of routines to convert. I notice in PGanswermacros.pl that in addition to setting the filters, they also set a type flag. Do you want that to be included in the conversion? That is, should strict_str_cmp("foobar") produce str_cmp("foobar",filters=>'trim_whitespace') or str_cmp("foobar",filters=>'trim_whitespace', type=>'strict_str_cmp') I think it should be the former, but I don't know how the type flag might be used later on, if at all. I suspect it is just informational and can be ignored. Also, do you prefer str_cmp("foobar",filters=>'trim_whitespace') or just str_cmp("foobar",'trim_whitespace') as the result? > Here are some examples of str_cmp > I found in actual problems: > > ANS( str_cmp( $ml -> ra_correct_ans ) ); # no change needed here right > ANS(std_num_str_cmp($ans, ['N'])); # make sure this is handled > properly That one should already be handled by the version you have. It is converted to ANS(num_cmp($ans, strings=>['N'])); which is what you want, right? I'll send an updated version when I know how to handle the 'type' flag above. Davide |