Skip to content

Commit

Permalink
Use \verb rather than \text, since it will show more characters
Browse files Browse the repository at this point in the history
properly, and will handle missmatched braces in student answers.


git-svn-id: http://svn.webwork.maa.org/system/trunk/pg@5694 c0722133-6baf-4dd8-8699-98d999cd4f06
  • Loading branch information
dpvc committed Jun 14, 2008
1 parent 2075c8c commit 7ae7138
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions macros/PGstringevaluators.pl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
################################################################################
# WeBWorK Online Homework Delivery System
# Copyright © 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
# $CVSHeader: pg/macros/PGstringevaluators.pl,v 1.1 2007/11/08 00:00:15 sh002i Exp $
# $CVSHeader: pg/macros/PGstringevaluators.pl,v 1.2 2007/11/10 21:48:22 gage Exp $
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of either: (a) the GNU General Public License as published by the
Expand Down Expand Up @@ -578,10 +578,11 @@ sub STR_CMP {
$rh_ans;
});
$answer_evaluator->install_post_filter(sub {
my $rh_hash = shift;
my $rh_hash = shift; my $c = chr(128); ## something that won't be typed
$rh_hash->{_filter_name} = "clean up preview strings";
$rh_hash->{'preview_text_string'} = $rh_hash->{student_ans};
$rh_hash->{'preview_latex_string'} = "\\text{ ".$rh_hash->{student_ans}." }";
# $rh_hash->{'preview_latex_string'} = "\\text{ ".$rh_hash->{student_ans}." }";
$rh_hash->{'preview_latex_string'} = "\\verb".$c.$rh_hash->{student_ans}.$c;
$rh_hash;
});
return $answer_evaluator;
Expand Down

0 comments on commit 7ae7138

Please sign in to comment.